Adobe ATMOSPHERE User Manual page 347

Table of Contents

Advertisement

getFace(index)
Returns the Face of the Primitive at the given index.
billboard = stageModel.getPrimitive("Box");
theFace = billboard.getFace(2);
getFaceCount()
Returns the number of Faces the Primitive has.
billboard = stageModel.getPrimitive("Box");
numFaces = billboard.getFaceCount();
chat.print("The primitive has " + numFaces + " face(s)");
getParentSceneObject()
Returns the parent 'SceneObject' for this primitive. Currently, this object will be of type 'SolidObject' only.
(Future updates may enable many types of objects to have primitives.)
myPrimitiveParent = myPrimitive.getParentSceneObject();
toString()
Returns the name of the object (assigned in the Builder) as a string. If a name was not assigned, the type is
returned.
for ( i=0 ; i < stageModel.getSolidObject(0).rootPrimitive.children.length ; i++ )
{
chat.print( stageModel.getSolidObject(0).rootPrimitive.children[i].toString() );
}
Callbacks
onClick(string what, mods)
Called when the user clicks on the associated Primitive. what is the lowest-level WorldObject that was hit, which
may differ from this if this is, e.g., a Group which contains a number of child Primitives. mods is an integer
bitmask indicating modifi er keys (e.g., shift, control, etc..) which were down during the click event, and may
contain other fl ags as well. The exact interpretation of mods is presently still under development and subject to
change.
stageModel.getSolidObject(0).rootPrimitive.onClick = function(what)
{
if (what.name != null)
{
chat.print("You clicked on " + what.name);
}
}
335
ADOBE ATMOSPHERE
User Guide

Advertisement

Table of Contents
loading

Table of Contents