Removed now unnecessary heading,pitch,roll variable m_hpr.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5836 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
@@ -83,7 +83,6 @@ void Moveable::reset()
|
||||
}
|
||||
m_node->setVisible(true); // In case that the objects was eliminated
|
||||
|
||||
m_hpr.setHPR(m_transform.getRotation());
|
||||
Vec3 up = getTrans().getBasis().getColumn(1);
|
||||
m_pitch = atan2(up.getZ(), fabsf(up.getY()));
|
||||
m_roll = atan2(up.getX(), up.getY());
|
||||
@@ -100,7 +99,6 @@ void Moveable::update(float dt)
|
||||
{
|
||||
m_motion_state->getWorldTransform(m_transform);
|
||||
m_velocityLC = getVelocity()*m_transform.getBasis();
|
||||
m_hpr.setHPR(m_transform.getRotation());
|
||||
Vec3 forw_vec = m_transform.getBasis().getColumn(0);
|
||||
m_heading = -atan2f(forw_vec.getZ(), forw_vec.getX());
|
||||
|
||||
@@ -138,7 +136,6 @@ void Moveable::createBody(float mass, btTransform& trans,
|
||||
// functions are not called correctly. So only init the pointer to zero.
|
||||
m_user_pointer.zero();
|
||||
m_body->setUserPointer(&m_user_pointer);
|
||||
m_hpr.setHPR(m_body->getWorldTransform().getRotation());
|
||||
} // createBody
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -44,9 +44,7 @@ class Moveable
|
||||
private:
|
||||
btVector3 m_velocityLC; /**<Velocity in kart coordinates. */
|
||||
btTransform m_transform;
|
||||
Vec3 m_hpr;
|
||||
/** The heading in m_hpr is between -90 and 90 degrees only. The 'real'
|
||||
* heading between -180 to 180 degrees is stored in this variable. */
|
||||
/** The 'real' heading between -180 to 180 degrees. */
|
||||
float m_heading;
|
||||
/** The pitch between -90 and 90 degrees. */
|
||||
float m_pitch;
|
||||
@@ -73,8 +71,6 @@ public:
|
||||
&getVelocityLC() const {return m_velocityLC; }
|
||||
virtual void setVelocity(const btVector3& v) {m_body->setLinearVelocity(v); }
|
||||
const Vec3& getXYZ() const {return (Vec3&)m_transform.getOrigin();}
|
||||
/** Return the rotation, but heading is restricted to -90 and 90 degrees. */
|
||||
const Vec3& getHPR() const {return m_hpr; }
|
||||
/** Returns the heading between -180 and 180 degrees. Note that using
|
||||
* getHPR().getHeading() can result a different heading (e.g. a heading
|
||||
* of 180 degrees is the same as a roll and pitch around 180).*/
|
||||
|
||||
Reference in New Issue
Block a user