Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm working on a small FPS game (as a hobby and for learning purposes, nothing else) built with C++ in OpenGL (from scratch). Documenting online on the kind of strategy someone would approach with collision detection for bullets I've come to the conclusion that I must implement it using either Octree or BSP (Binary Space Partitioning used for indoor style games like Quake). Now my question is, since I already use a physics library like Bullet physics, can I use the physics engine for collisions of bullets and leave the Octree partitioning system only to handle the Occlusion Culling, View Frustum Culling etc. (to not render what is not visible)

Until now I was convinced that I must implement the ray cast and bullet collision using the partitioning system (preferably Octrees) until I read this thread and found out that Unity does this using it's physics library and not the partitioning system.

An FPS engine must be able to do ray casts for bullet collisions and other stuff to determine what's targeted and what's hit. Therefore, what partitioning system would you recommend if this isn't possible using the physics engine? (preferably something simpler and more dynamic like Octree and not that complicated like BSP)

I'm a bit confused on how to approach this kind of implementation and I was hoping someone could clear this out for me.

Other links where I've found this kind of implementation:

Bullet physics Using RayTest

share

migration rejected from stackoverflow.com Jun 19 '14 at 16:02

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as too broad by Josh Petrie Jun 19 '14 at 16:02

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs. If this question can be reworded to fit the rules in the help center, please edit the question.

    
If it's for learning purpose, why not implement both ? –  disco beat Feb 11 '14 at 15:18
    
My question was if it's possible and if it's recommended or what is recommended in a situation like this. –  Sandu Liviu Catalin Feb 11 '14 at 15:39
    
Do you use ODE to detect other collisions ? –  disco beat Feb 11 '14 at 15:49
    
I was thinking of using ODE because I heard it has a good documentation however after compiling and testing it I see that it's not that accurate and doesn't offer a good performance or to many features (or the ones I need). Right now I'm documenting on Bullet physics and I'm thinking of using Bullet instead of ODE. Many of the things (that I need) are already implemented in Bullet, like octrees, ray test etc. and has better performance and accuracy. –  Sandu Liviu Catalin Feb 11 '14 at 16:03
    
Ok, so it resolves your question :) –  disco beat Feb 11 '14 at 16:21