User Guide

332 APPENDIX E
}
addAnimator(loader);
Primitive
A Primitive is a module used to represent a Builder group, anchor, entrypoint or geometric primitive. Every solid
object has a rootPrimitive which is the top level group from the Builder fi le for that solid object. (Currently there is
only one solid object per SceneGroup.) This root primitive may be searched by name to fi nd other primitives using
the “fi nd” function. Anchors are a form of primitive often used to pass locations and orientations to scripts from the
Builder. Other primitives will be actual geometry which will contain faces.
Global Properties
rootPrimitive
The top-level group of a Solid Object.
stageModel.getSolidObject(0).rootPrimitive.onClick = function()
{
chat.print(“You clicked the world”);
}
Properties
type
The object’s type. Returns “Primitive”.
if (foo.type == ‘Primitive’) { ... }
subType
The primitives type. I.e. the type of solid it is in the Builder: Column, Box, Cone, etc.
if (foo.subYype == ‘Column’) { ... }
loaded
Boolean fl ag that is set to true when the Primitive’s owner SceneGroup is fully loaded and ready.
foo.timestep = function()
{
if (!this.loaded) { return; }
// loaded, now do something
}
addAnimator(foo);
orientation
The orientation of the Primitive as set in the Builder, expressed as a Rotation. Presently this only applies to
Entrypoints and Anchors.
root = stageModel.getSolidObject(0).rootPrimitive;
anchor = root.fi nd(“.../anchorPoint”);