mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
Optimized
You're right. If the normalized quaternions are in a variable or something for normal uses it's just a waste to force the change hidden inside again.
This commit is contained in:
parent
1733ecc315
commit
39613c0d87
1 changed files with 2 additions and 6 deletions
|
|
@ -227,12 +227,8 @@ inline F32 QuatF::dot( const QuatF &q ) const
|
||||||
|
|
||||||
inline F32 QuatF::angleBetween( const QuatF & q )
|
inline F32 QuatF::angleBetween( const QuatF & q )
|
||||||
{
|
{
|
||||||
// angle between two quaternions
|
// angle between two quaternions.
|
||||||
QuatF base(x,y,z,w);
|
return mAcos(q.dot(*this)) * 2.0f;
|
||||||
base.normalize();
|
|
||||||
QuatF q_norm=q;
|
|
||||||
q_norm.normalize();
|
|
||||||
return 2.0f*mAcos(base.dot(q_norm));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _MQUAT_H_
|
#endif // _MQUAT_H_
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue