Constructor

new(pts:Array<Point>, ?uvs:Array<UV>, ?normals:Array<Point>)

You have to pass vertices in this order: top left, top right, bottom left, bottom right

Methods

addNormals():Void

addUVs():Void

Warning : This will splice four basic uv value but can provoke aliasing problems.

getPoints():Array<Point>

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

translate(dx:Float, dy:Float, dz:Float):Void

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

decref():Void

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

dispose():Void

Dispose the primitive, freeing the GPU memory it uses.

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.