Multiple Collision Spheres?

Blitz3D Forums/Blitz3D Programming/Multiple Collision Spheres?

Cubed Inc.(Posted 2013) [#1]
Is it possible to attach a bunch of collision spheres to an entity (a tall character whose taller than wide) and have all of them act like one single collision radius?


Yasha(Posted 2013) [#2]
If you just want a tall character, remember that collision "spheres" can actually be ovoids - you can set a separate Y for the collider using the third parameter to EntityRadius.

(If your EntityRadius command only takes two parameters, you should update your B3D - this feature was added in v1.81, along with many other things since.)

It is possible to make multiple colliders control a single entity, but it's a bit messy, so hopefully a collision egg will solve your problem without needing to get into that.


RemiD(Posted 2013) [#3]
From my tests, using a "collision egg" is messy, because the character will be able to move on steep slopes (even on cubes)

You can set several colliders spheres as childs of a main pivot and use the collision response stop.
Then each frame, you can check if there has been a collision between one of the collider sphere and the walls/obstacles.
If yes, the collider sphere will be stopped by the wall/obstacle.
With the collision point coordinates and the direction and movement vector, you can retrieve the collider sphere 3d coordinates (where it should be before collision).
And because you know what is the position of each collider sphere related to the main pivot, you can use TFormPoint to find what should be the position of the main pivot related to this collider sphere.
Then you can position the main pivot to the new position.
Then you can delete all colliders sphere and recreate others colliders sphere at the right place with TFormPoint. (related to the main pivot)

Another way would be to do this : (thanks Yasha for the idea)
http://blitzbasic.com/Community/posts.php?topic=100911