Removed commented out code and unnecessary function;

fixed documentation.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9618 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk
2011-08-25 00:05:30 +00:00
parent 3161c79196
commit 8d8601655d
2 changed files with 11 additions and 37 deletions

View File

@@ -133,36 +133,3 @@ void Cake::init(const XMLNode &node, scene::IMesh *cake_model)
node.get("max-distance", &m_st_max_distance );
m_st_max_distance_squared = m_st_max_distance*m_st_max_distance;
} // init
// -----------------------------------------------------------------------------
void Cake::update(float dt)
{
//The following commented out code adds a lock on to the cake. It is kept
//because it shows how to lock on to a moving target precisely with the
//intersection algorithm and may be one day useful for something else.
/*
if(m_target != NULL)
{
// correct direction to go towards aimed kart
btTransform my_trans = getTrans();
float fire_angle = 0.0f;
float time_estimated = 0.0f;
float up_velocity = 0.0f;
Vec3 origin = my_trans.getOrigin() - m_target->getNormal() * 0.5 * m_target->getKartHeight();
getLinearKartItemIntersection (origin, m_target,
m_speed, m_gravity, 0,
&fire_angle, &up_velocity, &time_estimated);
m_body->setLinearVelocity( btVector3(-m_speed * sinf (fire_angle),
m_speed * cosf (fire_angle),
up_velocity) );
}
*/
Flyable::update(dt);
} // update

View File

@@ -48,13 +48,20 @@ private:
public:
Cake (Kart *kart);
static void init (const XMLNode &node, scene::IMesh *cake_model);
virtual void update (float dt);
// ------------------------------------------------------------------------
virtual void hitTrack () { hit(NULL); }
// Kinematic objects are not allowed to have a velocity (assertion in
// bullet), so we have to do our own velocity handling here
// ------------------------------------------------------------------------
/** Kinematic objects are not allowed to have a velocity (assertion in
* bullet), so we have to do our own velocity handling here. This
* function returns the velocity of this object. */
virtual const btVector3 &getVelocity() const {return m_initial_velocity;}
// ------------------------------------------------------------------------
/** Kinematic objects are not allowed to have a velocity (assertion in
* bullet), so we have to do our own velocity handling here. This
* function sets the velocity of this object.
* \param v Linear velocity of this object.
*/
virtual void setVelocity(const btVector3& v) {m_initial_velocity=v; }
}; // Cake
#endif