User Guide

ADOBE ATMOSPHERE 243
User Guide
Appendix E: JavaScript API
JavaScript API Features
With the latest version of the Adobe® Atmosphere™ Player, the JavaScript API has been expanded to over 800
Properties, Methods, and Callbacks. This large library is intended to provide developers with access to nearly every
aspect of the Atmosphere Player 3D stage, as well as it’s supporting web page.
Now also included in the Atmosphere Player is the HAVOK® Physics processing engine, an industry leader in dynamic
simulation of object behavior, and the same engine found in today’s top electronic games. With this engine, objects in
an Atmosphere stage can respond to many simulated physical forces such as Wind, Magnetics, and Fluid, with faster
and more robust processing for Gravity and Collision. Objects can be constrained by powerful controllers such as
Wheel constraints, Hinge constraints, Spring constraints, and more.
Atmosphere also now supports 3D Hardware Acceleration for many of today’s popular graphics cards. This improved
graphic perfomance combined with powerful physics processing enable Atmosphere worlds to be much more
dynamic and immersive than ever before. Dynamic lighting (as a Distant Light) is also now available for added
realism, in addition to the powerful static radiosity rendering already present.
Support has also been added for additional features such as Keyboard Events, Media Playback (Windows media,
Flash, Quicktime), and the ability to syncronize object position and behavior for all visitors to the Stage.
Utility Functions
animators
The list of all registered animators. Some entries may be the value false. Animators are used each timestep to
callback a timestep function(now, deltaTime) if one has been defi ned for the animator. Animators are also called
back once with the onLoad(now) function, if it is defi ned. This happens after all scripts for the world have been
run and the animator’s “loaded” ag has transitioned from false to true.
chat.print (“There are (at most) “ + animators.size + “ animators.”);
context
indicates the context in which the script is being run:
worldContext The script is attached to a world that has been opened
localAvatarContext The script is attached to your avatar, running locally
remoteAvatarContext The script attached to your avatar, running on a remote client
if (context == localAvatarContext)
{
chat.print(“This is a LOCAL avatar script.”);
}