Lower corners of bbox vs. angles

Discuss programming in the QuakeC language.
Post Reply
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Lower corners of bbox vs. angles

Post by Cobalt »

The 4 lower corners of the player bounding box are:

Code: Select all


self.absmin
self.absmax - '0 0 56'
self.absmax - '0 32 56'
self.absmin - '0 -32 0'

As the players yaw changes, it faces different angles with respect to these points.
Is there a way using vectoangles, aim or v_forward to determine which of these points
the player is closest to facing with respect to its angles_y ?
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Lower corners of bbox vs. angles

Post by Spike »

local vector result;
makevectors(self.v_angle);
for (i = 0; i < 3; i++)
{
if (v_forward < 0)
result = other.absmax;
else
result = other.absmin;
}
return result;

fix as required.
Post Reply