Non reactive collision?

BlitzMax Forums/MiniB3D Module/Non reactive collision?

ima747(Posted 2007) [#1]
In the game I'm working on the player's model needs to pass through some rotating stars to pick them up. I'm using the collision system and it's good when the character is flying around, every loop I see if the player is hitting any stars, if he is I change the entity type for those stars and change their color/alpha to indicate they've been hit. the problem seems to be if you are sliding across a surface and come in under a star, the star pushes the player through the surface before I can turn the star entity type off... is there any way to get collision detection but not have interaction? I just need to know if I'm hitting the star, I don't need anything to slide, stop or get pushed etc. I could do it, since I'm using elipsoid to elipsoid collision, by checking the distance between them but since the collision system is already there it seems more sensible to use that to, you know, detect collisions...

do I need to make a new collision response type? setting the response type to 0,1,2 or 3 has no effect. I tried moving the collision decleration before the decleration with solid objects thinking that might help but no dice... any ideas?


impixi(Posted 2007) [#2]
You might be able to use the pick-related commands to simulate a non-response collision. Very rough example:




ima747(Posted 2007) [#3]
Hmm... guess that's a vote for "find another way, it currently doesn't support it and it's easier to do a work around than add it" which makes sense.

What do you think the pros/cons are for using a pick based system over say, EntityDistance... since I'm doing esentialy sphere collision I'm assuming entity distance would be faster than picking... but I don't know... maybe I'll put together some stress tests.

Thanks for your input!


simonh(Posted 2007) [#4]
It's very easy to add a non-reactive collision mode - in fact in the collision source code you can see a commented out line where such a thing is implemented. I'll get it working in the next release.


ima747(Posted 2007) [#5]
oo very cool, I'll take a look into that as well. it wouldn't be hard for me to do a distance check but it makes a whole lot more sense to use the collision system, especially if I ever want to do something else with that collision type later.


ima747(Posted 2007) [#6]
Well I've been nosing around and I think I see where the commented out line is in Collision.bmx. when I uncomment the if statement and return all the collisions seem freak out a bit. the collisions are all pass through rather than solid, but sometimes they hang up... i.e. and object will pass through another and then get stuck trying to come out the far side. those are response response type 1 collisions. and it doesn't always happen. it seems to happen more in tight corners.

my assumption is that the response type isn't actualy being stored per collision set, so it's all going to 0 all the time, and since it now returns 0 type collisions without doing anything then no collisions happne... but that doesn't explain the occasional getting stuck... I don't fully understand how the system works but I'll keep poking, if anything comes to mind as to where I should be looking let me know, if I can get it working I'll post it and hopefully save you a little work.