Collision detection without response

Blitz3D Forums/Blitz3D Programming/Collision detection without response

TomToad(Posted 2004) [#1]
I'm trying to detect collision between a sphere and a surface. I don't want Blitz3D to respond to the collision, just report that one has happened. I don't want the entity to stop or slide or move up, I just want to know when it has actually collided with the surface. Anyway to do this without having to write my own collision detection routines?


big10p(Posted 2004) [#2]
I think the usual method is to parent a pivot to your sphere (or whatever) and setup a collision between the pivot and the surface. Then, when the pivot hits the surface it will stop but the sphere will not be affected.


Rook Zimbabwe(Posted 2004) [#3]
. <compacted accidental post>


Rook Zimbabwe(Posted 2004) [#4]
In your language reference look at:
EntityCollided(entity)
CollisionEntity(entity,index)
CountCollisions(entity)

like:
boing=CountCollisions(floor)
if boing = 1 then
     playsound boing
     score = score + 1
endif
I mean I don't know what you really want to do. Is this some sort of trigger to change from inside to outside mesh?
-RZ


aCiD2(Posted 2004) [#5]
Ive done it in Coldet... you can do poly to poly without losing any fps :P its blindingly fast...


TomToad(Posted 2004) [#6]
After posting the above question, I tried out a few different things. I asked about a sphere in the topic, but I actually meant pivot. Same problem though. I tried repositioning the pivot every frame which had basically the same effect that I was looking for but it created other problems.

What I'm attempting to do is create a 3D platform game. When the character walks off the edge of a platform, I want it to fall realistically (i.e. affected by gravity), but the character also will be walking up and down slopes, climbing ladders, bouncing off trampolies, jumping on top of baddies, etc...
I thought about putting a pivot slightly below the character to determine if a collision happened from below or from some other side. My first attempt had Blitz shoving the pivot into my character causing no more collisions on the pivot. I then tried repositioning the pivot every frame, but that caused other problems.
I'm begining to think that my only solution would be to redo the level with the floors and walls as seperate meshes then check for collisions on each of them.


Warren(Posted 2004) [#7]
That's actually not a bad approach. If you need the collision to differ for the floors/walls as opposed to other things, make them separate and give them a different collision ID.


scribbla(Posted 2004) [#8]
my god....TomToad u sound like me...im having the exact same probs...im want to trigger of animations like when falling of platforms...i have one sphere at the moment in front of him so when this is has not collided with ground i know its falling of platform...
try repositioning the collision sphere after UpdateWorld and before render world this will always draw it in the right position for the next loop...also ive tried the separate floor and walls...i dont think its the way to go...but im still trying all sorts of things..so im in the same boat as you...
i think the best thing to do is create some sort of collision rig around the character using pivs and collision spheres..sort of one sphere in front,1 at the back, 1 at his head...some at the hands for climbing...i havnt tried this yet but as soon as i pluck up the courage im guna have another go


Zethrax(Posted 2004) [#9]
Perhaps you could try checking the 'CollisionX/Y/Z()' results to see where the collision is occurring in relation to the centerpoint, orientation, and movement direction of the character. This should supply you with information on the steepness of the floor/incline/wall that the character is colliding with, and its orientation and direction of movement in relation to an incline.

For additional info for more targetted animations, you could try sticking info about the animations required, and other data, into the namestring of the collidable entities (or a reference to the data instead of the data itself).


TomToad(Posted 2004) [#10]
@Axeman: I think you might've just given me the solution I need. A little late right now and a long day of work tomorrow, so it'll be a couple of days before I can try it out.


gpete(Posted 2004) [#11]
In the program I'm working on, the camera has a downward pull (gravity) of -.2 in the Y direction each loop. When moving forward it has an acceleration of +.6 in Z direction ....
Using standard collision checking,
( Collisions col_camera,type_terrain,2,2 ) with platforms, buildings, trees, as type_terrain, you "fall" whenever you step off objects of type_terrain. When climbing sloped surfaces the downward pull of -.2 slows you down, simulating the greater "effort" of climbing.


TomToad(Posted 2004) [#12]
@gpete: I've tried that method. Problem is that when the character reaches the edge of a platform, instead of falling, it just hangs there dangling instead of falling until it's off enough to actually fall.



Also, when the character hits a wall on the way down, it'll flag as having landed. It still falls, but now at the rate of -.2 instead of accelerating from the effects of gravity (not to mention that any animation and sounds that I'll be adding in later will not run as though the character is falling)



When I get the chance, I'll use Axeman's advice and see how it works.