• Advertisement

3D Wall Collision(or 3D collision in general)

Recommended Posts

failed.JPG.16087b2e9b69aa6cc7e91c4b270197c9.JPG

As you can see above,I manage to get collision of stage floor,but failed on the walls...my code is in a very messy condition so I can't show anything....unfortunately. This is C++ with DirectX9 btw

All I need is simple collision detection for these walls, I want to know how you guys deal with this problem and the reason for using the method,if possible since I'm not that that good at 3D programming without using engines such as Unity so any suggestion will help. Have been stuck here for a while.....

Share this post


Link to post
Share on other sites
Advertisement

You want to research either triangle/triangle collision response or AABB vs triangle collision response.  Found this article for the latter in C# but links to the C code article also:

https://joelbennett.wordpress.com/2015/02/14/axis-aligned-bounding-box-aabb-to-triangle-collision-detection-in-c/

Share this post


Link to post
Share on other sites

Depends on complexity but I would start going with a quad tree first to identify the objects in certain cell(s) the player is in followed by an AABB test to see if the colision could be inside a walls range and to get a more accurate result, do an OOBB test for the last few objects that seem to be inside a players range or go with a physics framework like Bullet to do all this automatically

Share this post


Link to post
Share on other sites
On 11/20/2017 at 4:35 PM, Shaarigan said:

Depends on complexity but I would start going with a quad tree first to identify the objects in certain cell(s) the player is in followed by an AABB test to see if the colision could be inside a walls range and to get a more accurate result, do an OOBB test for the last few objects that seem to be inside a players range or go with a physics framework like Bullet to do all this automatically

Btw is bullet going to take a lot of time to integrate or use?  I would really love if it could handle collision for me but I don't have any experience whatsoever on the library.

Share this post


Link to post
Share on other sites

It is maybe as easy as every other third-party library written in C++. Looking at there GitHub does not show any great pitfalls and tutorials are also available.

It acts at its base like other physics SDKs, you will add colliders to your objects and define rules how it should handle those collisions. See the tutorials and example section for further information

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Advertisement