Adobe ATMOSPHERE User Manual page 296

Table of Contents

Advertisement

284
APPENDIX E
// Places the camera six feet behind the actor
offset = Vector(0.0, 0.0, 6.0);
bodyRelativeOffset = theActor.getHeadOrientation().map(offset);
camera.position = theActor.position.add(bodyRelativeOffset);
camera.orientation = theActor.getHeadOrientation();
setPosition(Vector or x,y,z)
Places the eye position of the actor at the specifi ed position, giving no consideration to collisions with other
objects.
// Place the actor at the exact location specifi ed.
target = Vector(10.0, 0.0, 6.0);
theActor.setPosition(target);
// or
theActor.setPosition(target.x, target.y, target.z);
getPositionAvoidingCollisions(Vector or x,y,z)
Returns a position which is as close to the desiredlocation as possible, taking into consideration the size of the
current actor avatar. Modifi es the passed position (a vector) in the minimum x/y/z direction necessary to place
the actor avatar in a location which does not collide with other objects.
This call would be useful in smoothing the path of a guided tour, for example. Since avatar sizes differ,
attempting to force an unknown avatar along a given path may cause numerous collisions, which in turn are
constantly corrected by the collision processor, causing jitters. Using this callto customize path locations will
eliminate the collisions, smoothing the experience for all.
// Find a location as close to specifi ed target as possible,
// while avoiding collisions with the fl oor, etc.
target = anchor7.position;
theActor.getPositionAvoidingCollisions(target);
// or
theActor.getPositionAvoidingCollisions(target.x, target.y, target.z);
setPositionAvoidingCollisions(Vector or x,y,z)
Places the eye position of the actor as close to the specifi ed position as possible while avoiding collisions with
other objects. This is useful when teleporting within a world.
// Places the actor as close to specifi ed target as possible,
// while avoiding collisions with the fl oor etc.
target = Vector(10.0, 0.0, 6.0);
theActor.setPositionAvoidingCollisions(target);
// or
theActor.setPositionAvoidingCollisions(target.x, target.y, target.z);
getSolidObjectCount()
Returns the solid object count for the Actor's SceneGroup currently in use. This is useful for modifying avatar
properties, such as dynamic lighting.
//get the actor SceneGroup geometry, and enable dynamic lighting
for (i = 0; i < theActor.getSolidObjectCount(); i++)

Advertisement

Table of Contents
loading

Table of Contents