diff options
author | Kahrl <kahrl@gmx.net> | 2012-03-19 04:25:09 +0100 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-06-17 16:34:39 +0300 |
commit | 1575448b1a71dd029a8d135d2aff9096483a9953 (patch) | |
tree | 3e4c7a68abbcf630484615e6ee202f2f0d83ade2 /src/content_cao.cpp | |
parent | 9f031a67594162a53b07acbfbc65faf8c4938e99 (diff) | |
download | minetest-1575448b1a71dd029a8d135d2aff9096483a9953.tar.gz minetest-1575448b1a71dd029a8d135d2aff9096483a9953.tar.bz2 minetest-1575448b1a71dd029a8d135d2aff9096483a9953.zip |
Custom boxy nodes (stairs, slabs) and collision changes
Diffstat (limited to 'src/content_cao.cpp')
-rw-r--r-- | src/content_cao.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/content_cao.cpp b/src/content_cao.cpp index c993f3f83..5702a73b6 100644 --- a/src/content_cao.cpp +++ b/src/content_cao.cpp @@ -881,22 +881,24 @@ public: box.MinEdge *= BS; box.MaxEdge *= BS; collisionMoveResult moveresult; - f32 pos_max_d = BS*0.25; // Distance per iteration + f32 pos_max_d = BS*0.125; // Distance per iteration + f32 stepheight = 0; v3f p_pos = m_position; v3f p_velocity = m_velocity; + v3f p_acceleration = m_acceleration; IGameDef *gamedef = env->getGameDef(); - moveresult = collisionMovePrecise(&env->getMap(), gamedef, - pos_max_d, box, dtime, p_pos, p_velocity); + moveresult = collisionMoveSimple(&env->getMap(), gamedef, + pos_max_d, box, stepheight, dtime, + p_pos, p_velocity, p_acceleration); // Apply results m_position = p_pos; m_velocity = p_velocity; + m_acceleration = p_acceleration; bool is_end_position = moveresult.collides; pos_translator.update(m_position, is_end_position, dtime); pos_translator.translate(dtime); updateNodePos(); - - m_velocity += dtime * m_acceleration; } else { m_position += dtime * m_velocity + 0.5 * dtime * dtime * m_acceleration; m_velocity += dtime * m_acceleration; |