|
From: <axl...@us...> - 2009-05-31 04:27:46
|
Revision: 290
http://hgengine.svn.sourceforge.net/hgengine/?rev=290&view=rev
Author: axlecrusher
Date: 2009-05-31 04:27:34 +0000 (Sun, 31 May 2009)
Log Message:
-----------
Rotations are defined by quaternions now
Modified Paths:
--------------
Mercury2/src/TransformNode.cpp
Modified: Mercury2/src/TransformNode.cpp
===================================================================
--- Mercury2/src/TransformNode.cpp 2009-05-31 04:26:48 UTC (rev 289)
+++ Mercury2/src/TransformNode.cpp 2009-05-31 04:27:34 UTC (rev 290)
@@ -51,12 +51,18 @@
{
m_tainted = false;
- MercuryMatrix local;
+ MercuryMatrix local, t;
// local.Identity();
- local.Transotale( m_position[0], m_position[1], m_position[2],
- m_rotation[MQuaternion::X], m_rotation[MQuaternion::Y], m_rotation[MQuaternion::Z],
- m_scale[0], m_scale[1], m_scale[2] );
+ local.Translate( m_position );
+ local.Rotate( m_rotation );
+ local.Scale( m_scale );
+// m_rotation.toMatrix4(t);
+// local.Transotale( m_position[0], m_position[1], m_position[2],
+// 0.0f,0.0f,0.0f,
+// m_rotation[MQuaternion::X], m_rotation[MQuaternion::Y], m_rotation[MQuaternion::Z],
+// m_scale[0], m_scale[1], m_scale[2] );
+// local = t * local;
m_globalMatrix = GetParentMatrix() * local;
}
@@ -98,14 +104,14 @@
//only change the values that exist in the XML
if ( !node.Attribute("rotx").empty() )
- rot[MQuaternion::X] = StrToFloat( node.Attribute("rotx") );
+ rot *= MQuaternion::CreateFromAxisAngle(MercuryVector(1,0,0), StrToFloat( node.Attribute("rotx") ));
if ( !node.Attribute("roty").empty() )
- rot[MQuaternion::Y] = StrToFloat( node.Attribute("roty") );
+ rot *= MQuaternion::CreateFromAxisAngle(MercuryVector(0,1,0), StrToFloat( node.Attribute("roty") ));
if ( !node.Attribute("rotz").empty() )
- rot[MQuaternion::Z] = StrToFloat( node.Attribute("rotz") );
-
+ rot *= MQuaternion::CreateFromAxisAngle(MercuryVector(0,0,1), StrToFloat( node.Attribute("rotz") ));
+
if ( !node.Attribute("scalex").empty() )
scale.SetX( StrToFloat( node.Attribute("scalex") ) );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|