コード例 #1
0
ファイル: Quaternion.cpp プロジェクト: dpantell/ColorEngine
Quaternion Quaternion::GetInverse() const
{
	float mag = magnitude(*this);

	if (mag != 0)
	{
		return GetConjugate() / mag;
	}
	else
	{
		return *this;
	}
}
コード例 #2
0
ファイル: cQuaternion.cpp プロジェクト: pilkch/library
    cVec3 cQuaternion::GetRotatedVector(const cVec3& value) const
    {
      cQuaternion qtemp;

      qtemp.x = value.x;
      qtemp.y = value.y;
      qtemp.z = value.z;
      qtemp.w = 0;

      const cQuaternion qout = (*this) * qtemp * GetConjugate();

      return cVec3(qout.x, qout.y, qout.z);
    }
コード例 #3
0
ファイル: Quaternion.cpp プロジェクト: q4r/QEngine
Quaternion Quaternion::GetInverse(){
	Quaternion q(GetConjugate());
	q.Div(GetNorm());
	return q;
}