class WMChain
Available on all platforms
A Chain; a chain consists of control points and 3D objects such as RIBBONs and COILs
A chain is a smooth line generated by Catmull-Rom method.
Instance Fields
function draw(c:Context3D, mpos:Matrix3D, proj:Matrix3D, voffset:Vector3D, light:Vector3D, cpos:Vector3D, dcActive:Bool, dcCoeff:Float, dcLength:Float):Bool
draw _polygon
on Stage3D
- light: direction of light
- cpos: position of camera
- dcActive: is depth cueing is active (false)
- dcCoeff: depth cueing coefficient (0.0)
- dcLength: depth cueing characteristic length (0.0)
function gen(c:Context3D, is_dc_active:Bool):Void
generate polygon and set corresponding shaders;
this function calls pregen
and gen2
.
function gen2(c:Context3D, is_dc_active:Bool):Void
generate polygon and shader. Call pregen
function before.
This function should not be called explicitly unless you are using
multiple Workers.
function num():Int
number of elements inside; return the number of control points. Both of given and automatically inserted points are considered.
function pregen():Void
preparation for generating polygon. This function is explicitly used in non-primordial Worker, where Context3D of the primordial Worker is not available. If Worker is not used, this function should not be called explicitly.
function register(r:WMRibbon):Void
register a RIBBON or COIL given by r
. The type of object can be
determined by isRibbon variable of r
.
function setPositions(pos:Array<Dynamic>, ni:Int):Void
Read a set of control point by array pos
.
If ni
is given, number of points automatiaclly inserted between given
points can be assigned. Default value of ni
is 2.