Class sandy.primitive.Box

Implemented Interfaces

Primitive3D

Description

Box

Box is a primitiv Object3D, to easy build a Cube/Box.

Field Index

Inherited from Object3D

Inherited from Node

Method Index

new Box()
generate(), getNumSurfaces(), getPrimitiveName(), getSize(), setSkins(), toString()

Inherited from Object3D

Inherited from Leaf

Inherited from Node

Constructor Detail

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

Parameters

rada Number represent the wide of the Box
ha Number represent the height of the Box
lga Number represent the depth of the Box
modeString represent the two available modes to generates the faces. "tri" is necessary to have faces with 3 points, and "quad" for 4 points.

Method Detail

generate

public function generate(Void):Void

generate

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

Specified By

generate() in sandy.primitive.Primitive3D

setSkins

public function setSkins(skins:Array)

Set skins per side.

Parameters

skinsArray of 6 skins to be applied in this order : front, right, back, left, bottom, top

getSize

public function getSize(Void):Vector

getSize() 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

Specified By

getSize() in sandy.primitive.Primitive3D

getNumSurfaces

public function getNumSurfaces(Void):Number

getPrimitiveName

public function getPrimitiveName(Void):String

toString

public function toString(Void):String

Description copied from Object3D

Represents the Object3D into a String.

Specified By

toString() in sandy.primitive.Primitive3D

Overrides

toString() in sandy.core.Object3D