Rigidbody Rotation problem

Software: Away3D 4.x

Reaven99, Newbie
Posted: 18 August 2013 07:50 PM   Total Posts: 6

Hello,

I have bin wrestling with this for days and i hope someone of you can help me out!

The problem i have is that i cant get a correct rotation from the rigidbody.

If i trace this:
car.getRigidBody().rotationY

i goes to 90 and -90 instead of the 0 to 360 i need.

I know of the gimbal lock but i have no idea what its about.

Is there any way to get the rotation from the rigidbody so i can use it in my calculations?

I am using:
away3d 4.0.9 gold
awayphysics-core-fp11-master

Big thanks in advance!

Regards

   

Yang Li, Administrator
Posted: 19 August 2013 01:15 AM   Total Posts: 80   [ # 1 ]

you can write your own getRotationY method:

public function getRotationY(body:AWPRigidBody):Number{
  if(body.front.dotProduct(Vector3D.Z_AXIS)>=0){
return 90 - body.rotationY;
  }else{
return body.rotationY + 270;
  }
}

   

Reaven99, Newbie
Posted: 19 August 2013 08:53 AM   Total Posts: 6   [ # 2 ]
Yang Li - 19 August 2013 01:15 AM

you can write your own getRotationY method:

public function getRotationY(body:AWPRigidBody):Number{
  if(body.front.dotProduct(Vector3D.Z_AXIS)>=0){
return 90 - body.rotationY;
  }else{
return body.rotationY + 270;
  }
}

Hello,

Thanks for the awnser i will try it out later today.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X