Detect When Rigid Body Stops Moving

Software: Away3D 4.x

Staticresolve, Newbie
Posted: 30 July 2012 07:51 PM   Total Posts: 4

Hello Everyone,
I have recently started working with Away3D 4.0 and am looking to see if someone can assist me. I have a rigid body that the user can pickup and throw and I want to be able to determine when the body stops moving once the user has thrown it.

Is there a way to detect when a rigid body stops moving?

Any help is greatly appreciated.

Thanks in advance,

Dan

   

Yang Li, Administrator
Posted: 31 July 2012 01:33 AM   Total Posts: 80   [ # 1 ]

use this:
if(body.activationState==AWPCollisionObject.ISLAND_SLEEPING){
 
}

   

Staticresolve, Newbie
Posted: 31 July 2012 04:59 PM   Total Posts: 4   [ # 2 ]

Thanks Yang Li!

Works great. I did notice there is a delay between when it appears to visually stop and when the state changes. My assumption is this is due to the fact the body is actually still moving. Is there a way to decrease the delay? Would I need to change gravity or another force to have it stop moving sooner?

Thanks again for your time.

Dan

   

Staticresolve, Newbie
Posted: 06 August 2012 04:35 PM   Total Posts: 4   [ # 3 ]

Does anyone have a suggestion?

Much appreciated,

Dan

   

John Brookes, Moderator
Posted: 06 August 2012 10:14 PM   Total Posts: 732   [ # 4 ]

Check its linear and angular velocity.

   

Staticresolve, Newbie
Posted: 06 August 2012 11:12 PM   Total Posts: 4   [ # 5 ]

Thanks John,
I appreciate you pointing me in the right direction. After tracing the linear and angular velocity it indicates that it is still moving even though I don’t see it moving visually. I am going to make a few adjustments to my cube and I should be good.

Thanks again!

Dan

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X