Giter Site home page Giter Site logo

Comments (2)

lch32111 avatar lch32111 commented on August 22, 2024

I recommend you to read the Real-Time Collision Detection Book, the collision detection of cyclone code is based on the book.

you will find the related information on the AABB, OBB intersection tests.

from cyclone-physics.

qwiff-dogg avatar qwiff-dogg commented on August 22, 2024

This may be related to this isssue.

The only problem I'm seeing (so far) with the BOX SAT is that it fails when the axes being compared are exactly parallel.

The comparison happens here:

https://github.com/idmillington/cyclone-physics/blob/master/src/collide_fine.cpp#L111-L119
and
https://github.com/idmillington/cyclone-physics/blob/master/src/collide_fine.cpp#L80-L84

If the two boxes are oriented on the same plane (e.g. the ground), their X, Y and Z-axis will be parallel and the resulting cross product will be 0.

I've worked around this changing the overlap comparison from < to <=

return (distance <= oneProject + twoProject);

This covers the case where distance is exactly 0 due to axis being a 0-vector. Obviously with this modification the SAT now succeeds in the rare case where the axis projections are exactly adjacent and not overlapping, but I find this to be an acceptable compromise for my own engine. YMMV.

Finally, note that the box intersection test is commented out in the contact generation code:
https://github.com/idmillington/cyclone-physics/blob/master/src/collide_fine.cpp#L415

Not sure why.

from cyclone-physics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.