* The MovieScene3D class lets you create a scene where each object is rendered in its own container.
* <p/>
* A scene is the place where objects are placed, it contains the 3D environment.
*/
public class MovieScene3D extends Scene3D
{
// ___________________________________________________________________ N E W
//
// NN NN EEEEEE WW WW
// NNN NN EE WW WW WW
// NNNNNN EEEE WWWWWWWW
// NN NNN EE WWW WWW
// NN NN EEEEEE WW WW
/**
* Creates a scene where each object is rendered in its own container.
*
* @param container The Sprite where the new containers are created.
*
*/
public function MovieScene3D( container:Sprite )
{
super( container );
this.containerList = new Array();
spriteList = new Dictionary();
}
// ___________________________________________________________________ A D D C H I L D
//
// AA DDDDD DDDDD CCCC HH HH II LL DDDDD
// AAAA DD DD DD DD CC CC HH HH II LL DD DD
// AA AA DD DD DD DD CC HHHHHH II LL DD DD
// AAAAAA DD DD DD DD CC CC HH HH II LL DD DD
// AA AA DDDDD DDDDD CCCC HH HH II LLLLLL DDDDD
/**
* Adds a child DisplayObject3D instance to the scene.
*
* If you add a GeometryObject3D symbol, a new DisplayObject3D instance is created.
*
* [TODO: If you add a child object that already has a different display object container as a parent, the object is removed from the child list of the other display object container.]
*
* @param child The GeometryObject3D symbol or DisplayObject3D instance to add as a child of the scene.
* @param name An optional name of the child to add or create. If no name is provided, the child name will be used.
* @return The DisplayObject3D instance that you have added or created.
*/
public override function addChild( child :DisplayObject3D, name :String=null ):DisplayObject3D
{
child = super.addChild( child, name );
child.container = new Sprite();
container.addChild( child.container );
this.containerList.push( child.container );
spriteList[child] = child.container;
return child;
}
public function getSprite(child:DisplayObject3D):Sprite
{
return spriteList[child];
}
// ___________________________________________________________________ R E N D E R C A M E R A
//
// RRRRR EEEEEE NN NN DDDDD EEEEEE RRRRR
// RR RR EE NNN NN DD DD EE RR RR
// RRRRR EEEE NNNNNN DD DD EEEE RRRRR
// RR RR EE NN NNN DD DD EE RR RR
// RR RR EEEEEE NN NN DDDDD EEEEEE RR RR CAMERA
/**
* Generates an image from the camera's point of view and the visible models of the scene.
*
* @param camera camera to render from.
*/
protected override function renderObjects( sort:Boolean ):void