Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualMedo3337

Posted 02 December 2012 - 03:13 AM

I want to know when the rotation animation is completed, here is what I'm doing:
// This method should return true when the rotation is completed, otherwise, return false
bool lookAt(float x, float y, float z, float elapsedTime)
{
	 btQuaternion FinalQuat = GetLookAtRotation(x, y, z);
	 btQuaternion currentQuat;
	 orn.getRotation(currentQuat);
	 float speed = 0.001f;

         // Instead of just setting FinalQuat to the rigidbody, I want to animate it
	 btQuaternion newQuat = currentQuat.slerp(FinalQuat, elapsedTime * speed);
	 if (???) // If slerp() have done animating the rotation
	 {
		 return true; // Animation completed
	 } else {
		 return false;
	 }
}

#4Medo3337

Posted 02 December 2012 - 03:13 AM

I want to know when the rotation animation is completed, here is what I'm doing:
// This method should return true when the rotation is completed, otherwise, return false
bool lookAt(float x, float y, float z, float elapsedTime)
{
	 btQuaternion FinalQuat = GetLookAtRotation(x, y, z);
	 btQuaternion currentQuat;
	 orn.getRotation(currentQuat);
	 float speed = 0.001f;

     // Instead of just setting FinalQuat to the rigidbody, I want to animate it
	 btQuaternion newQuat = currentQuat.slerp(FinalQuat, elapsedTime * speed);
	 if (???) // If slerp() have done animating the rotation
	 {
		 return true; // Animation completed
	 } else {
		 return false;
	 }
}

#3Medo3337

Posted 02 December 2012 - 03:12 AM

I want to know when the rotation animation is completed, here is what I'm doing:
// This method should return true when the rotation is completed, otherwise, return false
bool lookAt(float x, float y, float z, float elapsedTime)
{
	 btQuaternion FinalQuat = GetLookAtRotation(x, y, z);
	 btQuaternion currentQuat;
	 orn.getRotation(currentQuat);
	 float speed = 0.001f;

     // Instead of just setting FinalQuat to the rigidbody, I want to animate it
	 btQuaternion newQuat = currentQuat.slerp(FinalQuat, elapsedTime * speed);
	 if (???) // If slerp() have done animating the rotation
	 {
		 return true; // Animation completed
	 } else {
		 return false;
	 }
}

#2Medo3337

Posted 02 December 2012 - 02:59 AM

I want to know when the rotation animation is completed, here is what I'm doing:
// This method should return true when the rotation is completed, otherwise, return false
bool lookAt(float x, float y, float z, float elapsedTime)
{
     btQuaternion FinalQuat = GetLookAtRotation(x, y, z); // Instead of just setting FinalQuat to the rigidbody, I want to animate it
     btQuaternion currentQuat;
     orn.getRotation(currentQuat);
     float speed = 0.001f;

     btQuaternion newQuat = currentQuat.slerp(FinalQuat, elapsedTime * speed);
     if (???) // If slerp() have done animating the rotation
     {
         return true; // Animation completed
     } else {
         return false;
     }
}

#1Medo3337

Posted 02 December 2012 - 02:58 AM

I want to know when the rotation animation is completed, here is what I'm doing:
// This method should return true when the rotation is completed, otherwise, return false
bool lookAt(float x, float y, float z, float elapsedTime)
{
btQuaternion FinalQuat = GetLookAtRotation(x, y, z); // Instead of just setting FinalQuat to the rigidbody, I want to animate it

btQuaternion currentQuat;
orn.getRotation(currentQuat);
float speed = 0.001f;

btQuaternion newQuat = currentQuat.slerp(FinalQuat, elapsedTime * speed);
if (???) // If slerp() have done animating the rotation
{
    return true; // Animation completed
} else {
   return false;
}
}

PARTNERS