Class DracoDecoder
Provides Draco mesh decoding.
Inherited Members
Namespace: Draco
Assembly: solution.dll
Syntax
public static class DracoDecoder
Fields
defaultMeshUpdateFlags
These MeshUpdateFlags ensure best performance when using DecodeMesh variants that use MeshData as parameter. Pass them to the subsequent UnityEngine.Mesh.ApplyAndDisposeWritableMeshData(UnityEngine.Mesh.MeshDataArray, UnityEngine.Mesh, UnityEngine.Rendering.MeshUpdateFlags) method. They're used internally for DecodeMesh variants returning a Mesh directly.
Declaration
public const MeshUpdateFlags defaultMeshUpdateFlags = DontValidateIndices | DontResetBoneBounds | DontNotifyMeshUsers | DontRecalculateBounds
Field Value
Type | Description |
---|---|
MeshUpdateFlags |
Methods
CreateAttributeIdMap(int, int)
Creates an attribute type to index map from indices for bone weights and joints.
Declaration
public static Dictionary<VertexAttribute, int> CreateAttributeIdMap(int weightsAttributeId, int jointsAttributeId)
Parameters
Type | Name | Description |
---|---|---|
int | weightsAttributeId | Bone weights attribute index. |
int | jointsAttributeId | Bone joints attribute index. |
Returns
Type | Description |
---|---|
Dictionary<VertexAttribute, int> |
DecodeMesh(byte[])
Decodes a Draco mesh.
Declaration
public static Task<Mesh> DecodeMesh(byte[] encodedData)
Parameters
Type | Name | Description |
---|---|---|
byte[] | encodedData | Compressed Draco data |
Returns
Type | Description |
---|---|
Task<Mesh> | Unity Mesh or null in case of errors |
Remarks
Consider using DecodeMesh(MeshData, NativeSlice<byte>) for increased performance.
DecodeMesh(byte[], DecodeSettings)
Decodes a Draco mesh.
Declaration
public static Task<Mesh> DecodeMesh(byte[] encodedData, DecodeSettings decodeSettings)
Parameters
Type | Name | Description |
---|---|---|
byte[] | encodedData | Compressed Draco data |
DecodeSettings | decodeSettings | Decode setting flags |
Returns
Type | Description |
---|---|
Task<Mesh> | Unity Mesh or null in case of errors |
Remarks
Consider using DecodeMesh(MeshData, NativeSlice<byte>) for increased performance.
DecodeMesh(byte[], DecodeSettings, Dictionary<VertexAttribute, int>)
Declaration
public static Task<Mesh> DecodeMesh(byte[] encodedData, DecodeSettings decodeSettings, Dictionary<VertexAttribute, int> attributeIdMap)
Parameters
Type | Name | Description |
---|---|---|
byte[] | encodedData | |
DecodeSettings | decodeSettings | |
Dictionary<VertexAttribute, int> | attributeIdMap |
Returns
Type | Description |
---|---|
Task<Mesh> |
DecodeMesh(NativeSlice<byte>)
Decodes a Draco mesh.
Declaration
public static Task<Mesh> DecodeMesh(NativeSlice<byte> encodedData)
Parameters
Type | Name | Description |
---|---|---|
NativeSlice<byte> | encodedData | Compressed Draco data |
Returns
Type | Description |
---|---|
Task<Mesh> | Unity Mesh or null in case of errors |
Remarks
Consider using DecodeMesh(MeshData, NativeSlice<byte>) for increased performance.
DecodeMesh(NativeSlice<byte>, DecodeSettings)
Decodes a Draco mesh.
Declaration
public static Task<Mesh> DecodeMesh(NativeSlice<byte> encodedData, DecodeSettings decodeSettings)
Parameters
Type | Name | Description |
---|---|---|
NativeSlice<byte> | encodedData | Compressed Draco data |
DecodeSettings | decodeSettings | Decode setting flags |
Returns
Type | Description |
---|---|
Task<Mesh> | Unity Mesh or null in case of errors |
Remarks
Consider using DecodeMesh(MeshData, NativeSlice<byte>) for increased performance.
DecodeMesh(NativeSlice<byte>, DecodeSettings, Dictionary<VertexAttribute, int>)
Decodes a Draco mesh.
Declaration
public static Task<Mesh> DecodeMesh(NativeSlice<byte> encodedData, DecodeSettings decodeSettings, Dictionary<VertexAttribute, int> attributeIdMap)
Parameters
Type | Name | Description |
---|---|---|
NativeSlice<byte> | encodedData | Compressed Draco data |
DecodeSettings | decodeSettings | Decode setting flags |
Dictionary<VertexAttribute, int> | attributeIdMap | Attribute type to index map |
Returns
Type | Description |
---|---|
Task<Mesh> | Unity Mesh or null in case of errors |
Remarks
Consider using DecodeMesh(MeshData, NativeSlice<byte>) for increased performance.
DecodeMesh(MeshData, byte[])
Decodes a Draco mesh.
Declaration
public static Task<DecodeResult> DecodeMesh(Mesh.MeshData meshData, byte[] encodedData)
Parameters
Type | Name | Description |
---|---|---|
Mesh.MeshData | meshData | MeshData used to create the mesh |
byte[] | encodedData | Compressed Draco data |
Returns
Type | Description |
---|---|
Task<DecodeResult> | A DecodeResult |
DecodeMesh(MeshData, byte[], DecodeSettings)
Decodes a Draco mesh.
Declaration
public static Task<DecodeResult> DecodeMesh(Mesh.MeshData meshData, byte[] encodedData, DecodeSettings decodeSettings)
Parameters
Type | Name | Description |
---|---|---|
Mesh.MeshData | meshData | MeshData used to create the mesh |
byte[] | encodedData | Compressed Draco data |
DecodeSettings | decodeSettings | Decode setting flags |
Returns
Type | Description |
---|---|
Task<DecodeResult> | A DecodeResult |
DecodeMesh(MeshData, byte[], DecodeSettings, Dictionary<VertexAttribute, int>)
Decodes a Draco mesh.
Declaration
public static Task<DecodeResult> DecodeMesh(Mesh.MeshData meshData, byte[] encodedData, DecodeSettings decodeSettings, Dictionary<VertexAttribute, int> attributeIdMap)
Parameters
Type | Name | Description |
---|---|---|
Mesh.MeshData | meshData | MeshData used to create the mesh |
byte[] | encodedData | Compressed Draco data |
DecodeSettings | decodeSettings | Decode setting flags |
Dictionary<VertexAttribute, int> | attributeIdMap | Attribute type to index map |
Returns
Type | Description |
---|---|
Task<DecodeResult> | A DecodeResult |
DecodeMesh(MeshData, NativeSlice<byte>)
Decodes a Draco mesh.
Declaration
public static Task<DecodeResult> DecodeMesh(Mesh.MeshData meshData, NativeSlice<byte> encodedData)
Parameters
Type | Name | Description |
---|---|---|
Mesh.MeshData | meshData | MeshData used to create the mesh |
NativeSlice<byte> | encodedData | Compressed Draco data |
Returns
Type | Description |
---|---|
Task<DecodeResult> | A DecodeResult |
DecodeMesh(MeshData, NativeSlice<byte>, DecodeSettings)
Decodes a Draco mesh.
Declaration
public static Task<DecodeResult> DecodeMesh(Mesh.MeshData meshData, NativeSlice<byte> encodedData, DecodeSettings decodeSettings)
Parameters
Type | Name | Description |
---|---|---|
Mesh.MeshData | meshData | MeshData used to create the mesh |
NativeSlice<byte> | encodedData | Compressed Draco data |
DecodeSettings | decodeSettings | Decode setting flags |
Returns
Type | Description |
---|---|
Task<DecodeResult> | A DecodeResult |
DecodeMesh(MeshData, NativeSlice<byte>, DecodeSettings, Dictionary<VertexAttribute, int>)
Decodes a Draco mesh.
Declaration
public static Task<DecodeResult> DecodeMesh(Mesh.MeshData meshData, NativeSlice<byte> encodedData, DecodeSettings decodeSettings, Dictionary<VertexAttribute, int> attributeIdMap)
Parameters
Type | Name | Description |
---|---|---|
Mesh.MeshData | meshData | MeshData used to create the mesh |
NativeSlice<byte> | encodedData | Compressed Draco data |
DecodeSettings | decodeSettings | Decode setting flags |
Dictionary<VertexAttribute, int> | attributeIdMap | Attribute type to index map |
Returns
Type | Description |
---|---|
Task<DecodeResult> | A DecodeResult |