Godlike / Pegasus

Game physics engine (can fly)
MIT License
5 stars 2 forks source link

Sphere Box collision detection issue #129

Closed ilia-glushchenko closed 5 years ago

ilia-glushchenko commented 5 years ago

Steps to reproduce:

  1. Create multiple sphere and box objects
  2. Such that they are all resting on the same plane
  3. Spheres would roll inside the boxes and get launch out of it

Excepted: Sphere Box collision detection should prevent such penetrations from happening

ilia-glushchenko commented 5 years ago

Something goes wrong with GJK.

image

ilia-glushchenko commented 5 years ago

Reproducible with the following scene setup case:

    pegasus::mechanics::Body sphere;
    sphere.linearMotion.position = { 0, -4, 3 };
    sphere.linearMotion.velocity = { 0, 0, -1 };
    demo.MakeSphere(sphere, 1, pegasus::scene::Primitive::Type::DYNAMIC);

    pegasus::mechanics::Body box;
    box.linearMotion.position = { 0, -4, 0 };
    demo.MakeBox(box, { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 }, pegasus::scene::Primitive::Type::DYNAMIC);