Contains some functions useful for converting data for interop.
More...
Contains some functions useful for converting data for interop.
◆ FlattenVectorArray() [1/2]
static float[] DHARTAPI.NativeUtils.HelperFunctions.FlattenVectorArray |
( |
IEnumerable< Vector3D > |
vectors | ) |
|
|
static |
Convert a vector array into an array of floats. Slower than passing a Vector3D array.
- Parameters
-
vectors | The array of vectors to convert |
- Returns
- An array of floats 3x as big as the array of vectors.
◆ FlattenVectorArray() [2/2]
static float[] DHARTAPI.NativeUtils.HelperFunctions.FlattenVectorArray |
( |
Vector3D[] |
vectors | ) |
|
|
static |
◆ FloatArrayToVectorArray()
static Vector3D[] DHARTAPI.NativeUtils.HelperFunctions.FloatArrayToVectorArray |
( |
float[] |
float_array, |
|
|
bool[] |
result_array |
|
) |
| |
|
static |
Convert a flat array of floats into a vector of points where result_array is true.
- Parameters
-
float_array | The array of floats. Every 3 values should correspond to a single Vector3D |
result_array | Array of booleans where if false the Vector3D at this index will be set to null. Otherwise, it will be converted from the float array. |
- Returns
- An array of Vector3D where every 3 floats in float_array is a single vector3D.
- Precondition
- The length of
result_array
is equal to 1/3 the length of float_array
- Exceptions
-
ArgumentException | The number of elements in result_array is not equal to the number of elements in float_array / 3 |
The documentation for this class was generated from the following file:
- src/Csharp/packages/base/src/NativeUtils.cs