Class GltfConversions
Provides data accessors and conversions useful while reading and using glTF objects.
Inheritance
GltfConversions
Assembly: cs.temp.dll.dll
public static class GltfConversions
Methods
Get Color array from accessor
Declaration
public static Color[] GetColorArray(this GltfAccessor accessor)
Parameters
Type |
Name |
Description |
GltfAccessor |
accessor |
|
Returns
Get Color from float array
Declaration
public static Color GetColorValue(this float[] colorArray)
Parameters
Type |
Name |
Description |
Single[] |
colorArray |
|
Returns
Get Int array from accessor
Declaration
public static int[] GetIntArray(this GltfAccessor accessor, bool flipFaces = true)
Parameters
Type |
Name |
Description |
GltfAccessor |
accessor |
|
Boolean |
flipFaces |
|
Returns
Get Matrix from double array
Declaration
public static Matrix4x4 GetMatrix4X4Value(this double[] matrixArray)
Parameters
Type |
Name |
Description |
Double[] |
matrixArray |
|
Returns
Type |
Description |
Matrix4x4 |
|
Get Quaternion from float array
Declaration
public static Quaternion GetQuaternionValue(this float[] quaternionArray, bool convert = true)
Parameters
Returns
Type |
Description |
Quaternion |
|
Get TRS properties from GltfNode
Declaration
public static Matrix4x4 GetTrsProperties(this GltfNode node, out Vector3 position, out Quaternion rotation, out Vector3 scale)
Parameters
Type |
Name |
Description |
GltfNode |
node |
|
Vector3 |
position |
|
Quaternion |
rotation |
|
Vector3 |
scale |
|
Returns
Type |
Description |
Matrix4x4 |
|
Get TRS properties from matrix
Declaration
public static void GetTrsProperties(this Matrix4x4 matrix, out Vector3 position, out Quaternion rotation, out Vector3 scale)
Parameters
Type |
Name |
Description |
Matrix4x4 |
matrix |
|
Vector3 |
position |
|
Quaternion |
rotation |
|
Vector3 |
scale |
|
Get Vector2 array from accessor
Declaration
public static Vector2[] GetVector2Array(this GltfAccessor accessor, bool flip = true)
Parameters
Type |
Name |
Description |
GltfAccessor |
accessor |
|
Boolean |
flip |
|
Returns
Type |
Description |
Vector2[] |
|
Get Vector2 from float array
Declaration
public static Vector2 GetVector2Value(this float[] vector2Array)
Parameters
Type |
Name |
Description |
Single[] |
vector2Array |
|
Returns
Get Vector3 array from accessor
Declaration
public static Vector3[] GetVector3Array(this GltfAccessor accessor, bool convert = true)
Parameters
Type |
Name |
Description |
GltfAccessor |
accessor |
|
Boolean |
convert |
|
Returns
Type |
Description |
Vector3[] |
|
Get Vector3 from float array
Declaration
public static Vector3 GetVector3Value(this float[] vector3Array, bool convert = true)
Parameters
Returns
Get Vector4 array from accessor
Declaration
public static Vector4[] GetVector4Array(this GltfAccessor accessor, bool convert = true)
Parameters
Type |
Name |
Description |
GltfAccessor |
accessor |
|
Boolean |
convert |
|
Returns
Type |
Description |
Vector4[] |
|