Advertisement

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

Started by November 19, 2017 10:06 AM
6 comments, last by Shaarigan 6 years, 11 months ago

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.....

Help i'm to depended on school library

Same as the floors.

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

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/

"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety." --Benjamin Franklin

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

Thanks for the answer! I have been away for a while but I'll research on them.

Help i'm to depended on school library

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.

Help i'm to depended on school library

Advertisement

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

This topic is closed to new replies.

Advertisement