change entity radius with collision

BlitzMax Forums/MiniB3D Module/change entity radius with collision

ima747(Posted 2009) [#1]
is there a way to change an entity radius and have collisions take place through the size change?

For example, a balloon inflating in a corner. As the balloon inflates it's radius gets bigger. It should push away from the corner but if the change is too big it will pop through the walls and no longer collide.

Currently I'm raising the object as it's radius expands and updating the objects collisions after the change which works for collision with a flat ground, but nothing else.

Any thoughts or suggestions?


Warner(Posted 2009) [#2]
That is quite tricky I suppose. Only if the entity moves, you can get collisions. You could maybe move it in all directions, and then move it away from any side that has collided with anything. But then again, if the sphere can't become bigger, because it is trapped inside a small area? Then there should be some kind of feedback that prevents it from inflating.
Maybe for these kind of collisions, you could look for a physics library of any kind. I never used one, but I'm sure they are available.


ima747(Posted 2009) [#3]
The 2 options I've got at the moment are either only expanding the radius when it's on a flat surface with no other collisions and hoping that it doesn't expand through things, or a variant of what you said, expand the radius and then essentially jiggle it around doing collision updates to see what it hits (got to expand firt to get the angles between the straight axies) a physics lib is a bit overkill for the project I'm working on as there's only 1 moving object and I'm develoption with iMinib3d as the primary target.

it seems like growing the radius could be treated like movement in all directions if it were integrated into the collision system (like moving an object fast, it doesn't go through things), so I think I'll have a poke around and see if I can make sense of it.