From: <hik...@us...> - 2010-08-31 13:24:32
|
Revision: 5836 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5836&view=rev Author: hikerstk Date: 2010-08-31 13:04:04 +0000 (Tue, 31 Aug 2010) Log Message: ----------- Removed now unnecessary heading,pitch,roll variable m_hpr. Modified Paths: -------------- main/trunk/src/karts/moveable.cpp main/trunk/src/karts/moveable.hpp Modified: main/trunk/src/karts/moveable.cpp =================================================================== --- main/trunk/src/karts/moveable.cpp 2010-08-31 10:30:26 UTC (rev 5835) +++ main/trunk/src/karts/moveable.cpp 2010-08-31 13:04:04 UTC (rev 5836) @@ -83,7 +83,6 @@ } 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 @@ { 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 @@ // 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 //----------------------------------------------------------------------------- Modified: main/trunk/src/karts/moveable.hpp =================================================================== --- main/trunk/src/karts/moveable.hpp 2010-08-31 10:30:26 UTC (rev 5835) +++ main/trunk/src/karts/moveable.hpp 2010-08-31 13:04:04 UTC (rev 5836) @@ -44,9 +44,7 @@ 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 @@ &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).*/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |