Jump to content
  • Advertisement

phenom120

Member
  • Content Count

    5
  • Joined

  • Last visited

Community Reputation

0 Neutral

About phenom120

  • Rank
    Newbie

Personal Information

Social

  • Github
    https://github.com/phenomLi

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. phenom120

    Question on finding contact point

    thanks for your reply,very helpful.
  2. I am developing a simply 2d physics engine and I' ve read the source code of box2d and matter.js. I found some insteresting thing on finding contact point: Box2d use indicent edge, reference edge and clip to determine a contact point. It's very complex method and hard to understand. However, matter.js use a very simply method to do the same thing. just find the vertex that contained by opposite polygon with hill-climbing: var verticesB = SAT._findSupports(bodyA, bodyB, collision.normal), supports = []; // find the supports from bodyB that are inside bodyA if (Vertices.contains(bodyA.vertices, verticesB[0])) supports.push(verticesB[0]); if (Vertices.contains(bodyA.vertices, verticesB[1])) supports.push(verticesB[1]); // find the supports from bodyA that are inside bodyB if (supports.length < 2) { var verticesA = SAT._findSupports(bodyB, bodyA, Vector.neg(collision.normal)); if (Vertices.contains(bodyB.vertices, verticesA[0])) supports.push(verticesA[0]); if (supports.length < 2 && Vertices.contains(bodyB.vertices, verticesA[1])) supports.push(verticesA[1]); } and it works well in demo. My question is: why does box2d use such complex method? It's clear that matter.js's method is better. Or there are some potential shortcomings in matter.js's method?
  3. phenom120

    Question about collision resolution

    Thanks. I just realized that you are the author of first article
  4. phenom120

    Question about collision resolution

    It is quite useful, thank you. So, can i consider the first approach as a simplified approach of the second approach? And I don't know what is sequential impulses, Is it another approach of collision resolution?
  5. I'm currently implementing a 2D physics engine, then i stuck in collision resolution. So i did a search in google, and i found this passage, It explains how to use impulse to separate two objects. But after that, i found another another passage, this article is very complicated, but they seem talking the same thing ——— how to implementing the collision resolution. So now, what i confuse is why are there two completely different approaches of collision resolution? What's the difference between them? Which approaches is right? I am not a native english speakers, so i hope you can understand what i wrote. Thanks.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!