Results 1 to 2 of 2

Thread: Rigid Body Collision Detection

Threaded View

  1. #1
    The DirectXpert Jacob Roman's Avatar
    Join Date
    Aug 04
    Location
    Miami Beach, FL
    Posts
    4,824

    Rigid Body Collision Detection

    For those of you who are trying to pull off collisions between 2D convex polygons accurately at any convex shape or angle, then have I got something for you. I tried to make it as simple as possible, so figuring it out or converting to another language, or graphics library like DX/OpenGL, shouldn't be a problem.

    It simply uses the Separation Axes Theorem, although most of code came from Chapter 1 of this rigid body 2D physics tutorial (which is in C++):

    http://uk.geocities.com/olivier_rebellion/Polycolly.zip

    It was a pain, but I converted the code into pure VB to make it easy on everyone. Enjoy the code. I too plan to write a massive rigid body physics tutorial (2D and 3D), so keep a lookout.

    --------------------------------------------------------------------------

    Here's another one I uploaded, only this time, the polygons cannot pass through each other thanks to collision response. I modified some of the other functions and added a couple new ones to allow this response to happen.





    Attached Files Attached Files
    Last edited by Jacob Roman; Dec 2nd, 2006 at 08:51 AM.
    Useful Forum Tips:

    - If you found any post that was useful, please consider rating their post

    - Give sensible thread titles, please!
    - Be sure to use [HIGHLIGHT=VB][/HIGHLIGHT] tags when posting code written in VB.
    - Write posts like a conversation, not like an email. That way you can avoid saying "Dear so and so" in every post.
    - When your problem is solved, go up to Thread Tools and click on Mark Thread Resolved

    My Contributions: Massive DirectX 2D Tutorials For VB5/VB6/VB.NET || 3D Engine In Pure VB || Friction Force ||DJ Turntable Simulation || Scratching Wavs || Time Based Movement || Newton Physics Simulation || Managed Game Loop || Rigid Body Collision Detection || World of Warcraft RGB Battle System || Bosskillers (World of Warcraft 2D Clone) || Street Fighter Controls (Flawless Simulation) || A* Pathfinding (VB6 & VB.NET) *UPDATED || *NEW* Nintendo Entertainment System Emulator

    Expert. Ask me anything NES!

    My Smilies:


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •