C# Class Spine.Unity.MeshGeneration.ArraysMeshGenerator

Datei anzeigen Open project: EsotericSoftware/spine-runtimes Class Usage Examples

Protected Properties

Property Type Description
addNormals bool
addTangents bool
attachmentVertexBuffer float[]
meshColors32 UnityEngine.Color32[]
meshNormals UnityEngine.Vector3[]
meshTangents UnityEngine.Vector4[]
meshUVs UnityEngine.Vector2[]
meshVertices UnityEngine.Vector3[]
tempTanBuffer UnityEngine.Vector2[]

Public Methods

Method Description
EnsureSize ( int targetVertexCount, Vector3 &vertices, Vector2 &uvs, Color32 &colors ) : bool

Ensures the sizes of the passed array references. If they are not the correct size, a new array will be assigned to the references.

EnsureTriangleBuffersSize ( ExposedList submeshBuffers, int targetSubmeshCount, Spine.Unity.MeshGeneration.SubmeshInstruction instructionItems ) : bool
FillTriangles ( int &triangleBuffer, Skeleton skeleton, int triangleCount, int firstVertex, int startSlot, int endSlot, bool isLastSubmesh ) : void

Fills a submesh triangle buffer array.

FillTrianglesQuads ( int &triangleBuffer, int &storedTriangleCount, int &storedFirstVertex, int instructionsFirstVertex, int instructionTriangleCount, bool isLastSubmesh ) : void
FillVerts ( Skeleton skeleton, int startSlot, int endSlot, float zSpacing, bool pmaColors, Vector3 verts, Vector2 uvs, Color32 colors, int &vertexIndex, float &tempVertBuffer, Vector3 &boundsMin, Vector3 &boundsMax, bool renderMeshes = true ) : void

Fills Unity vertex data buffers with verts from the Spine Skeleton.

SolveTangents2DBuffer ( Vector4 tangents, Vector2 tempTanBuffer, int vertexCount ) : void

Step 3 of solving tangents. Fills a Vector4[] tangents array according to values calculated in step 2.

SolveTangents2DEnsureSize ( Vector4 &tangentBuffer, Vector2 &tempTanBuffer, int vertexCount ) : void

Step 1 of solving tangents. Ensure you have buffers of the correct size.

SolveTangents2DTriangles ( Vector2 tempTanBuffer, int triangles, int triangleCount, Vector3 vertices, Vector2 uvs, int vertexCount ) : void

Step 2 of solving tangents. Fills (part of) a temporary tangent-solution buffer based on the vertices and uvs defined by a submesh's triangle buffer. Only needs to be called once for single-submesh meshes.

ToBounds ( Vector3 boundsMin, Vector3 boundsMax ) : Bounds

Creates a UnityEngine.Bounds struct from minimum and maximum value vectors.

TryAddNormalsTo ( Mesh mesh, int targetVertexCount ) : void

Method Details

EnsureSize() public static method

Ensures the sizes of the passed array references. If they are not the correct size, a new array will be assigned to the references.
public static EnsureSize ( int targetVertexCount, Vector3 &vertices, Vector2 &uvs, Color32 &colors ) : bool
targetVertexCount int
vertices UnityEngine.Vector3
uvs UnityEngine.Vector2
colors UnityEngine.Color32
return bool

EnsureTriangleBuffersSize() public static method

public static EnsureTriangleBuffersSize ( ExposedList submeshBuffers, int targetSubmeshCount, Spine.Unity.MeshGeneration.SubmeshInstruction instructionItems ) : bool
submeshBuffers ExposedList
targetSubmeshCount int
instructionItems Spine.Unity.MeshGeneration.SubmeshInstruction
return bool

FillTriangles() public static method

Fills a submesh triangle buffer array.
public static FillTriangles ( int &triangleBuffer, Skeleton skeleton, int triangleCount, int firstVertex, int startSlot, int endSlot, bool isLastSubmesh ) : void
triangleBuffer int The triangle buffer array to be filled. This reference will be replaced in case the triangle values don't fit.
skeleton Skeleton Spine.Skeleton source of draw order slots.
triangleCount int The target triangle count.
firstVertex int First vertex of this submesh.
startSlot int Start slot.
endSlot int End slot.
isLastSubmesh bool If set to true, the triangle buffer is allowed to be larger than needed.
return void

FillTrianglesQuads() public static method

public static FillTrianglesQuads ( int &triangleBuffer, int &storedTriangleCount, int &storedFirstVertex, int instructionsFirstVertex, int instructionTriangleCount, bool isLastSubmesh ) : void
triangleBuffer int
storedTriangleCount int
storedFirstVertex int
instructionsFirstVertex int
instructionTriangleCount int
isLastSubmesh bool
return void

FillVerts() public static method

