// Maximum hit points of a player
#define PLAYER_MAX_HP 20
+// Player weight
+#define PLAYER_DEFAULT_WEIGHT 75
+
+// Player step height
+#define PLAYER_DEFAULT_STEPHEIGHT 0.6f
+
// Maximal breath of a player
#define PLAYER_MAX_BREATH 11
scene::IBillboardSceneNode *getSpriteSceneNode();
+
+ inline f32 getStepheight() const
+ {
+ return m_prop.stepheight;
+ }
+
inline bool isPlayer() const
{
return m_is_player;
m_prop.hp_max = PLAYER_MAX_HP;
m_prop.physical = false;
- m_prop.weight = 75;
+ m_prop.weight = PLAYER_DEFAULT_WEIGHT;
m_prop.collisionbox = aabb3f(-1/3.,-1.0,-1/3., 1/3.,1.0,1/3.);
// start of default appearance, this should be overwritten by LUA
m_prop.visual = "upright_sprite";
// end of default appearance
m_prop.is_visible = true;
m_prop.makes_footstep_sound = true;
+ m_prop.stepheight = PLAYER_DEFAULT_STEPHEIGHT;
m_hp = PLAYER_MAX_HP;
}
#include "environment.h"
#include "map.h"
#include "client.h"
+#include "content_cao.h"
/*
LocalPlayer
}
}
- // TODO: this shouldn't be hardcoded but transmitted from server
- float player_stepheight = touching_ground ? (BS*0.6) : (BS*0.2);
+ float player_stepheight = (m_cao == 0) ? 0.0 :
+ (touching_ground ?
+ (m_cao->getStepheight() * BS) :
+ (m_cao->getStepheight() -0.4 * BS));
#ifdef __ANDROID__
player_stepheight += (0.6 * BS);