Detecting Collision with Tokamak

Blitz3D Forums/Blitz3D Userlibs/Detecting Collision with Tokamak

Uncle Ho(Posted 2006) [#1]
I am trying to figure out collisions of rigid bodies with a static mesh. is this possible at all? does anyone know?
i have been trying to get collision-data with materialIDs too mut did not succeed.

i load my level with botbuilders TOK_AddMesh() ... commands as a static mesh and i want to detect when the rigid bodies hit my level. so i thought this must be a common problem, isn't it ?

Eric(Posted 2006) [#2]
I believe the collision ID so a static mesh is -1. It's been a while.


Uncle Ho(Posted 2006) [#3]
hm. i tried all of that. could not get any result yet.
can anyone show me how to test this?
i tried this:

; --> Collision Check
If TOKSIM_GetCollisionCount() > 0
    For c = 0 To TOKSIM_GetCollisionCount()-1
        DebugLog "A >> " + TOKCOL_GetCollisionIdA(colbank, c)
        DebugLog "B >> " + TOKCOL_GetCollisionIdB(colbank, c)

Vorderman(Posted 2006) [#4]
Have you assigned collision IDs to the bodies that are colliding with the static mesh?

Vorderman(Posted 2006) [#5]
This section of code worked for me -

Uncle Ho(Posted 2006) [#6]
thx vorderman, i tried this code. but it does not detect my static-mesh either.
it detects all other collision-objects but not the level-file i loaded.

well finally i am using blitz3d "linepick()" to detect collision between level- and player-mesh.
not as good as i wanted. but it works at last.