• Manual
  • Scripting API
    Show / Hide Table of Contents
    • Engine4
      • Axis4
      • BodyType
      • Bounds4
      • Buffer3
      • Buffer4
      • CollisionState
      • DirtyLevel
      • Euler4
      • Matrix4
      • Matrix4x5
      • MonoBehaviour4
      • PhysicsMaterial4
      • Plane4
      • ProjectionMode
      • Ray4
      • Renderer4
      • SimplexMode
      • Space4
      • SphereBounds4
      • Tensor4
      • Transform4
      • TransformCallback
      • Vector4
      • VertexProfile
      • VertexProfiles
      • VertexProfilesUtility
      • Viewer4
      • ViewerDispatch
      • VisualizeMode
    • Engine4.Internal
      • Buffer4Extension
      • Buffer4Template
      • INeedTransform4Scale
      • Matrix4AsEulerAttribute
      • MeshPool
      • Overloads
      • ProjectorJob
      • ProjectUnit
      • Reflected
      • Runtime
      • SequenceMode
      • Set<T>
      • Utility
    • Engine4.Physics
      • BoxCollider4
      • CapsuleCollider4
      • Collider4
      • CollisionCallback
      • CollisionHit4
      • Common
      • ConstantForce4
      • Physics4
      • RaycastHit4
      • Rigidbody4
      • SphereCollider4
    • Engine4.Rendering
      • CrossSection4
      • Cylinder4
      • Debugger4
      • Debugger4.IndiceGizmoShow
      • Frustum4
      • Gizmos4
      • GizmosContainer4
      • GizmosRenderer4
      • GizmosRenderer4.GizmoRendererType
      • IVisualizer
      • Modeler4
      • Modifier4
      • ParticleExtended4
      • ParticleVisualizer4
      • Primitive4
      • Primitive4.Shape
      • Projector4
      • SolidExtended4
      • SolidVisualizer4
      • Sphere4
      • UvMapMethod
      • Visualizer4
      • WireVisualizer4

    Class Buffer4

    Temporary representation of 4D mesh

    public class Buffer4
    Namespace Engine4
    Inheritance
    System.Object
    Buffer4

    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
    Snapshot()

    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()
    See Also
    Align(Int32)

    Extension Methods

    Buffer4Extension.AddBySequence(Buffer4, SequenceMode, Int32[])
    Buffer4Extension.AddBySequence(Buffer4, SequenceMode, VertexProfile[])
    Buffer4Extension.AddPoint(Buffer4, Int32[])
    Buffer4Extension.AddSegment(Buffer4, Int32[])
    Buffer4Extension.AddTriangle(Buffer4, Int32[])
    Buffer4Extension.AddQuad(Buffer4, Int32[])
    Buffer4Extension.AddTrimid(Buffer4, Int32[])
    Buffer4Extension.AddPolygon(Buffer4, Int32[])
    Buffer4Extension.AddVertex(Buffer4, Vector4[])
    Buffer4Extension.CopyTo(Buffer4, Buffer4)
    Buffer4Extension.CopyTo(Buffer4, Buffer4, Boolean)
    Buffer4Extension.Transform(Buffer4, Matrix4x5)
    Buffer4Extension.Transform(Buffer4, Matrix4x5, Vector4)
    Buffer4Extension.Colorize(Buffer4, Color)
    Buffer4Extension.Sequence(Buffer4, SequenceMode)
    Buffer4Extension.Sequence(Buffer4, SequenceMode, Int32, Int32)
    Buffer4Extension.SequenceGrid(Buffer4, Int32, Int32, Int32, Int32)
    Buffer4Extension.AddProfile(Buffer4, VertexProfile, VertexProfile)
    Buffer4Extension.AddProfile(Buffer4, VertexProfile, VertexProfile, VertexProfile)
    Buffer4Extension.AddProfile(Buffer4, VertexProfile, VertexProfile, VertexProfile, VertexProfile)
    Buffer4Extension.AddPoint(Buffer4, VertexProfile)
    Buffer4Extension.AddSegment(Buffer4, VertexProfile, VertexProfile)
    Buffer4Extension.AddTriangle(Buffer4, VertexProfile, VertexProfile, VertexProfile)
    Buffer4Extension.AddQuad(Buffer4, VertexProfile, VertexProfile, VertexProfile, VertexProfile)
    Buffer4Extension.AddTrimid(Buffer4, VertexProfile, VertexProfile, VertexProfile, VertexProfile)
    Buffer4Extension.AddPyramid(Buffer4, VertexProfile, VertexProfile, VertexProfile, VertexProfile, VertexProfile)
    Buffer4Extension.AddPrism(Buffer4, VertexProfile, VertexProfile, VertexProfile, VertexProfile, VertexProfile, VertexProfile)
    Buffer4Extension.AddCube(Buffer4, VertexProfile, VertexProfile, VertexProfile, VertexProfile, VertexProfile, VertexProfile, VertexProfile, VertexProfile)
    ▲ Copyright © 2017 Wello Soft