Vertex buffers are limited to 65K vertexes because of the 16-bits limitation of the index buffers. BigPrimitive allows you to easily create large buffers by spliting the buffers.

Constructor

@:value({ isRaw : false })new(stride:Int, isRaw:Bool = false)

Variables

@:value(false)hasTangents:Bool = false

@:value(true)isStatic:Bool = true

Methods

@:value({ stride : -1, scale : 1., rotation : 0., dz : 0., dy : 0., dx : 0. })add(buf:FloatBuffer, idx:IndexBuffer, dx:Float = 0., dy:Float = 0., dz:Float = 0., rotation:Float = 0., scale:Float = 1., stride:Int = -1):Void

Adds a complete object to the primitive, with custom position,scale,rotation. See addSub for complete documentation.

inlineaddBounds(x:Float, y:Float, z:Float):Void

inlineaddIndex(i:Int):Void

inlineaddPoint(x:Float32, y:Float32, z:Float32):Void

This is similar to addVertexValue for X Y and Z, but will also update the bounds if you wish to have them calculated.

@:value({ mat : null, color : 1., deltaV : 0., deltaU : 0., stride : -1, scale : 1., rotation : 0., dz : 0., dy : 0., dx : 0. })@:noDebugaddSub(buf:FloatBuffer, idx:IndexBuffer, startVert:Int, startTri:Int, nvert:Int, triCount:Int, dx:Float = 0., dy:Float = 0., dz:Float = 0., rotation:Float = 0., scale:Float = 1., stride:Int = -1, deltaU:Float = 0., deltaV:Float = 0., color:Float = 1., ?mat:Matrix):Void

Adds a buffer to the primitive, with custom position,scale,rotation. The buffer can have more stride than the BigPrimitive, but not less. It is assumed that the buffer contains [X,Y,Z,NX,NY,NZ,U,V,R,G,B] (depending on his stride) so the different offsets are applied to the corresponding components. If hasTangent=true, we have [TX,TY,TZ] just after normal. However if the stride is 5, we assume [X,Y,Z,U,V] If mat is not null, it overrides dx, dy, dz, rotation, scale

inlineaddVertexValue(v:Float32):Void

begin(vcount:Int, icount:Int):Void

Call begin() before starting to add vertexes/indexes to the primitive. The count value is the number of vertexes you will add, it will automatically flush() if it doesn't fit into the current buffer.

clear():Void

flush():Void

Flush the current buffer. It is required to call begin() after a flush()

Inherited Variables

Defined by Primitive

buffer:Buffer

The primitive vertex buffer, holding its vertexes data.

indexes:Indexes

The primitive indexes buffer, holding its triangles indices.

@:value(0)read onlyrefCount:Int = 0

Current amount of references to this Primitive.
Use incref and decref methods to affect this value. If it reaches 0, it will be atuomatically disposed.

Inherited Methods

Defined by Primitive

alloc(engine:Engine):Void

Allocate the primitive on GPU. Used for internal usage.

decref():Void

Decrease reference count of the Primitive.
If recount reaches zero, Primitive is automatically disposed when last referencing mesh is removed from scene.

getCollider():Collider

Return a local collider for the primitive

incref():Void

Increase reference count of the Primitive.

selectMaterial(material:Int):Void

Select the specified sub material before drawin. Used for internal usage.

toString():Null<String>

Return the primitive type.