Class Buffer4
Temporary representation of 4D mesh
public class Buffer4
Namespace Engine4
Inheritance
Constructors
Buffer4()
Create an empty buffer
public Buffer4()
Buffer4(SimplexMode)
Create an empty buffer
public Buffer4(SimplexMode simplex)
Fields
m_Indices
Internal simplex (indices) buffer.
public int[] m_Indices
m_IndicesCount
public int m_IndicesCount
Remarks
Get internal indices count
m_Profiles
Internal vertex profile buffer (color, uv).
public VertexProfile[] m_Profiles
Remarks
Vertex profile respects to indices, not vertices
m_ProfilesCount
public int m_ProfilesCount
Remarks
Get internal profiles
m_Vertices
Internal vertex buffer
public Vector4[] m_Vertices
m_VerticesCount
public int m_VerticesCount
Remarks
Get internal vertices count
offset
A handy pointer to shift vertex buffer values relatively.
public int offset
Remarks
It's very recommended to control this param using Align() instead.
simplex
The simplex type that required by the renderer. Useful if you want to create a custom shape blocks.
public SimplexMode simplex
Remarks
Public for speed. ONLY SET WHEN ISEMPTY IS TRUE.
Methods
AddCube(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32)
Helper to add a cube from 8 existing verts index. A cube is constructed from 5 trimids, v0-v1-v2-v3 must be parallel (and in the same order) with v4-v5-v6-v7
public void AddCube(int v0, int v1, int v2, int v3, int v4, int v5, int v6, int v7)
AddPoint(Int32)
Add an artbitrary point.
public void AddPoint(int v0)
AddPrism(Int32, Int32, Int32, Int32, Int32, Int32)
Helper to add a triangular prism from 6 existing verts index. A prism is constructed from 3 trimids, v0-v1-v2 must be parallel (and in the same order) with v3-v4-v5
public void AddPrism(int v0, int v1, int v2, int v3, int v4, int v5)
AddProfile(VertexProfile)
Add a new profile to remaining indice
public void AddProfile(VertexProfile profile)
AddPyramid(Int32, Int32, Int32, Int32, Int32)
Helper to add a pyramid from 5 existing verts index. A pyramid is constructed from 2 trimids, v0 is the tip, the rest is the base.
public void AddPyramid(int v0, int v1, int v2, int v3, int v4)
AddQuad(Int32, Int32, Int32, Int32)
Add a flat quad. Must be either clockwise/counter-clockwise order.
public void AddQuad(int v0, int v1, int v2, int v3)
AddSegment(Int32, Int32)
Add a segment. Order doesn't matter.
public void AddSegment(int v0, int v1)
AddTriangle(Int32, Int32, Int32)
Add a flat triangle. Order doesn't matter.
public void AddTriangle(int v0, int v1, int v2)
AddTrimid(Int32, Int32, Int32, Int32)
Add a trimid (triangle pyramid) with given vert indexs. Order doesn't matter.
public void AddTrimid(int v0, int v1, int v2, int v3)
AddVertex(Vector4)
Add a vertex with default profile and return the index
public int AddVertex(Vector4 vert)
AddVertex(Int32)
Duplicate vertex and return the cloned index
public int AddVertex(int idx)
Remarks
Useful for sequencing operations
Align()
Move buffer forward to the end.
public void Align()
Remarks
Align are handy if used together with bulk operations (e.g. Sequence(Buffer4, SequenceMode))
Align(Int32)
Move buffer toward the given snapshot.
public void Align(int snapshot)
Remarks
Use Snapshot() to obtain snapshot at given position.
See Also
Clean()
Clear and Clean memory traces.
public void Clean()
Clear()
Clear the buffer.
public void Clear()
Clear(SimplexMode)
Clear the buffer.
public void Clear(SimplexMode mode)
IsEmpty()
Is the buffer empty?
public bool IsEmpty()
SetProfile(Int32, Color)
Modify profile color at given indice index
public void SetProfile(int index, Color color)
SetProfile(Int32, Vector4, Int32)
Modify profile uv at given indice index
public void SetProfile(int index, Vector4 uv, int uvIndex)
Snapshot()
Send copy of current buffer position to be reused later.
public int Snapshot()