   How can I determine when the entity has stopped jumping?
  I have a first person controlled entity who can jump when the jump button is pressed.  A boolean value to reflect the fact that the player is jumping is set set to true and prevents further jumping.  The problem I'm facing is knowing when the entity has stopped jumping.The entity collision shape is an AABB and it collides with the triangles of the game world.  The height of the AABB determines the height of the player from the floor.If I cast a ray from the base of the AABB to the floor and use that to determine when the entity has landed then that returns incorrect results as the ray origin must start outside the AABB to prevent collision.  This means that distance between the AABB and floor is too small to be accurate using the following code:  // Direction should be point to the floor (depending on current player orientation)  rayFloor.Direction = -Vector3.UnitY;  // Ray origin should be at the very bottom of the player   // It should NOT be located inside any of the player's bounding shapes, or self collision will occur  rayFloor.Origin = position + rayFloor.Direction * scale.Y * (0.5f + Math_Util.EPSILON);  Contact3D contact = new Contact3D();  if (Game1.Instance.physics3D.octree.InsertRay(rayFloor, ref contact))  { if (contact.t_Enter <= Math_Util.EPSILON) {isJumping = false; }  }Can anyone give me some ideas/help on how to handle jumping correctly?   
  Almost always when you ray cast you provide some kind of "ignore this entity" property. This will allow your ray to ignore the players aabb and only hit the environment. Another technique is to tag things, such as tagging the world as "ground" and the player as "character", then when you raycast, you may only be interested in "ground" raycast results.   ;Quote:Almost always when you ray cast you provide some kind of "ignore this entity" property.That sounds good, thank you.  From a design point of view would you put a reference to this entity in the ray's properties, or would you pass the entity reference into the ray cast method?The reason why I ask is because I can't pass "ref null" into the recursive ray cast algorithm and the only other way I can think of is making the ignored entity a member of the octree, which seems a little silly.What do you think?   ;  A ray is a ray, no more. But you will need more contextual information to do an effective ray cast. Check out havok or another physics library for an example of how to make scene queries.struct Raycaster{  Entity* mIgnore;  uint    mFlagMask;  float   mHitT;  Entity* mHitE;  Raycaster( Entity* ignore = NULL, .. )   : mHitT( cInfinity ), mIgnore( ignore ) ..etc  { }    bool Hit( Entity& e, float t )  {    if( t < mHitT )    { if( e.TestFlagMask( mFlagMask ) && &e != mIgnore ) {   mHitE = &e   mHitT = t; }    }    return true; //keep searching  }};Raycaster raycaster( this );Ray ray;Scene.Raycast( raycaster, ray );template<typename T>void Scene::Raycast( T& caster, const Ray& ray ){  foreach (Entity e in stuffthing)    if( Intersects( e, ray ) )caster.Hit( e , t );}If your language doesn't support templating then you can just use an interface.   ;  Superb, thanks! :)   