Collision

Blitz3D Forums/Blitz3D Programming/Collision

wmaass(Posted 2003) [#1]
A silly question from a true amateur. What goes on during collision detection? For example I have a mesh that represents terrain with a tree on it and a ball. I hit the ball with a club but the ball goes no where near the tree. is blitz3d checking collision for the ball against the tree?

The question comes from a conversation with a more seasoned programmer. He has a c++ project that has roughly the elements described above. When he applies force to the ball his physics pre-calculate where the ball ends up, thus when there are a lot of trees and such there is a latency of when the ball is struck to when you actually see it take off. I understand that the more triangles there are the more calculations take place and a reduced frame rate occurs but why the latency of the ball starting its flight?


Ricky Smith(Posted 2003) [#2]

I hit the ball with a club but the ball goes no where near the tree



I dont understand fully what you mean by this but following on from what you say then I dont think this has anything to do with Blitz collisions.
First of all you would have to set up the collisions using EntityType and EntityRadius(for spherical) and then enable collisions between different entity types with the Collisions command.

The collisions are calculated in real-time whenever the UpdateWorld is processed and are never precalculated.

Check that you are using the correct collison type and that your radii or bounding boxes are the correct size. If you have scaled your entities then this also scales the radius or size of the bounding box.


wmaass(Posted 2003) [#3]
hey Smiff,

The collisions work great in blitz actually. I guess I'm trying to understand why my buddy needs to pre-calculate the collisions with everything in his scene before the ball takes flight in his c++ app, thus the latency. Seems silly to me but he seems to think its necessary and that blitz is dong the same thing, which I don't believe is true.


SSS(Posted 2003) [#4]
i have no idea why he needs to pre calculate everything, i have never writen a program in C++ or blitz in which i needed to precalculate the collision


wmaass(Posted 2003) [#5]
Yeah its weird. So for my benefit, is this assumption correct -- blitz checks for collisions for my ball only within the specified radius?


_PJ_(Posted 2003) [#6]
yeah the radii for collisions define the volmes that can actual;ly collide. Note a ball can use a single sphere. The tree may need a tall thin ellipsoid (use two parameters to define radii)