|
From: <axl...@us...> - 2009-05-17 12:46:50
|
Revision: 262
http://hgengine.svn.sourceforge.net/hgengine/?rev=262&view=rev
Author: axlecrusher
Date: 2009-05-17 12:46:42 +0000 (Sun, 17 May 2009)
Log Message:
-----------
Use MercuryVertex not MercuryPoint
Modified Paths:
--------------
Mercury2/src/TransformNode.cpp
Mercury2/src/TransformNode.h
Modified: Mercury2/src/TransformNode.cpp
===================================================================
--- Mercury2/src/TransformNode.cpp 2009-05-17 12:44:42 UTC (rev 261)
+++ Mercury2/src/TransformNode.cpp 2009-05-17 12:46:42 UTC (rev 262)
@@ -4,7 +4,7 @@
REGISTER_NODE_TYPE(RotatorNode);
TransformNode::TransformNode()
- :m_scale( MercuryPoint(1,1,1) )
+ :m_scale( MercuryVertex(1,1,1) )
{
SetTaint( true ); //taint because of the scale set above
}
@@ -14,7 +14,7 @@
if (m_tainted) ComputeMatrix();
}
-void TransformNode::SetScale( const MercuryPoint& scale )
+void TransformNode::SetScale( const MercuryVertex& scale )
{
if (scale != m_scale)
{
@@ -23,7 +23,7 @@
}
}
-void TransformNode::SetPosition( const MercuryPoint& position )
+void TransformNode::SetPosition( const MercuryVertex& position )
{
if (position != m_position)
{
@@ -32,7 +32,7 @@
}
}
-void TransformNode::SetRotation( const MercuryPoint& rotation )
+void TransformNode::SetRotation( const MercuryVertex& rotation )
{
if (rotation != m_rotation)
{
@@ -54,9 +54,9 @@
MercuryMatrix local;
// local.Identity();
- local.Transotale( m_position.x, m_position.y, m_position.z,
- m_rotation.x, m_rotation.y, m_rotation.z,
- m_scale.x, m_scale.y, m_scale.z );
+ local.Transotale( m_position[0], m_position[1], m_position[2],
+ m_rotation[0], m_rotation[1], m_rotation[2],
+ m_scale[0], m_scale[1], m_scale[2] );
m_globalMatrix = GetParentMatrix() * local;
}
@@ -94,7 +94,7 @@
void TransformNode::LoadFromXML(const XMLNode& node)
{
- MercuryPoint rot(m_rotation), pos(m_position), scale(m_scale);
+ MercuryVertex rot(m_rotation), pos(m_position), scale(m_scale);
//only change the values that exist in the XML
if ( !node.Attribute("rotx").empty() )
@@ -150,9 +150,9 @@
void RotatorNode::Update(float dTime)
{
- MercuryPoint r = GetRotation();
- r.x += (dTime)*25;
- r.y += (dTime)*75;
+ float* r = m_rotation;
+ r[0] += (dTime)*25;
+ r[1] += (dTime)*75;
SetRotation( r );
Modified: Mercury2/src/TransformNode.h
===================================================================
--- Mercury2/src/TransformNode.h 2009-05-17 12:44:42 UTC (rev 261)
+++ Mercury2/src/TransformNode.h 2009-05-17 12:46:42 UTC (rev 262)
@@ -2,7 +2,7 @@
#define TRANSFORMNODE_H
#include <MercuryNode.h>
-#include <MercuryPoint.h>
+#include <MercuryVertex.h>
#include <MercuryMatrix.h>
//I am not sure if I like the idea of rippling a taint flag down the tree
@@ -14,13 +14,13 @@
virtual void Update(float dTime);
- void SetScale( const MercuryPoint& scale );
- void SetPosition( const MercuryPoint& position );
- void SetRotation( const MercuryPoint& rotation );
+ void SetScale( const MercuryVertex& scale );
+ void SetPosition( const MercuryVertex& position );
+ void SetRotation( const MercuryVertex& rotation );
- inline const MercuryPoint& GetScale() const { return m_scale; }
- inline const MercuryPoint& GetPosition() const { return m_position; }
- inline const MercuryPoint& GetRotation() const { return m_rotation; }
+ inline const MercuryVertex& GetScale() const { return m_scale; }
+ inline const MercuryVertex& GetPosition() const { return m_position; }
+ inline const MercuryVertex& GetRotation() const { return m_rotation; }
inline const MercuryMatrix& GetGlobalMatrix() const { return m_globalMatrix; }
const MercuryMatrix& GetParentMatrix() const;
@@ -38,12 +38,12 @@
private:
void RippleTaintDown();
- MercuryPoint m_scale;
- MercuryPoint m_position;
- MercuryPoint m_rotation;
-
// MercuryMatrix m_localMatrix;
protected:
+ MercuryVertex m_scale;
+ MercuryVertex m_position;
+ MercuryVertex m_rotation;
+
MercuryMatrix m_globalMatrix;
bool m_tainted;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|