Removed debug code, and fixed #340.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9359 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2011-07-26 00:01:20 +00:00
parent ce14faa4b4
commit f0956bf5ff

View File

@ -19,12 +19,6 @@
#include "items/rubber_ball.hpp"
#if defined(WIN32) && !defined(__CYGWIN__)
# define isnan _isnan
#else
# include <math.h>
#endif
#include "karts/kart.hpp"
#include "modes/linear_world.hpp"
#include "tracks/track.hpp"
@ -187,6 +181,9 @@ void RubberBall::update(float dt)
// Some experimental formulas
m_height = 0.5f*sqrt(distance);
m_interval = m_height / 10.0f;
// Avoid too small hops and esp. a division by zero
if(m_interval<0.01f)
m_inteval = 0.01f;
}
else
{
@ -206,12 +203,6 @@ void RubberBall::update(float dt)
// --> scale with m_height / -m_interval^2/4
float f = m_height / (-0.25f*m_interval*m_interval);
float height = m_timer * (m_timer-m_interval) * f;
if(isnan(getHoT()))
{
printf("NAN in rubber ball, xyz=%f %f %f\n",
getXYZ().getX(), getXYZ().getY(), getXYZ().getZ());
printf("Material=%p\n", getMaterial());
}
next_xyz.setY(getHoT() + height);
// If we start squashing the ball as soon as the height is smaller than