Code: Select all
#include <limits>
std::numeric_limits<Ogre:Real>::epsilon;
Code: Select all
#include <limits>
std::numeric_limits<Ogre:Real>::epsilon;
Looks like a nice universal solution.Wolfmanfx wrote:Maybe you should use this epsilon?
Code: Select all
#include <limits> std::numeric_limits<Ogre:Real>::epsilon;
Is this going to be committed?jacmoe wrote:Looks like a nice universal solution.Wolfmanfx wrote:Maybe you should use this epsilon?
Code: Select all
#include <limits> std::numeric_limits<Ogre:Real>::epsilon;
Code: Select all
Real yawAtSpeed = yawToGoal / Math::Abs(yawToGoal) * deltaTime * TURN_SPEED;
// reduce "turnability" if we're in midair
if (mBaseAnimID == ANIM_JUMP_LOOP) yawAtSpeed *= 0.2f;
// turn as much as we can, but not more than we need to
if (yawToGoal < 0) yawToGoal = Math::Clamp<Real>(yawToGoal, yawAtSpeed, 0);
else if (yawToGoal > 0) yawToGoal = Math::Clamp<Real>(yawToGoal, 0, yawAtSpeed);