summaryrefslogtreecommitdiff
path: root/common/algebra.h
diff options
context:
space:
mode:
authorleo2006-03-05 21:29:09 +0000
committerleo2006-03-05 21:29:09 +0000
commit42b9415a06df453487411ff5e8d76bce5e4a27bf (patch)
tree84c88c25f7065f239412bf691e7a460fa76d5ae9 /common/algebra.h
parent470add04a935f43c6a4bc06794b9ed8de00eed02 (diff)
Removed redundant redraws when moving with the mouse,
fixed the disc start in the rotation angle overlay. git-svn-id: http://svn.leocad.org/trunk@512 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'common/algebra.h')
-rw-r--r--common/algebra.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/common/algebra.h b/common/algebra.h
index 4a34b36..a91727d 100644
--- a/common/algebra.h
+++ b/common/algebra.h
@@ -386,6 +386,21 @@ public:
m_Value = Vector4(AxisAngle[0] * s, AxisAngle[1] * s, AxisAngle[2] * s, cosf(AxisAngle[3] / 2.0f));
}
+ inline void CreateRotationX(float Radians)
+ {
+ m_Value = Vector4(sinf(Radians / 2.0f), 0, 0, cosf(Radians / 2.0f));
+ }
+
+ inline void CreateRotationY(float Radians)
+ {
+ m_Value = Vector4(0, sinf(Radians / 2.0f), 0, cosf(Radians / 2.0f));
+ }
+
+ inline void CreateRotationZ(float Radians)
+ {
+ m_Value = Vector4(0, 0, sinf(Radians / 2.0f), cosf(Radians / 2.0f));
+ }
+
inline void ToAxisAngle(Vector4& AxisAngle) const
{
float Len = m_Value[0]*m_Value[0] + m_Value[1]*m_Value[1] + m_Value[2]*m_Value[2];