Falco Engine 3.9.0.1 (beta)
Spline.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Runtime.CompilerServices;
5using System.Text;
6
7namespace FalcoEngine
8{
9 public class Spline : Component
10 {
11 internal Spline()
12 {
13
14 }
15
16 /*----------- PUBLIC ------------*/
17
21 public int numPoints { [MethodImpl(MethodImplOptions.InternalCall)] get; }
22
27 public void AddPoint(Vector3 value)
28 {
29 INTERNAL_addPoint(ref value);
30 }
31
36 public void RemovePoint(int index)
37 {
38 INTERNAL_removePoint(index);
39 }
40
46 public Vector3 GetPoint(int index)
47 {
48 INTERNAL_getPoint(index, out Vector3 value);
49 return value;
50 }
51
57 public void SetPoint(int index, Vector3 value)
58 {
59 INTERNAL_setPoint(index, ref value);
60 }
61
67 public Vector3 GetSplinePoint(float t)
68 {
69 INTERNAL_getSplinePoint(t, out Vector3 value);
70 return value;
71 }
72
79 {
80 INTERNAL_getSplineDirection(t, out Vector3 value);
81 return value;
82 }
83
84 /*----------- INTERNAL CALLS ------------*/
85
86 [MethodImpl(MethodImplOptions.InternalCall)]
87 private extern void INTERNAL_addPoint(ref Vector3 value);
88
89 [MethodImpl(MethodImplOptions.InternalCall)]
90 private extern void INTERNAL_removePoint(int index);
91
92 [MethodImpl(MethodImplOptions.InternalCall)]
93 private extern void INTERNAL_getPoint(int index, out Vector3 value);
94
95 [MethodImpl(MethodImplOptions.InternalCall)]
96 private extern void INTERNAL_setPoint(int index, ref Vector3 value);
97
98 [MethodImpl(MethodImplOptions.InternalCall)]
99 private extern void INTERNAL_getSplinePoint(float t, out Vector3 value);
100
101 [MethodImpl(MethodImplOptions.InternalCall)]
102 private extern void INTERNAL_getSplineDirection(float t, out Vector3 value);
103 }
104}
int numPoints
Get number of points in the spline
Definition: Spline.cs:21
Vector3 GetSplineDirection(float t)
Get direction on the spline at described position (0...1)
Definition: Spline.cs:78
Vector3 GetPoint(int index)
Get point by index
Definition: Spline.cs:46
Vector3 GetSplinePoint(float t)
Get interpolated point on the spline at described position (0...1)
Definition: Spline.cs:67
void SetPoint(int index, Vector3 value)
Set point by index
Definition: Spline.cs:57
void AddPoint(Vector3 value)
Add point to the spline
Definition: Spline.cs:27
void RemovePoint(int index)
Remove point from the spline by index
Definition: Spline.cs:36