PDA

View Full Version : Collision with Q3 map


Bossa Nova
2003.04.02, 10:37 PM
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/jkross/Public/BountyHunters%20Screen.jpg-binhex.hqx

Shameless plug, I know :blush:

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.

skyhawk
2003.04.02, 10:58 PM
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.

Bossa Nova
2003.04.03, 01:04 PM
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.

w_reade
2003.04.03, 01:28 PM
Surely, that's just not enough information.

Can't you find something out from the two leaves in question?

Bossa Nova
2003.04.04, 07:39 AM
Your probably right reade.

I decided to tear out my leaf collision and do full brush collision instead.

This is a little trickier (and slower) but I think its probably my only choice. I might post a demo when I'm done if anyone is interested.

Guess I'll get to work :)