Primitive3D Box
Box is a primitiv Object3D, to easy build a Cube/Box.
new Box()public function Box(rad:Number, h:Number, lg:Number, mode:String, quality:Number)Constructor
This is the constructor to call when you nedd to create a Box primitiv.
This method will create a complete object with vertex, normales, texture coords and the faces. So it allows to have a custom 3D object easily
rad | a Number represent the wide of the Box |
h | a Number represent the height of the Box |
lg | a Number represent the depth of the Box |
mode | String represent the two available modes to generates the faces. "tri" is necessary to have faces with 3 points, and "quad" for 4 points. |
public function generate(Void):Voidgenerate
Generate all is needed to construct the Object3D :
It can construct dynamically the object, taking care of your preferences given in arguments.
Note in Sandy 0.1 all faces have only three points.
This will change in the future version,
and give to you the possibility to choose n points per faces
public function setSkins(skins:Array)Set skins per side.
skins | Array of 6 skins to be applied in this order : front, right, back, left, bottom, top |
public function getSize(Void):VectorgetSize() returns the length, height, and radius as a Vector (useful for storing an object's attributes). Returns vector where x is the length, y is the height, and z is the radius
public function toString(Void):StringDescription copied from Object3D
Represents the Object3D into a String.
toString() in sandy.primitive.Primitive3D