Class GltfExtensions
Assimp extensions.
Namespace: Evergine.Runtimes.GLB
Assembly: Evergine.Runtimes.GLB.dll
Syntax
public static class GltfExtensions
Methods
GetByteSize(ComponentTypeEnum)
Gets the byte size of the component type.
Declaration
public static int GetByteSize(this Accessor.ComponentTypeEnum componentType)
Parameters
Type | Name | Description |
---|---|---|
Accessor.ComponentTypeEnum | componentType | The component type. |
Returns
Type | Description |
---|---|
int | The byte size. |
GetComponentCount(TypeEnum)
Gets the byte size of the component type.
Declaration
public static int GetComponentCount(this Accessor.TypeEnum type)
Parameters
Type | Name | Description |
---|---|---|
Accessor.TypeEnum | type | The type. |
Returns
Type | Description |
---|---|
int | The byte size. |
GetFormatInfo(ComponentTypeEnum, TypeEnum, out int, out int, out int)
Get skip info.
Declaration
public static void GetFormatInfo(Accessor.ComponentTypeEnum componentType, Accessor.TypeEnum type, out int skipEvery, out int skipBytes, out int elementSize)
Parameters
Type | Name | Description |
---|---|---|
Accessor.ComponentTypeEnum | componentType | The component type. |
Accessor.TypeEnum | type | The type. |
int | skipEvery | Skip every nth component. |
int | skipBytes | The number of bytes to skip. |
int | elementSize | The size of each element in bytes. |
ToEvergine(WrapSEnum)
Converts wrap enum to Evergine.
Declaration
public static TextureAddressMode ToEvergine(this Sampler.WrapSEnum wrapS)
Parameters
Type | Name | Description |
---|---|---|
Sampler.WrapSEnum | wrapS | The wrap S mode. |
Returns
Type | Description |
---|---|
TextureAddressMode | The address mode. |
ToEvergine(WrapTEnum)
Converts the wrap enum to Evergine.
Declaration
public static TextureAddressMode ToEvergine(this Sampler.WrapTEnum wrapT)
Parameters
Type | Name | Description |
---|---|---|
Sampler.WrapTEnum | wrapT | The wrap T mode. |
Returns
Type | Description |
---|---|
TextureAddressMode | The address mode. |
ToEvergineAlpha(IEnumerable<float>)
To Evergine color with alpha.
Declaration
public static float ToEvergineAlpha(this IEnumerable<float> enumerable)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<float> | enumerable | The enumerable. |
Returns
Type | Description |
---|---|
float | The Evergine color. |
ToEvergineColor(IEnumerable<float>)
Converts to an Evergine color.
Declaration
public static Color ToEvergineColor(this IEnumerable<float> enumerable)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<float> | enumerable | The enumerable. |
Returns
Type | Description |
---|---|
Color | The Evergine color. |
ToEvergineColorAlpha(IEnumerable<float>)
Converts to an Evergine color with alpha.
Declaration
public static Color ToEvergineColorAlpha(this IEnumerable<float> enumerable)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<float> | enumerable | The enumerable. |
Returns
Type | Description |
---|---|
Color | The Evergine color. |
ToEvergineMatrix(float[])
To Evergine matrix.
Declaration
public static Matrix4x4 ToEvergineMatrix(this float[] m)
Parameters
Type | Name | Description |
---|---|---|
float[] | m | The matrix. |
Returns
Type | Description |
---|---|
Matrix4x4 | The Evergine matrix. |
ToEverginePrimitive(ModeEnum, out PrimitiveTopology)
Converts to Evergine primitive type.
Declaration
public static bool ToEverginePrimitive(this MeshPrimitive.ModeEnum mode, out PrimitiveTopology primitiveType)
Parameters
Type | Name | Description |
---|---|---|
MeshPrimitive.ModeEnum | mode | The glTF mode. |
PrimitiveTopology | primitiveType | The primitive type. |
Returns
Type | Description |
---|---|
bool | Indicates whether this primitive is supported. |
ToEvergineQuaternion(float[])
Converts to Evergine Color.
Declaration
public static Quaternion ToEvergineQuaternion(this float[] q)
Parameters
Type | Name | Description |
---|---|---|
float[] | q | The quaternion. |
Returns
Type | Description |
---|---|
Quaternion | The Evergine Quaternion. |
ToEvergineVector2(float[])
Converts to an Evergine Vector2.
Declaration
public static Vector2 ToEvergineVector2(this float[] v)
Parameters
Type | Name | Description |
---|---|---|
float[] | v | The vector. |
Returns
Type | Description |
---|---|
Vector2 | The Evergine Vector2. |
ToEvergineVector3(float[])
Converts to an Evergine Vector3.
Declaration
public static Vector3 ToEvergineVector3(this float[] v)
Parameters
Type | Name | Description |
---|---|---|
float[] | v | The vector to convert. |
Returns
Type | Description |
---|---|
Vector3 | An Evergine Vector3. |
ToEvergineVector4(float[])
To Evergine Color.
Declaration
public static Vector4 ToEvergineVector4(this float[] v)
Parameters
Type | Name | Description |
---|---|---|
float[] | v | The value to convert. |
Returns
Type | Description |
---|---|
Vector4 | The Evergine Color equivalent. |
ToFileExtension(MimeTypeEnum?)
Converts to file extension.
Declaration
public static string ToFileExtension(this Image.MimeTypeEnum? mimeType)
Parameters
Type | Name | Description |
---|---|---|
Image.MimeTypeEnum? | mimeType | The MIME type. |
Returns
Type | Description |
---|---|
string | The file extension. |
ToLinearColor(IEnumerable<float>)
To Evergine Linear color.
Declaration
public static LinearColor ToLinearColor(this IEnumerable<float> enumerable)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<float> | enumerable | The enumerable. |
Returns
Type | Description |
---|---|
LinearColor | The color in the Evergine linear space. |
VertexUsageFromString(string, out VertexElementUsage, out int)
Gets the vertex usage from string.
Declaration
public static void VertexUsageFromString(string semantic, out VertexElementUsage usage, out int usageIndex)
Parameters
Type | Name | Description |
---|---|---|
string | semantic | The semantic. |
VertexElementUsage | usage | The usage. |
int | usageIndex | The index of the usage. |