Collision with Q3 map
Hello.
I've begun working on an engine for a new game. I'm currently using Quake3 maps for all levels (as I lack the knowhow to write a half-way competent editor). Anyway, Q3 works great. The rendering is very fast thanks to PVS.
screen at: http://homepage.mac.com/jkross/.cv/jkros...binhex.hqx
Shameless plug, I know
Anyway, I started working on the collision detection the other day. My algorithm is super-simple. Basically you check the area on any leaf the player tries to enter. If it is -1 (written into the format) do not allow them to enter it. Stairs and slopes are a little more tricky but basically the same.
Anyway, its come to the point that I want to implement sliding collision (whereas when the player hits the wall they slide accross it rather than stop dead). Problem is I can tell nothing about where the player collides. All I have is a position and forward vec for the player.
I know that somewhere there's a way to do this but I've been racking my brain for a couple of days and can't find one. I'm thinking some trig might solve it but I dunno.
Any advice is greatly appreciated.
I've begun working on an engine for a new game. I'm currently using Quake3 maps for all levels (as I lack the knowhow to write a half-way competent editor). Anyway, Q3 works great. The rendering is very fast thanks to PVS.
screen at: http://homepage.mac.com/jkross/.cv/jkros...binhex.hqx
Shameless plug, I know
Anyway, I started working on the collision detection the other day. My algorithm is super-simple. Basically you check the area on any leaf the player tries to enter. If it is -1 (written into the format) do not allow them to enter it. Stairs and slopes are a little more tricky but basically the same.
Anyway, its come to the point that I want to implement sliding collision (whereas when the player hits the wall they slide accross it rather than stop dead). Problem is I can tell nothing about where the player collides. All I have is a position and forward vec for the player.
I know that somewhere there's a way to do this but I've been racking my brain for a couple of days and can't find one. I'm thinking some trig might solve it but I dunno.
Any advice is greatly appreciated.
choose your x axis to be along your wall, now divide your vector into a x and y component in relation to the wall and move the player by the amount of the x component.
Yeah skyhawk that was my first guess too.
Prob is I don't know anything about the wall at the point of collision. All I know is that the player has collided with something.
Thus, how can I set the x parallel to the wall?
I've gotta figure out some way to do it with only position and forward vecs.
Prob is I don't know anything about the wall at the point of collision. All I know is that the player has collided with something.
Thus, how can I set the x parallel to the wall?
I've gotta figure out some way to do it with only position and forward vecs.
Surely, that's just not enough information.
Can't you find something out from the two leaves in question?
Can't you find something out from the two leaves in question?

