🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.atmosphere
Article #115

Re: Need help with viewpoint object collision!

#115
From: Sri_Balamurali
Date: Fri, 20 Aug 2004 04:49
58 lines
5504 bytes
The collision effect for viewpoint object can be provided by converting it as physical model.

The following url show a demo,

 <http://www.adobe.com/products/atmosphere/support/examples/PhysicalModel_VP2/javascript_tutorials_v2_demo.htm>

and the following are from Abobe atmosphere help document this will helpful for you.

////////////////////////////////////////////////////////

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 fixed in place, and will allow for efficient 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 infinity). 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.

example
----------
boxPhysicalModel = boxViewPointObject.createPhysicalModel(1, 1);

////////////////////////////////////////////////////////

createPhysicalModelForMTSInstance(mass, inertiaScale)

////////////////////////////////////////////////////////
           A function similar to above, but which can be used at the instance level (more specific). 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.

example
----------
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 more stable by scaling up the moments of inertia of the physical models that they affect. Once created, the physical model will modfy 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 convex hull of the Viewpoint object, which allows collisions to be much more efficiently computed by the physics engine. Care should be given to following the guidelines for mass and inertia values as described in createPhysicalModel() above.

example
----------
boxPhysicalModel = boxViewPointObject.createConvexPhysicalModel(1, 1);

////////////////////////////////////////////////////////

createConvexPhysicalModelForMTSInstance(mass, inertiaScale)

////////////////////////////////////////////////////////
           A function similar to above, but which can be used at the instance level (more specific). 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.

example
----------
boxPhysicalModel = boxInstance.createConvexPhysicalModelForMTSInstance

Balamurali.S
Technical Details
Message-ID: <3bb58f3d.1@webx.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!lnewsoutpeer01.lnd.ops.eu.uu.net!lnewsinpeer01.lnd.ops.eu.uu.net!emea.uu.net!newsfeed01.sul.t-online.de!t-online.de!webx
References: <3bb58f3d.-1@webx.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: fa820,54608b6d64cc6e19
X-Google-Attributes: gidfa820,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Sri_Balamurali@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!lnewsoutpeer01.lnd.ops.eu.uu.net!lnewsinpeer01.lnd.ops.eu.uu.net!emea.uu.net!newsfeed01.sul.t-online.de!t-online.de!webx
Newsgroups: adobe.atmosphere
Subject: Re: Need help with viewpoint object collision!
Message-ID: <3bb58f3d.1@webx.la2eafNXanI>
Date: Thu, 19 Aug 2004 21:49:21 -0700
References: <3bb58f3d.-1@webx.la2eafNXanI>
Lines: 104
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit