PolygonalInterface
Class
Read time 6 minutesLast updated 8 months ago
Inheritance
Inherited Members
Namespace: UnityEngine.Pixyz.Polygonal
public class PolygonalInterface : Interface
Methods
GetLastError
public static string GetLastError()
Returns
Type | Description |
|---|---|
| string |
ConfigureFunctionLogger
[HandleProcessCorruptedStateExceptions]public void ConfigureFunctionLogger(string functionName, bool enableFunction, bool enableParameters, bool enableExecutionTime)
Parameters
GetPolygonCount
Returns the number of polygon of a mesh.
[HandleProcessCorruptedStateExceptions]public ulong GetPolygonCount(uint mesh, bool asTriangleCount = false)
Parameters
Type | Name | Description |
|---|---|---|
| uint | mesh | The mesh. |
| bool | asTriangleCount | If true count the equivalent of triangles for each polygon. |
Returns
Type | Description |
|---|---|
| ulong |
ComputeMeshTopoChecksum
Compute a checksum of the mesh topology, connectivity.
[HandleProcessCorruptedStateExceptions]public string ComputeMeshTopoChecksum(uint mesh)
Parameters
Type | Name | Description |
|---|---|---|
| uint | mesh | The mesh. |
Returns
Type | Description |
|---|---|
| string |
ComputeMeshVertexPositionsChecksum
Compute a checksum of the mesh vertices positions.
[HandleProcessCorruptedStateExceptions]public string ComputeMeshVertexPositionsChecksum(uint mesh, int precisionFloat = -1)
Parameters
Type | Name | Description |
|---|---|---|
| uint | mesh | The mesh. |
| int | precisionFloat | Floating point precision [1..24], number of significant numbers kept. -1 means no rounded will be applied. |
Returns
Type | Description |
|---|---|
| string |
ComputeUVTopoChecksum
Compute a checksum of the uvs topology, connectivity.
[HandleProcessCorruptedStateExceptions]public string ComputeUVTopoChecksum(uint mesh, int uvChannel)
Parameters
Returns
Type | Description |
|---|---|
| string |
ComputeUVVertexPositionsChecksum
Compute a checksum of the vertices positions in uv space.
[HandleProcessCorruptedStateExceptions]public string ComputeUVVertexPositionsChecksum(uint mesh, int uvChannel, int precisionFloat = -1)
Parameters
Type | Name | Description |
|---|---|---|
| uint | mesh | The mesh. |
| int | uvChannel | The uv channel. |
| int | precisionFloat | Floating point precision [1..24], number of significant numbers kept. -1 means no rounded will be applied. |
Returns
Type | Description |
|---|---|
| string |
DracoDecode
Decode a mesh using draco.
[HandleProcessCorruptedStateExceptions]public uint DracoDecode(ByteList buffer, int jointIndicesId = -1, int jointWeightsId = -1)
Parameters
Type | Name | Description |
|---|---|---|
| ByteList | buffer | |
| int | jointIndicesId | Unique ID of Generic attribute encoding joint indices. |
| int | jointWeightsId | Unique ID of Generic attribute encoding joint weights. |
Returns
Type | Description |
|---|---|
| uint |
DracoEncode
Encode a mesh using draco.
[HandleProcessCorruptedStateExceptions]public DracoEncodeReturn DracoEncode(uint mesh, int compressionLevel = 7, int quantizationPosition = -1, int quantizationNormal = -1, int quantizationTexCoord = -1)
Parameters
Type | Name | Description |
|---|---|---|
| uint | mesh | |
| int | compressionLevel | 0=faster but the worst compression, 10=slower but the best compression. |
| int | quantizationPosition | Number of quantization bits used for position attributes. |
| int | quantizationNormal | Number of quantization bits used for normal attributes. |
| int | quantizationTexCoord | Number of quantization bits used for texture coordinates attributes. |
Returns
Type | Description |
|---|---|
| DracoEncodeReturn |
CreateJointPlaceholders
Create fake joint to store in mesh definitions. Thus we can retrieve stored data from getJointPlaceholders.
[HandleProcessCorruptedStateExceptions]public PlaceholderJointList CreateJointPlaceholders(ULongList data, Matrix4List worldMatrices)
Parameters
Type | Name | Description |
|---|---|---|
| ULongList | data | Create as much joints as there are data, each joint store one data. |
| Matrix4List | worldMatrices | World matrix for each joints. |
Returns
Type | Description |
|---|---|
| PlaceholderJointList |
CreateMeshFromDefinition
Create a new mesh with the given MeshDefinition.
[HandleProcessCorruptedStateExceptions]public uint CreateMeshFromDefinition(MeshDefinition meshDefinition)
Parameters
Type | Name | Description |
|---|---|---|
| MeshDefinition | meshDefinition | Mesh definition. |
Returns
Type | Description |
|---|---|
| uint |
CreateMeshFromDefinitions
Create a new mesh from multiple MeshDefinition.
[HandleProcessCorruptedStateExceptions]public uint CreateMeshFromDefinitions(MeshDefinitionList meshDefinition)
Parameters
Type | Name | Description |
|---|---|---|
| MeshDefinitionList | meshDefinition | The MeshDefinitions. |
Returns
Type | Description |
|---|---|
| uint |
CreateMeshFromText
Creates an occurrence from string.
[HandleProcessCorruptedStateExceptions]public CreateMeshFromTextReturn CreateMeshFromText(string text, Matrix4 matrix, string font = "ChicFont", int fontSize = 64, ColorAlpha? color = null, double heigth3D = 40)
Parameters
Type | Name | Description |
|---|---|---|
| string | text | Text to create. |
| Matrix4 | matrix | A matrix to apply on mesh. |
| string | font | The font to use. |
| int | fontSize | The font size. |
| ColorAlpha | color | The occurrence color. |
| double | heigth3D | 3D height of text. |
Returns
Type | Description |
|---|---|
| CreateMeshFromTextReturn |
CreateMeshesFromDefinitions
Create new meshes with the given MeshDefinitions.
[HandleProcessCorruptedStateExceptions]public MeshList CreateMeshesFromDefinitions(MeshDefinitionList meshDefinitions)
Parameters
Type | Name | Description |
|---|---|---|
| MeshDefinitionList | meshDefinitions | The MeshDefinitions. |
Returns
Type | Description |
|---|---|
| MeshList |
GetJointPlaceholders
Get data stored in joint placeholders.
[HandleProcessCorruptedStateExceptions]public ULongList GetJointPlaceholders(PlaceholderJointList joints)
Parameters
Type | Name | Description |
|---|---|---|
| PlaceholderJointList | joints | Placeholder joints to get data from. |
Returns
Type | Description |
|---|---|
| ULongList |
GetMeshDefinition
Returns the mesh definition.
[HandleProcessCorruptedStateExceptions]public MeshDefinition GetMeshDefinition(uint mesh)
Parameters
Type | Name | Description |
|---|---|---|
| uint | mesh | The mesh to get definition. |
Returns
Type | Description |
|---|---|
| MeshDefinition |
GetMeshDefinitions
Returns the meshes definitions.
[HandleProcessCorruptedStateExceptions]public MeshDefinitionList GetMeshDefinitions(MeshList meshes)
Parameters
Type | Name | Description |
|---|---|---|
| MeshList | meshes | The meshes to get definitions. |
Returns
Type | Description |
|---|---|
| MeshDefinitionList |
GetMeshSkinning
Returns the joints/IBMs list of a given mesh (those referenced by jointIndices).
[HandleProcessCorruptedStateExceptions]public GetMeshSkinningReturn GetMeshSkinning(uint mesh)
Parameters
Type | Name | Description |
|---|---|---|
| uint | mesh |
Returns
Type | Description |
|---|---|
| GetMeshSkinningReturn |
HasMeshJoints
Check if the mesh has joints.
[HandleProcessCorruptedStateExceptions]public bool HasMeshJoints(uint mesh)
Parameters
Type | Name | Description |
|---|---|---|
| uint | mesh | The Mesh. |
Returns
Type | Description |
|---|---|
| bool |
HasNormalizedUVs
Check if the provided mesh UV channel contains normalized texture coordinates.
[HandleProcessCorruptedStateExceptions]public bool HasNormalizedUVs(uint mesh, int channel)
Parameters
Type | Name | Description |
|---|---|---|
| uint | mesh | The mesh that needs to be checked. |
| int | channel | The channel to verity. If set to -1, all channels are checked. |
Returns
Type | Description |
|---|---|
| bool |
HasUVs
Check if one or some UV channels are defined in the mesh.
[HandleProcessCorruptedStateExceptions]public bool HasUVs(uint mesh, int channel = -1)
Parameters
Returns
Type | Description |
|---|---|
| bool |
SetMeshSkinning
Set/Replace the list of joints/IBMs of a given mesh (those referenced by jointIndices).
[HandleProcessCorruptedStateExceptions]public void SetMeshSkinning(uint mesh, JointList joints, Matrix4List IBMs)
Parameters
Type | Name | Description |
|---|---|---|
| uint | mesh | |
| JointList | joints | |
| Matrix4List | IBMs | Inverse Bind Matrices. |
UsePointGapFillerNormal
This triangulates a set of points and normals.
[HandleProcessCorruptedStateExceptions]public IntList UsePointGapFillerNormal(Point3List points, Vector3List normals)
Parameters
Type | Name | Description |
|---|---|---|
| Point3List | points | The set of points to triangulate. |
| Vector3List | normals | The normals associated to the points to triangulate. This can be empty. |
Returns
Type | Description |
|---|---|
| IntList |