// If the player is walking, swimming, or climbing,
// view bobbing is enabled and free_move is off,
// start (or continue) the view bobbing animation.
- v3f speed = player->getSpeed();
+ const v3f &speed = player->getSpeed();
const bool movement_XZ = hypot(speed.X, speed.Z) > BS;
const bool movement_Y = fabs(speed.Y) > BS;
}
v3f playerpos = sao->getBasePosition();
- v3f playerspeed = player->getSpeed();
+ const v3f &playerspeed = player->getSpeed();
v3f playerspeeddir(0,0,0);
if(playerspeed.getLength() > 1.0*BS)
playerspeeddir = playerspeed / playerspeed.getLength();
std::vector<CollisionInfo> *collision_info)
{}
- v3f getSpeed()
+ const v3f &getSpeed() const
{
return m_speed;
}
- void setSpeed(v3f speed)
+ void setSpeed(const v3f &speed)
{
m_speed = speed;
}