Static methods

@:value({ segs : 16 })staticdefaultUnitCylinder(segs:Int = 16):Cylinder

Get a default unit Cylinder with segs = 16, ray = 0.5, height = 1.0, centered = false and add UVs to it. If it has not be cached, it is cached and subsequent calls to this method will return Cylinder from cache.

Parameters:

segs

Optional number of segments of the cylinder, default 16

Constructor

@:value({ centered : false, height : 1.0, ray : 1.0 })new(segs:Int, ray:Float = 1.0, height:Float = 1.0, centered:Bool = false)

Methods

Inherited Variables

Defined by Primitive

buffer:Buffer

The primitive vertex buffer, holding its vertexes data.

@:value(-1)forcedLod:Int = -1

Allow user to force a specific lod index. If set to -1, forced lod will be ignored.

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 Quads

addNormals():Void

getPoints():Array<Point>

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

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

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

getMaterialIndexes(material:Int):{start:Int, count:Int}

Returns the number and offset of indexes for the specified material

incref():Void

Increase reference count of the Primitive.

lodCount():Int

Return the LOD count.

screenRatioToLod(screenRatio:Float):Int

selectMaterial(material:Int, lod:Int):Void

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

toString():Null<String>

Return the primitive type.