collision

Blitz3D Forums/Blitz3D Programming/collision

stanrol(Posted 2012) [#1]
how to collision between tank & wall cube?


D4NM4N(Posted 2012) [#2]
I think you need to be a bit more specific than that. Is the wall cube static or designed to move?


RemiD(Posted 2012) [#3]
The limits of Blitz3d collisions is that it is sphere against sphere or box or polys.

The shape of a tank being rectangular, if you want a precise collisions system you need to use several colliders sphere.

From my tests, the best way i have found to do a vehicle to walls/obstacles collisions is to create several colliders sphere childs of the vehicle origine with collisions sphere to polys and response stop.
Each frame i check if a collision has happened between one of the collider sphere and the wall/obstacles near it, and if yes, i retrieve the infos about the collisions (point,normal), with this is calculate a reflexion vector to push the vehicle away from the wall/obstacle, then i delete all the colliders spheres of vehicle, and then i recreate new colliders sphere around the vehicle.

The reason i delete the colliders sphere and i recreate them is because i have found that ResetCollisions() does not always produce the wanted effect depending on where i use it.

Last edited 2012


Yue(Posted 2012) [#4]
@RemiD =)




RemiD(Posted 2012) [#5]
More like this




D4NM4N(Posted 2012) [#6]
Have a look at the car demo supplied with b3d. I think it will help you massively.