Q3 engine: world encroachment checks?
Posted: Tue Jun 03, 2008 7:15 am
I'm working on something that gives the player an ability to teleport to arbitrary points in the world (think Translocator from UT). One problem I have to solve is that it's currently very easy to teleport yourself halfway into solid world geometry and be unable to do anything but \kill and respawn.
I'm looking at existing Q3 code for ways to do this, and nothing seems exactly suited for testing whether the player, or any entity for that matter, is intersecting with world geometry, other than a trace of course - and most of the approaches I can think that use trace would use lots of them (in different directions) in a single frame, which seems very inefficient.
I tried trap_EntitiesInBox, but that doesn't seem to catch the world entity, just things besides the player. I'm not sure I understand how trap_EntityContact works, might that be what I want? Or is the "trace in different directions from the player origin" approach viable? Thanks in advance for any advice.
I'm looking at existing Q3 code for ways to do this, and nothing seems exactly suited for testing whether the player, or any entity for that matter, is intersecting with world geometry, other than a trace of course - and most of the approaches I can think that use trace would use lots of them (in different directions) in a single frame, which seems very inefficient.
I tried trap_EntitiesInBox, but that doesn't seem to catch the world entity, just things besides the player. I'm not sure I understand how trap_EntityContact works, might that be what I want? Or is the "trace in different directions from the player origin" approach viable? Thanks in advance for any advice.