Adobe ATMOSPHERE User Manual page 340

Table of Contents

Advertisement

328
APPENDIX E
useDynamicLighting
A fl ag specifying whether dynamic lighting should be enabled for this Viewpoint object.
viewpointObject.useDynamicLighting = true;
visible
A fl ag specifying whether the Viewpoint object should be rendered in the scene.
viewpointObject.visible = false;
Methods
createPhysicalModel(mass, inertiaScale)
A function that takes the current Viewpoint geometry and creates a physical model with the given mass.Once
created, the physical model will modify the tranform of the Viewpoint object as it experiences external forces,
collisions and constraints.
For this version of the function, the physical model uses the full geometry of the SceneGroup, which may
slow down the physics simulation if done for many complex objects. The one exception is if the physical
model is created with a mass of zero, in which case it will be fi xed in place, and will allow for effi cient collision
computations with other objects.
Mass is a relative scale, and a density index of "1" per square foot of geometric volume is a reasonable starting
point. For example, a box with thedimensions of [1x1x1] would be assigned a mass of "1". A box which is
[2x2x2] would be assigned amass of "8", since the volume of the box is 8 square feet. It should be noted that for
any of the physics based constraints or actions, there are conditions under which the physics processing may
become unstable. Exerting very large forces on very lightobjects may cause the calculations to be driven out
of scope(to infi nity). These conditions can be avoided by assigning reasonable mass values when creating the
physical models, as described above. The designer should experiment with mass values and forces applied to
insure that physics and javascript processing are not brought to a halt.
The inertia scale may be used to scale the moment of inertia of the object. Sometimes constraints may be made
more stable by scaling up the moments of inertia of the physical models that they affect.
boxPhysicalModel = boxViewPointObject.createPhysicalModel(1, 1);
createPhysicalModelForMTSInstance(mass, inertiaScale)
A function similar to above, but which can be used at the instance level (more specifi c). For example, in
a viewpoint scene which contains a number of instances, thismethod can be applied to just one of those
instances. In doing so, the physical model created and the instance itself will now be rendered and processed as
a separate object. Care should be given to following the guidelines for mass and inertia values as described in
createPhysicalModel() above.
boxPhysicalModel = boxInstance.createPhysicalModelForMTSInstance(1, 1);
createConvexPhysicalModel(mass, inertiaScale)
A function that takes the current Viewpoint geometry and creates a physical model with the given mass. The
inertia scale may be used to scale the moment of inertia of the object. Sometimes constraints may be made

Advertisement

Table of Contents
loading

Table of Contents