The 3D world for displaying the Objects.
World3D is a singleton class, it's the central point of Sandy :
You can have only one World3D, which contain Groups, Cameras and Lights
static public onRenderEVENT:EventTypestatic public onStartEVENT:EventTypestatic public onStopEVENT:EventTypestatic public onLightAddedEVENT:EventTypestatic public onContainerCreatedEVENT:EventTypepublic function resetContainer(mc:MovieClip):VoidRemoves the container clip and recreates it. This is a Kludge in order to clean up screen when resetting the world - unsupported and likely buggy
public function addEventListener(e:EventType, o):VoidAdd a listener for a specific event.
o | The object listener |
public function removeEventListener(e:EventType, oL):VoidRemove a listener for a specific event.
e | EventType The type of event we want to register |
oL | The object listener |
public function getObjects(Void):ArrayAllows to get the array of all the objects
Void |
Object3D array
static public function getInstance(mc:MovieClip):World3DGet the Singleton instance of World3D.
World3D, the only one instance possible
static public function getVersion(Void):StringReturns a version string ("1.2"), useful for conditional code
static public function killInstance(Void):World3DKills the single instance, so it can be recreated - unsupported and likely buggy
public function addCamera(pCam:Camera3D):Void
Set the Camera3D of the world. Deprecated. Maintained for backward-
compatibility with Sandy 1.1, even though it just sets the only camera.
public function getCameraList(Void):Array
Get the list of Camera3D of the world. Deprecated. Maintained for backward-
compatibility with Sandy 1.1, even though it just returns the only camera.
The Camera3D array
public function getCamera(id:Number):Camera3D
Get the Camera3D of the world.
@param id Number The id of the camera you want. Ignored. Always assumes 0.
The Camera3D
public function setLight(l:Light3D):VoidWe set the unique ligth of the 3D world.
l | Light3D The light instance |
Void nothing
public function getLight(Void):Light3DReturns the world light reference.
Void | Nothing |
Light3D The light reference
public function setAmbientLight(a:Number):VoidSpecify the lowest light level in the world
a | the light level |
public function getAmbientLight(Void):NumberGet the lowest light level setting
Number light level
public function setRootGroup(objGroup:Group):Void
Add a Group to the world.
objGroup | The group to add. It must not be a transformGroup ! |
Number The identifier of the object in the list. With that you will be able to use getGroup method.
public function getRootGroup(Void):Group
Get the root Group of the world.
Group THe root group of the World3D instance.
public function render(Void):VoidCompute all groups, and draw them. Should be call only once, or everytime after a Wordl3D.stop call.
public function stop(Void):VoidStop the rendering of the World3D. You can start again th rendering by calling render method.
public function getCurrentProjectionMatrix(Void):Matrix4Allows to get the current matrix projection ( usefull since there's several cameras allowed )
Void |
Matrix4 The current projection matrix
public function getCurrentCamera(Void):Camera3DAllows to get the current camera. Deprecated. Always returns first and only camera.
Void |
Camera3D The current camera