re-use, freeze, de-activate a AWPRigidBody

Software: Away3D 4.x

entropic, Newbie
Posted: 25 May 2012 08:23 AM   Total Posts: 16

How can i disable ALL the impulses, forces, speed, motions of an object and make him a simple inert body READY FOR FURTHER motion “clean” vectors?

This is the simple problem and try to be as explicit.


I have a sphere created in Away3DPhysics.

var bodyBull:AWPRigidBody = new AWPRigidBody(_sphereShapesphere20); 

And i have applied an impulse to it from, let say, zero coordonates:

bodyBull.position = new Vector3D(00);
bodyBull.applyCentralImpulse(new Vector3D(x1y1z1)) 

Now, let say, i want to RE-USE the same sphere and i want to “RE LAUNCH” it again from the same zero point

bodyBull.position = new Vector3D(00);
bodyBull.applyCentralImpulse(new Vector3D(x2y2z2)) 

BUT THE SPHERE KEEP HAVE THE SPEED AND THE IMPULSE FROM THE FIRST LAUNCH…and the new launching will have, in fact, a double impulse….

So, HOW I CAN
“FREEZE”
“DEACTIVATE”
“DELETE”
.....ALL THE PREVIOUS IMPULSE CHARACTERISTICS, and RE-USE the same sphere from ZERO speed, impulse, force, velocity, etc, etc…etc…

   

Yang Li, Administrator
Posted: 26 May 2012 02:02 AM   Total Posts: 80   [ # 1 ]

you need reset the linearVelocity and angularVelocity when “RE LAUNCH”,


bodyBull.linearVelocity = new Vector3D(0, 0, 0 );
bodyBull.angularVelocity = new Vector3D(0, 0, 0 );

   

entropic, Newbie
Posted: 26 May 2012 06:59 AM   Total Posts: 16   [ # 2 ]

It works !
Thank you a lot.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X