Adobe ATMOSPHERE User Manual page 319

Table of Contents

Advertisement

Methods
add()
Adds the SceneGroup to the top-level World. Returns a reference to the SceneGroup as a convenience.
// Load the spider and add it to the world
spider = SceneGroup("./spider.aer").add();
addTo(parent)
Adds the SceneGroup as a child to the specifi ed SceneGroup. Returns the SceneGroup as a convenience.
// Load the hat and add it to my avatar
myHat = SceneGroup("./hat.aer").addTo(mySceneGroup);
remove()
Removes the SceneGroup from the top-level World. Note that the SceneGroup is still present in memory, but is
no longer processed by the rendering engine(and therefore not visible). This understanding may be useful for
performance improvement when many dynamic SceneGroups are present in the world. Using remove(), it is not
necessary to create and load the SceneGroups again, but simply to add() them back into the scene.
It is also now possible to remove SceneGroups from memory, if desired. To accomplish this, fi rst remove the
SceneGroup from the rendered world using remove() as shown below, then use the global JavaScript "delete"
method to remove the SceneGroup from memory.
// Remove the spider from the world
spider.remove();
// Also remove the SceneGroup from memory, if desired
delete spider;
getPrimitive(name)
Returns the fi rst Primitive with the given name from the SceneGroup's array of SolidObjects.
thePrimitive = theStage.getPrimitive("Lamp");
createDistantLight()
All worlds have one DistantLight by default. Additional DistantLights can be created with this method. Note
that light coordinate systems (X,Y,Z) are local to the SceneGroup from which they were created. (See the
documentation on DistantLight for a description of appearance and behavior.)
anotherLight = theStage.createDistantLight();
getDistantLight(index)
Returns the corresponding DistantLight at the given index.
theLight = theStage.getDistantLight(0);
getDistantLightCount()
Returns the number of DistantLights in the scene.
chat.print("There are " + stage.distantLightCount() + " light(s) in the scene.");
307
ADOBE ATMOSPHERE
User Guide

Advertisement

Table of Contents
loading

Table of Contents