• Advertisement
Sign in to follow this  

Collision Detection Confusion

This topic is 4271 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am just about to start my collision detection for my game. However I have come accross a few question that have been bothering me. Every entity is going to have a OBB arround it. Each entity is attatched to a node. 1) I am wondering how I might incorperate zones into my collision system since i already have nodes. I want zones because I will have many (projectiles in use at one time. Lets say 1000 for example and 128 sprites. Each sprite node would have 5 or so different nodes comming off it with its own entity attatch (lets say a gun or 5 in total). Since each on of these would be attatched to its own node ther would have to be 1000 * 128 (128 000) different checks that would have to be performed if I was using the nodes. I wouldnt have to worry about the 5 others because I would be checking if it collided with the sprite before i would check into the other 5. So I must have the zones. Like I said above I am not sure how to impliment them. - Would I just have each entity in a zone and totally forget about the node structure. So this way I might 1000 entites and 128 nodes but then each node would have another 5 I would have to check into. This way it would work out to be about 1000 projectiles 128 sprites and 640 sub sprites. Then I would just check collision on a per zone basis? Would there be a better way, so I would just have to check against the sprites instead of also each sub sprite. I am not sure how I would organise this? 2) Now I am sure that I would get many unwanted positive collision results because each gun's OBB would be overlapping the sprite's OBB. Now oviously we dont want this to happen. So how would I stop this from happening? I know that question #1 is kind of confusing since I can not really think of a better way of phrasing it (Very tired). So if you have any question or just need some more information I would be happy to reply! I guess I will also give you a simple layout of my node structure just to help clairify what I was saying in #1 ---------------------------------Root Node -------------------------------------| ----------Projectile, Projectile, Projectile,-----Sprite -----------------------------------------------------| -----------------------------------------------Gun, Gun, Gun PS: can someone please tell me how to do the diagram above since the spaces would just disapear?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement