You only need to do 2 traces on one axis. Since a map is supposed to be
completely enclosed. Aslong as the trace hits a brush in both directions,
then they are inside the world. You could also assume that aslong as a
player is not nocliping and their Z velocity is under like 1000 they are in
the world. If both are false, then you do the trace check, if the trace
doesn't hit twice then kill the player.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Andrew Watkins
Sent: Thursday, 18 September 2008 5:20 PM
To: [email protected]
Subject: [hlcoders] Detecting point is outside world

Hey all, very simple question that I can't seem to find the answer to - how 
to tell if a point is outside the game world or not?

I've added an ability allowing players to teleport a short distance, 
including through walls, to our HL2MP OB mod. This is great, and the code 
successfully avoids getting the player stuck inside world brushes or 
anything else when teleporting. It is unfortunately possible for them to 
teleport to completely outside the world geometry, and I can't work out how 
to stop this. I've tried my hull traces using various likely-looking masks &

collision groups, and have looked at all the UTIL_PointContents flags, but I

can't see how to determine if a point is outside the world or not.

I've also looked through gamemovement.cpp, as players don't fall when they 
teleport outside the world, so something must be stopping them, as they 
aren't "in a solid" - but nothing jumps out at me. So, does anyone know how 
to determine if a point / trace / entity is completely outside the world 
geometry?

The best "hacky" method I can come up with is testing if a 
several-thousand-unit-long trace can be done in any direction 
(up/down/n/s/e/w), and if any can, assume its outside. I'm sure there's a 
point contents method, but I can't work it out. Help would be appreciated.

Thanks 


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to