Collision index meaning and importance ?

Blitz3D Forums/Blitz3D Beginners Area/Collision index meaning and importance ?

RemiD(Posted 2012) [#1]
Hi :)

I have a game with 3 colliders sphere for each vehicle (to have a kind of collider capsule).

My program calculates the orientation and the vector of movement of each vehicle.
Then the program rotates and translates each vehicle.
Then UpdateWorld() is called.
Then the program checks if a collision occured to one of the collider sphere (by priority).
If a collision occured with one of the colliders sphere, the program calculates the new vector of movement.
Then RenderWorld() is called.

This works well but if a collision happens to one collider sphere, i have set my program to only use the index 1 of collisions and then to calculate the new vector based on the returned parameters.
ex :
OEntity% = CollisionEntity(VehicleColliderS,1)
CX# = CollisionX(VehicleColliderS,1)
CY# = CollisionY(VehicleColliderS,1)
CZ# = CollisionZ(VehicleColliderS,1)
CNX# = CollisionNX(VehicleColliderS,1)
CNY# = CollisionNY(VehicleColliderS,1)
CNZ# = CollisionNZ(VehicleColliderS,1)

Is this a good approach ? I think yes because i want my vehicle to react to the first collision occuring with another vehicle or the walls.

Your thoughts and advices ?

Last edited 2012