Fix for the onCollision detection when stepping
by Kevin Mitchell · 03/10/2013 (3:49 pm) · 3 comments
This fixes an issue I found with the engine where you need to detect the interaction with an object that you are stepping on. Before if the object meets the requirement of maxStepHeight then it is skipped as part of the collision detection.
This fix still allows the step but will still trigger the needed onCollision call when stepping on to the object.
Fix:
Player.cpp
This fix still allows the step but will still trigger the needed onCollision call when stepping on to the object.
Fix:
Player.cpp
Point3F Player::_move( const F32 travelTime, Collision *outCol )
.
.
.
.
if (stepped)
{
//RPG EDIT
//moved this further down to be able to still get a collision feedback for
//items that were calculated for allowed stepping
//before if you are able to step on something the collision aspect is ignored
//continue;
}
}
// Pick the surface most parallel to the face that was hit.
const Collision *collision = &collisionList[0];
const Collision *cp = collision + 1;
const Collision *ep = collision + collisionList.getCount();
for (; cp != ep; cp++)
{
if (cp->faceDot > collision->faceDot)
collision = cp;
}
F32 bd = _doCollisionImpact( collision, wasFalling );
// Copy this collision out so
// we can use it to do impacts
// and query collision.
*outCol = *collision;
//RPG EDIT
if (stepped)continue;
// Subtract out velocity
VectorF dv = collision->normal * (bd + sNormalElasticity);
mVelocity += dv;About the author
Riding Solo since 2005. Current Project: Fated World 2005-Present RPG Engine Tool Kit - Now available.

Associate Ron Kapaun
3tdstudios.com
Been following this since you posted the forum question. Am I getting the concept wrong or did you use this for the ladder?
Well, more specifically to tell the game engine you were standing on a 'ladder' object? Asking because us poor 'minimum-code' guys need an explanation. If so, this is awesome. If not....well I am lost yet again....
Ron