LinearVelocity = 0 on a moving object

Software: Away3D 4.x

GiGBiG, Member
Posted: 29 June 2012 08:18 AM   Total Posts: 57

I was working on a dice game: I created a method that recorded the simulation of the launch, and later replayed it.

When I was rendering the simulation always was ok, but when replaying the record sometimes happened that a dice stopped moving for a few frames, reappering later at the right sequence position.
I recorded the frames saving the position and the rotation of the dices, setting a minimum threshold for the linearVelocity of the dices: if linearVelocty is lower than it, do not save the position to reduce the sequence weight. Later after a few tests I discovered that sometimes AwayPhysics gives a rigid body the correct position, but a linearVelocity vector equal to (0, 0, 0), even if the frame is in the middle of the sequence. This is why the simulation was correct, but not the replay.

Is this a know bug? I haven’t got the code to show, as I had to hurry and replace that optimization with a different calculation, based on the previous frame to check the distance between two frames.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X