Fills Unity vertex data buffers with verts from the Spine Skeleton.
public static FillVerts ( Skeleton skeleton, int startSlot, int endSlot, float zSpacing, bool pmaColors, Vector3 verts, Vector2 uvs, Color32 colors, int &vertexIndex, float &tempVertBuffer, Vector3 &boundsMin, Vector3 &boundsMax, bool renderMeshes = true ) : void
skeleton Skeleton Spine.Skeleton source of the drawOrder array
startSlot int Slot index of the first slot.
endSlot int The index bounding the slot list. [endSlot - 1] is the last slot to be added.
zSpacing float Spacing along the z-axis between attachments.
pmaColors bool If set to true, vertex colors will be premultiplied. This will also enable additive.
verts UnityEngine.Vector3 Vertex positions array.
uvs UnityEngine.Vector2 Vertex UV array.
colors UnityEngine.Color32 Vertex color array (Color32).
vertexIndex int A reference to the running vertex index. This is used when more than one submesh is to be added.
tempVertBuffer float A temporary vertex position buffer for attachment position values.
boundsMin UnityEngine.Vector3 Reference to the running calculated minimum bounds.
boundsMax UnityEngine.Vector3 Reference to the running calculated maximum bounds.
renderMeshes bool Include MeshAttachments. If false, it will ignore MeshAttachments.
return void

SolveTangents2DBuffer() public static method

Step 3 of solving tangents. Fills a Vector4[] tangents array according to values calculated in step 2.
public static SolveTangents2DBuffer ( Vector4 tangents, Vector2 tempTanBuffer, int vertexCount ) : void
tangents UnityEngine.Vector4 A Vector4[] that will eventually be used to set Mesh.tangents
tempTanBuffer UnityEngine.Vector2 A temporary Vector3[] for calculating tangents.
vertexCount int Number of vertices that require tangents (or the size of the vertex array)
return void

SolveTangents2DEnsureSize() public static method

Step 1 of solving tangents. Ensure you have buffers of the correct size.
public static SolveTangents2DEnsureSize ( Vector4 &tangentBuffer, Vector2 &tempTanBuffer, int vertexCount ) : void
tangentBuffer UnityEngine.Vector4 Eventual Vector4[] tangent buffer to assign to Mesh.tangents.
tempTanBuffer UnityEngine.Vector2 Temporary Vector2 buffer for calculating directions.
vertexCount int Number of vertices that require tangents (or the size of the vertex array)
return void

SolveTangents2DTriangles() public static method

Step 2 of solving tangents. Fills (part of) a temporary tangent-solution buffer based on the vertices and uvs defined by a submesh's triangle buffer. Only needs to be called once for single-submesh meshes.
public static SolveTangents2DTriangles ( Vector2 tempTanBuffer, int triangles, int triangleCount, Vector3 vertices, Vector2 uvs, int vertexCount ) : void
tempTanBuffer UnityEngine.Vector2 A temporary Vector3[] for calculating tangents.
triangles int The mesh's current triangles buffer.
triangleCount int The number of triangle indexes in the triangle array to be used.
vertices UnityEngine.Vector3 The mesh's current vertex position buffer.
uvs UnityEngine.Vector2 The mesh's current uvs buffer.
vertexCount int Number of vertices that require tangents (or the size of the vertex array)
return void

ToBounds() public static method

Creates a UnityEngine.Bounds struct from minimum and maximum value vectors.
public static ToBounds ( Vector3 boundsMin, Vector3 boundsMax ) : Bounds
boundsMin UnityEngine.Vector3
boundsMax UnityEngine.Vector3
return UnityEngine.Bounds

TryAddNormalsTo() public method

public TryAddNormalsTo ( Mesh mesh, int targetVertexCount ) : void
mesh UnityEngine.Mesh
targetVertexCount int
return void

Property Details

addNormals protected_oe property

protected bool addNormals
return bool

addTangents protected_oe property

protected bool addTangents
return bool

attachmentVertexBuffer protected_oe property

protected float[] attachmentVertexBuffer
return float[]

meshColors32 protected_oe property

protected Color32[],UnityEngine meshColors32
return UnityEngine.Color32[]

meshNormals protected_oe property

protected Vector3[],UnityEngine meshNormals
return UnityEngine.Vector3[]

meshTangents protected_oe property

protected Vector4[],UnityEngine meshTangents
return UnityEngine.Vector4[]

meshUVs protected_oe property

protected Vector2[],UnityEngine meshUVs
return UnityEngine.Vector2[]

meshVertices protected_oe property

protected Vector3[],UnityEngine meshVertices
return UnityEngine.Vector3[]

tempTanBuffer protected_oe property

protected Vector2[],UnityEngine tempTanBuffer
return UnityEngine.Vector2[]