Some collision detection questions

Started by
3 comments, last by MessageBox 20 years, 6 months ago
I''m using MD2 models and I have some questions about collision detection: I was wondering should I (dynamically) create a bounding box for each frame of animation or should I create one bounding box for an entire animation? A general collision detection question: Is a bounding shere useful for objects other than the camera..... the way I see it if you use a bounding sphere a character is never going to be actually touching the ground (unless he''s a sphere).
Advertisement
If you create the bounding sphere in relation to the model''s height (y.top - y.bottom)/2 -> radius then the sphere would touch the ground.

Also, I would definately not create a different bounding box for each frame, usually a model will have pretty much the same proportions for all frames.
Haha, can''t believe I never thought of that!
well if you dont do the interpolation in a VertexShader you might calculate the BB each frame during the interpolation loop over the vertices with ~0 overhead added.



[ My Site ]
''I wish life was not so short,'' he thought. ''Languages take such a time, and so do all the things one wants to know about.'' - J.R.R Tolkien
/*ilici*/
If your animated object is a character, then DEFINITELY go for only one BBox. I went through it month ago, so I can tell it from my experience. Previously I had 25 frames of animation calculated on runtime during each frame - that way you could for example very near to a wall or other object.
BUT After you wanted to turn around, your rotating BBox naturally started to collide with the object it was standing in front of. OK, so you say, in that case , I just turn off collision detection. But then another problems have arisen and at the end you had to turn it off several times which of course in the end sucks because it is hard to make changes then.

So, I scrapped whole collision detection stuff and decided to go with one BBox that was some percentage of original BBox and that way you could tweak it how you wanted. It definitely was enough for my game in the end.

Of course, I use a BBox of a square base and a height of character - it makes it fast to do collisions that way - but if your character is of different proportions in Width and Depth, you might want to go with rectangle base of BBox.

VladR
Avenger 3D game

VladR My 3rd person action RPG on GreenLight: http://steamcommunity.com/sharedfiles/filedetails/?id=92951596

This topic is closed to new replies.

Advertisement