Erg. That's all I can think. Erg. Wibble wibble wibble...
Does anyone have any idea how to solve my problem? I want my players to bounce off walls (not just reversing the direction, but bouncing like a cue ball off the sides).
My collisions are set up as follows:
Const car_col=1
Const world_col=2
Collisions car_col,world_col,2,1
(Note: I am using the Stop response so that Blitz doesn't try to automatically move the cars up or down)
Then I look for collisions and try to correct them:
If EntityCollided(c\mesh,world_col) ; PLAYER VS LAND
xnorm#=CollisionNX(c\mesh,1)
ynorm#=CollisionNY(c\mesh,1)
znorm#=CollisionNZ(c\mesh,1)
c\vx#=c\vx#+xnorm#
c\vz#=c\vz#+znorm#
MoveEntity c\e,c\vx#,0,c\vz#
ResetEntity c\mesh
End If
This appears to work at a slow speed, but if my car heads straight for a wall quite often it just cruises on through it bobbling slightly... can anyone help? I really want to try and get some nice collisions in my game but (to be honest) I am no mathematician!!
Thanks in advance!
Does anyone have any idea how to solve my problem? I want my players to bounce off walls (not just reversing the direction, but bouncing like a cue ball off the sides).
My collisions are set up as follows:
Const car_col=1
Const world_col=2
Collisions car_col,world_col,2,1
(Note: I am using the Stop response so that Blitz doesn't try to automatically move the cars up or down)
Then I look for collisions and try to correct them:
If EntityCollided(c\mesh,world_col) ; PLAYER VS LAND
xnorm#=CollisionNX(c\mesh,1)
ynorm#=CollisionNY(c\mesh,1)
znorm#=CollisionNZ(c\mesh,1)
c\vx#=c\vx#+xnorm#
c\vz#=c\vz#+znorm#
MoveEntity c\e,c\vx#,0,c\vz#
ResetEntity c\mesh
End If
This appears to work at a slow speed, but if my car heads straight for a wall quite often it just cruises on through it bobbling slightly... can anyone help? I really want to try and get some nice collisions in my game but (to be honest) I am no mathematician!!
Thanks in advance!