Sign in to follow this  

Collision detection

Recommended Posts

Hi again,

I am developing a 3D platformer game in XNA. Despite being a completely 3D, the player only moves on two dimensiones (2.5D). In this moment I am trying to detect colision between the main player and ground of the scene. For best performance, I implemented an octree in which I add all scene. Until now I have just used it to not having to paint the entire scene in each iteration of the main loop. The main player is not included in the octree and I don't know if I have to include it. I would not have to go completely octree for check if the player collision with the ground, is it possible?

Thanks in advance.

PD: Sorry for my English's level.

Share this post

Link to post
Share on other sites

In my opinion, your player doesn't have to be "in" the octree structure. You may well just run queries to the tree to find the nearest blocks to the player and then run your collision detection routine to the blocks you have found. Of course, if you'll need to implement entity vs player collision queries, then your player may have to part of the octree.

On the other hand, if your culling octree structure doesn't fit to your needs on collision detection, you may have another tree which suits better for finding the collision objects. As a matter of fact, typically these two needs don't go well together, at least in more complex scenarios.

The collision routine can be and should be something separated from your octree. The octree just is tree structure to accelerate spatial queries based on some criteria.


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

Sign in to follow this