ContactList

Hi All,

My Playerbodyis only able to jump, if it touches the ground. So i check playerBody.ContactList. In my Game the ContactList is already != null before it reaches the ground. How can i verify, that he realy touches the Ground? Anybody has some samplecoe?

Thanks!
Code:
bool RopingPlayer::getContactNormal(b2Vec2 &accumulatedNormals)
{
   accumulatedNormals.SetZero();
   bool foundAContact = false;
   
   for(b2ContactEdge* contactEdge = body->GetContactList(); contactEdge; contactEdge = contactEdge->next) {
      b2Contact* contact = contactEdge->contact;
      if (contact != NULL && contact->IsEnabled() && contact->IsTouching() && contact->GetManifold()->pointCount > 0) // && !contact->IsSensor()
      {
         foundAContact = true;
         
         // Get the b2WorldManifold if you want circle-circle contact normal
         b2Vec2 contactNormal = contact->GetManifold()->localNormal;
         
         if (contact->GetFixtureA()->GetBody() == body)
         {
            contactNormal *= -1.0;
         }
         
         accumulatedNormals += contactNormal;
      }
   }
   
   if (!foundAContact)
   {
      return false;
   }
   
   accumulatedNormals.Normalize();
   return true;
}

Original thread: https://box2d.org/forum/viewtopic.php?t=6613