29 #include "../../../idlib/precompiled.h"
49 edge = &
edges[edgeNum];
66 face = &
faces[faceNum];
68 for ( i = 0; i < face->
numEdges; i++ ) {
70 edge = &
edges[ abs( edgeNum ) ];
90 area = &
areas[areaNum];
92 for ( i = 0; i < area->
numFaces; i++ ) {
107 int i, faceNum, numFaces;
113 area = &
areas[areaNum];
122 for ( i = 0; i < area->
numFaces; i++ ) {
130 if ( numFaces > 0 ) {
136 Trace( trace, center, end );
150 edge = &
edges[ abs( edgeNum ) ];
167 face = &
faces[faceNum];
170 for ( i = 0; i < face->
numEdges; i++ ) {
172 edge = &
edges[ abs( edgeNum ) ];
188 area = &
areas[areaNum];
191 for ( i = 0; i < area->
numFaces; i++ ) {
209 node = &
nodes[nodeNum];
230 int areaList[32], areaNum,
i;
238 trace.
areas = areaList;
240 trace.
maxAreas =
sizeof( areaList ) /
sizeof(
int );
245 if ( (
areas[areaNum].flags & areaFlags ) && ( (
areas[areaNum].travelFlags & excludeTravelFlags ) == 0 ) ) {
253 Trace( trace, start, end );
255 if ( (
areas[0].flags & areaFlags ) && ( (
areas[0].travelFlags & excludeTravelFlags ) == 0 ) ) {
258 start = pointList[0];
266 Trace( trace, start, end );
275 for ( i = 1; i <= 12; i++ ) {
276 frac = i * ( 1.0f / 12.0f );
277 bounds[0] = origin + searchBounds[0] * frac;
278 bounds[1] = origin + searchBounds[1] * frac;
280 if ( areaNum && (
areas[areaNum].flags & areaFlags ) && ( (
areas[areaNum].travelFlags & excludeTravelFlags ) == 0 ) ) {
298 if ( (
areas[-nodeNum].flags & areaFlags ) && ( (
areas[-nodeNum].travelFlags & excludeTravelFlags ) == 0 ) ) {
303 node = &
nodes[nodeNum];
343 area = &
areas[areaNum];
346 for ( i = 0; i < area->
numFaces; i++ ) {
348 face = &
faces[abs( faceNum )];
351 float dist = plane.
Distance( point );
355 point -= dist * plane.
Normal();
365 #define TRACEPLANE_EPSILON 0.125f
376 int side, nodeNum, tmpPlaneNum;
377 double front, back, frac;
388 tstack_p = tracestack;
399 if ( tstack_p < tracestack ) {
434 if ( v1 * plane->
Normal() > 0.0f ) {
467 if ( v1 * plane->
Normal() > 0.0f ) {
479 node = &
nodes[nodeNum];
481 cur_start = tstack_p->
start;
483 cur_end = tstack_p->
end;
487 front = plane->
Distance( cur_start );
497 common->
Error(
"idAASFileLocal::Trace: stack overflow\n" );
508 common->
Error(
"idAASFileLocal::Trace: stack overflow\n" );
531 cur_mid = cur_start + ( cur_end - cur_start ) * frac;
537 tstack_p->
start = cur_mid;
542 common->
Error(
"idAASFileLocal::Trace: stack overflow\n" );
547 tstack_p->
start = cur_start;
548 tstack_p->
end = cur_mid;
552 if ( tstack_p >= &tracestack[MAX_AAS_TREE_DEPTH] ) {
553 common->
Error(
"idAASFileLocal::Trace: stack overflow\n" );
581 if ( nodeNum <= 0 ) {
586 if ( depth > maxDepth ) {
590 node = &
nodes[nodeNum];
605 depth = maxDepth = 0;
virtual idVec3 FaceCenter(int faceNum) const
virtual idBounds FaceBounds(int faceNum) const
virtual int PointAreaNum(const idVec3 &origin) const
const idVec3 & Normal(void) const
int MaxTreeDepth(void) const
float Distance(const idVec3 &v) const
idList< aasNode_t > nodes
idVec3 AreaReachableGoal(int areaNum) const
virtual idBounds EdgeBounds(int edgeNum) const
int AreaContentsTravelFlags(int areaNum) const
GLint GLint GLsizei GLsizei GLsizei depth
int BoundsReachableAreaNum_r(int nodeNum, const idBounds &bounds, const int areaFlags, const int excludeTravelFlags) const
void MaxTreeDepth_r(int nodeNum, int &depth, int &maxDepth) const
#define AREA_REACHABLE_FLY
virtual int BoundsReachableAreaNum(const idBounds &bounds, const int areaFlags, const int excludeTravelFlags) const
idList< aasIndex_t > faceIndex
virtual idVec3 AreaCenter(int areaNum) const
idList< aasIndex_t > edgeIndex
bool AddPoint(const idVec3 &v)
GLfloat GLfloat GLfloat v2
struct aasTraceStack_s aasTraceStack_t
idVec3 vec3_origin(0.0f, 0.0f, 0.0f)
idList< aasFace_t > faces
#define TRACEPLANE_EPSILON
virtual idVec3 EdgeCenter(int edgeNum) const
virtual int PointReachableAreaNum(const idVec3 &origin, const idBounds &searchBounds, const int areaFlags, const int excludeTravelFlags) const
#define AREACONTENTS_WATER
idList< aasEdge_t > edges
idList< aasVertex_t > vertices
#define AREA_REACHABLE_WALK
virtual bool Trace(aasTrace_t &trace, const idVec3 &start, const idVec3 &end) const
virtual void PushPointIntoAreaNum(int areaNum, idVec3 &point) const
idList< aasArea_t > areas
int PlaneSide(const idPlane &plane, const float epsilon=ON_EPSILON) const
virtual void Error(const char *fmt,...) id_attribute((format(printf
#define MAX_AAS_TREE_DEPTH
virtual idBounds AreaBounds(int areaNum) const