Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C++ by grok ( 16 years ago )
void GetMovementAngularVelocity(NiPoint3& velocity)
{
 GetRotation getRotMsg;
 m_Object->iSendMessage(&getRotMsg;);

 NiQuaternion currRot(getRotMsg.w, getRotMsg.x, getRotMsg.y, getRotMsg.z);
 velocity = NiPoint3::ZERO;
 velocity += static_cast<float>(GetRequestCountPerDirection(MOV_TYPE_SPIN_POSITIVE)) * GetUpFromQuaternion(currRot);
 velocity += static_cast<float>(GetRequestCountPerDirection(MOV_TYPE_TILT_POSITIVE)) * GetRightFromQuaternion(currRot);
 velocity += static_cast<float>(GetRequestCountPerDirection(MOV_TYPE_ROLL_POSITIVE)) * GetForwardFromQuaternion(currRot);
}

void GetMovementLinearVelocity(NiPoint3& velocity, const GetRotation& rotMsg)
{
 NiQuaternion currRot(rotMsg.w, rotMsg.x, rotMsg.y, rotMsg.z);
 velocity += static_cast<float>(GetRequestCountPerDirection(MOV_TYPE_FORWARD)) * GetForwardFromQuaternion(currRot);
 velocity += static_cast<float>(GetRequestCountPerDirection(MOV_TYPE_RIGHT)) * GetRightFromQuaternion(currRot);
 velocity += static_cast<float>(GetRequestCountPerDirection(MOV_TYPE_UP)) * GetUpFromQuaternion(currRot);
}

 

Revise this Paste

Your Name: Code Language: