if v0.Y is less then or equal v1.Y then it can't be a also greater or equal v1.Y+s1.Y (also for X and Z) so it always will return false, or am I wrong ???
maybe it must be:
inline bool isOnTopOfNode(ISceneNode* a, ISceneNode* b) //is a on top of b??
{
// a->updateAbsolutePosition();
//b->updateAbsolutePosition();
const aabbox3d<f32>& ab = a->getTransformedBoundingBox();
const vector3df& bp = b->getPosition();
return ( bp.Y >= ab.MinEdge.Y &&// bp.Y <= ab.MaxEdge.Y && dont limit Y
bp.X >= ab.MinEdge.X && bp.X <= ab.MaxEdge.X &&
bp.Z >= ab.MinEdge.Z && bp.Z <= ab.MaxEdge.Z);
}
But didn't worked either...
@Katsankat:
Yeah , i've tried that but my hero can jump any time ...there must be some bounding box collision
between the hero & the "walkable" nodes...
if( is on top of ( object array [ ... ] ) )
{
if( it->classType != player classType)
{
ELEM_TYPE e = setNewElementToTrack(it->node)
switch e
case WALKABLE:
addFlags(EF_CANJUMP);
break;
...
}
else
setNewElementToTrack(NULL); // <--- THIS IS BAD
}