#include "qbsp.h"
#include "l_mem.h"
#include "../botlib/aasfile.h"
#include "aas_store.h"
#include "aas_cfg.h"
#include "../game/surfaceflags.h"
Include dependency graph for aas_map.c:

Go to the source code of this file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
Definition at line 218 of file aas_map.c. References mapbrush_s::contents, side_s::contents, Error(), side_s::flags, mapbrush_t, nummapbrushsides, mapbrush_s::numsides, side_s::original, mapbrush_s::original_sides, side_s::planenum, SFL_BEVEL, side_t, side_s::surf, side_s::texinfo, and side_s::winding. Referenced by AAS_FixMapBrush(). 00219 {
00220 side_t *side;
00221 //
00222 if (nummapbrushsides >= MAX_MAPFILE_BRUSHSIDES)
00223 Error ("MAX_MAPFILE_BRUSHSIDES");
00224 //
00225 side = brush->original_sides + brush->numsides;
00226 side->original = NULL;
00227 side->winding = NULL;
00228 side->contents = brush->contents;
00229 side->flags &= ~(SFL_BEVEL|SFL_VISIBLE);
00230 side->surf = 0;
00231 side->planenum = planenum;
00232 side->texinfo = 0;
00233 //
00234 nummapbrushsides++;
00235 brush->numsides++;
00236 } //end of the function AAS_AddMapBrushSide
|
Here is the call graph for this function:

|
|
Definition at line 485 of file aas_map.c. References AAS_AlwaysTriggered_r(), mark_entities, and memset(). Referenced by AAS_ValidEntity(). 00485 {
00486 memset( mark_entities, 0, sizeof(mark_entities) );
00487 return AAS_AlwaysTriggered_r( targetname );
00488 }
|
Here is the call graph for this function:

|
|
Definition at line 452 of file aas_map.c. References atoi, entities, i, mark_entities, strcmp(), strlen(), ValueForKey(), and Warning(). Referenced by AAS_AlwaysTriggered(). 00453 {
00454 int i;
00455
00456 if (!strlen(targetname)) {
00457 return false;
00458 }
00459 //
00460 for (i = 0; i < num_entities; i++) {
00461 // if the entity will activate the given targetname
00462 if ( !strcmp(targetname, ValueForKey(&entities[i], "target")) ) {
00463 // if this activator is present in deathmatch
00464 if (!(atoi(ValueForKey(&entities[i], "spawnflags")) & SPAWNFLAG_NOT_DEATHMATCH)) {
00465 // if it is a trigger_always entity
00466 if (!strcmp("trigger_always", ValueForKey(&entities[i], "classname"))) {
00467 return true;
00468 }
00469 // check for possible trigger_always entities activating this entity
00470 if ( mark_entities[i] ) {
00471 Warning( "entity %d, classname %s has recursive targetname %s\n", i,
00472 ValueForKey(&entities[i], "classname"), targetname );
00473 return false;
00474 }
00475 mark_entities[i] = true;
00476 if ( AAS_AlwaysTriggered_r(ValueForKey(&entities[i], "targetname")) ) {
00477 return true;
00478 }
00479 }
00480 }
00481 }
00482 return false;
00483 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 406 of file aas_map.c. References mapbrush_s::brushnum, brushsides, side_s::contents, mapbrush_s::contents, mapbrush_s::entitynum, Error(), entity_t::firstbrush, side_s::flags, mapbrush_t, mapbrushes, mapent, n, entity_t::numbrushes, nummapbrushes, nummapbrushsides, mapbrush_s::numsides, side_s::original, mapbrush_s::original_sides, side_s::planenum, side_t, side_s::surf, side_s::texinfo, and side_s::winding. Referenced by AAS_CreateMapBrushes(). 00407 {
00408 int n;
00409 mapbrush_t *newbrush;
00410 side_t *side, *newside;
00411
00412 if (nummapbrushes >= MAX_MAPFILE_BRUSHES)
00413 Error ("MAX_MAPFILE_BRUSHES");
00414
00415 newbrush = &mapbrushes[nummapbrushes];
00416 newbrush->original_sides = &brushsides[nummapbrushsides];
00417 newbrush->entitynum = brush->entitynum;
00418 newbrush->brushnum = nummapbrushes - mapent->firstbrush;
00419 newbrush->numsides = brush->numsides;
00420 newbrush->contents = brush->contents;
00421
00422 //copy the sides
00423 for (n = 0; n < brush->numsides; n++)
00424 {
00425 if (nummapbrushsides >= MAX_MAPFILE_BRUSHSIDES)
00426 Error ("MAX_MAPFILE_BRUSHSIDES");
00427 side = brush->original_sides + n;
00428
00429 newside = newbrush->original_sides + n;
00430 newside->original = NULL;
00431 newside->winding = NULL;
00432 newside->contents = side->contents;
00433 newside->flags = side->flags;
00434 newside->surf = side->surf;
00435 newside->planenum = side->planenum;
00436 newside->texinfo = side->texinfo;
00437 nummapbrushsides++;
00438 } //end for
00439 //
00440 nummapbrushes++;
00441 mapent->numbrushes++;
00442 return newbrush;
00443 } //end of the function AAS_CopyMapBrush
|
Here is the call graph for this function:

|
||||||||||||||||
|
Definition at line 722 of file aas_map.c. References AAS_CopyMapBrush(), AAS_ExpandMapBrush(), AAS_MakeBrushWindings(), AAS_PositionBrush(), AAS_SetTexinfo(), AAS_ValidEntity(), AddBrushBevels(), cfg_s::bboxes, cfg, mapbrush_s::contents, CONTENTS_AREAPORTAL, CONTENTS_CLUSTERPORTAL, CONTENTS_DONOTENTER, CONTENTS_JUMPPAD, CONTENTS_LADDER, CONTENTS_LAVA, CONTENTS_MOVER, CONTENTS_SLIME, CONTENTS_SOLID, CONTENTS_TELEPORTER, CONTENTS_WATER, CONTENTS_WINDOW, entities, mapbrush_s::expansionbbox, FreeBrushWindings(), i, mapbrush_s::leafnum, mapbrush_t, mapent, aas_bbox_s::maxs, aas_bbox_s::mins, cfg_s::numbboxes, entity_t::numbrushes, nummapbrushes, nummapbrushsides, mapbrush_s::numsides, and aas_bbox_s::presencetype. Referenced by AAS_CreateCurveBrushes(), HL_BSPBrushToMapBrush(), Q1_BSPBrushToMapBrush(), Q2_BSPBrushToMapBrush(), Q2_ParseBrush(), Q3_BSPBrushToMapBrush(), and Sin_BSPBrushToMapBrush(). 00723 {
00724 int i;
00725 //side_t *s;
00726 mapbrush_t *bboxbrushes[16];
00727
00728 //if the brushes are not from an entity used for AAS
00729 if (!AAS_ValidEntity(mapent))
00730 {
00731 nummapbrushsides -= brush->numsides;
00732 brush->numsides = 0;
00733 return;
00734 } //end if
00735 //
00736 AAS_PositionBrush(mapent, brush);
00737 //from all normal solid brushes only the textured brush sides will
00738 //be used as bsp splitters, so set the right texinfo reference here
00739 AAS_SetTexinfo(brush);
00740 //remove contents detail flag, otherwise player clip contents won't be
00741 //bsped correctly for AAS!
00742 brush->contents &= ~CONTENTS_DETAIL;
00743 //if the brush has contents area portal it should be the only contents
00744 if (brush->contents & (CONTENTS_AREAPORTAL|CONTENTS_CLUSTERPORTAL))
00745 {
00746 brush->contents = CONTENTS_CLUSTERPORTAL;
00747 brush->leafnum = -1;
00748 } //end if
00749 //window and playerclip are used for player clipping, make them solid
00750 if (brush->contents & (CONTENTS_WINDOW | CONTENTS_PLAYERCLIP))
00751 {
00752 //
00753 brush->contents &= ~(CONTENTS_WINDOW | CONTENTS_PLAYERCLIP);
00754 brush->contents |= CONTENTS_SOLID;
00755 brush->leafnum = -1;
00756 } //end if
00757 //
00758 if (brush->contents & CONTENTS_BOTCLIP)
00759 {
00760 brush->contents = CONTENTS_SOLID;
00761 brush->leafnum = -1;
00762 } //end if
00763 //
00764 //Log_Write("brush %d contents = ", brush->brushnum);
00765 //PrintContents(brush->contents);
00766 //Log_Write("\r\n");
00767 //if not one of the following brushes then the brush is NOT used for AAS
00768 if (!(brush->contents & (CONTENTS_SOLID
00769 | CONTENTS_LADDER
00770 | CONTENTS_CLUSTERPORTAL
00771 | CONTENTS_DONOTENTER
00772 | CONTENTS_TELEPORTER
00773 | CONTENTS_JUMPPAD
00774 | CONTENTS_WATER
00775 | CONTENTS_LAVA
00776 | CONTENTS_SLIME
00777 | CONTENTS_MOVER
00778 )))
00779 {
00780 nummapbrushsides -= brush->numsides;
00781 brush->numsides = 0;
00782 return;
00783 } //end if
00784 //fix the map brush
00785 //AAS_FixMapBrush(brush);
00786 //if brush bevels should be added (for real map brushes, not bsp map brushes)
00787 if (addbevels)
00788 {
00789 //NOTE: we first have to get the mins and maxs of the brush before
00790 // creating the brush bevels... the mins and maxs are used to
00791 // create them. so we call MakeBrushWindings to get the mins
00792 // and maxs and then after creating the bevels we free the
00793 // windings because they are created for all sides (including
00794 // bevels) a little later
00795 AAS_MakeBrushWindings(brush);
00796 AddBrushBevels(brush);
00797 FreeBrushWindings(brush);
00798 } //end if
00799 //NOTE: add the brush to the WORLD entity!!!
00800 mapent = &entities[0];
00801 //there's at least one new brush for now
00802 nummapbrushes++;
00803 mapent->numbrushes++;
00804 //liquid brushes are expanded for the maximum possible bounding box
00805 if (brush->contents & (CONTENTS_WATER
00806 | CONTENTS_LAVA
00807 | CONTENTS_SLIME
00808 | CONTENTS_TELEPORTER
00809 | CONTENTS_JUMPPAD
00810 | CONTENTS_DONOTENTER
00811 | CONTENTS_MOVER
00812 ))
00813 {
00814 brush->expansionbbox = 0;
00815 //NOTE: the first bounding box is the max
00816 //FIXME: use max bounding box created from all bboxes
00817 AAS_ExpandMapBrush(brush, cfg.bboxes[0].mins, cfg.bboxes[0].maxs);
00818 AAS_MakeBrushWindings(brush);
00819 } //end if
00820 //area portal brushes are NOT expanded
00821 else if (brush->contents & CONTENTS_CLUSTERPORTAL)
00822 {
00823 brush->expansionbbox = 0;
00824 //NOTE: the first bounding box is the max
00825 //FIXME: use max bounding box created from all bboxes
00826 AAS_ExpandMapBrush(brush, cfg.bboxes[0].mins, cfg.bboxes[0].maxs);
00827 AAS_MakeBrushWindings(brush);
00828 } //end if
00829 //all solid brushes are expanded for all bounding boxes
00830 else if (brush->contents & (CONTENTS_SOLID
00831 | CONTENTS_LADDER
00832 ))
00833 {
00834 //brush for the first bounding box
00835 bboxbrushes[0] = brush;
00836 //make a copy for the other bounding boxes
00837 for (i = 1; i < cfg.numbboxes; i++)
00838 {
00839 bboxbrushes[i] = AAS_CopyMapBrush(brush, mapent);
00840 } //end for
00841 //expand every brush for it's bounding box and create windings
00842 for (i = 0; i < cfg.numbboxes; i++)
00843 {
00844 AAS_ExpandMapBrush(bboxbrushes[i], cfg.bboxes[i].mins, cfg.bboxes[i].maxs);
00845 bboxbrushes[i]->expansionbbox = cfg.bboxes[i].presencetype;
00846 AAS_MakeBrushWindings(bboxbrushes[i]);
00847 } //end for
00848 } //end else
00849 } //end of the function AAS_CreateMapBrushes
|
Here is the call graph for this function:

|
||||||||||||||||
|
Definition at line 120 of file aas_map.c. References BoxOriginDistanceFromPlane(), CapsuleOriginDistanceFromPlane(), plane_t::dist, FindFloatPlane(), side_s::flags, mapbrush_t, mapplanes, plane_t::normal, mapbrush_s::numsides, mapbrush_s::original_sides, side_s::planenum, s, side_t, and side_s::surf. Referenced by AAS_CreateMapBrushes(). 00121 {
00122 int sn;
00123 float dist;
00124 side_t *s;
00125 plane_t *plane;
00126
00127 for (sn = 0; sn < brush->numsides; sn++)
00128 {
00129 s = brush->original_sides + sn;
00130 plane = &mapplanes[s->planenum];
00131 dist = plane->dist;
00132 if (capsule_collision) {
00133 dist += CapsuleOriginDistanceFromPlane(plane->normal, mins, maxs);
00134 }
00135 else {
00136 dist += BoxOriginDistanceFromPlane(plane->normal, mins, maxs, 0);
00137 }
00138 s->planenum = FindFloatPlane(plane->normal, dist);
00139 //the side isn't a bevel after expanding
00140 s->flags &= ~SFL_BEVEL;
00141 //don't skip the surface
00142 s->surf &= ~SURF_SKIP;
00143 //make sure the texinfo is not TEXINFO_NODE
00144 //when player clip contents brushes are read from the bsp tree
00145 //they have the texinfo field set to TEXINFO_NODE
00146 //s->texinfo = 0;
00147 } //end for
00148 } //end of the function AAS_ExpandMapBrush
|
Here is the call graph for this function:

|
|
Definition at line 243 of file aas_map.c. References AAS_AddMapBrushSide(), AddPointToBounds(), BaseWindingForPlane(), mapbrush_s::brushnum, ChopWindingInPlace(), ClearBounds(), plane_t::dist, mapbrush_s::entitynum, FindFloatPlane(), side_s::flags, FreeBrushWindings(), i, j, Log_Print(), mapbrush_t, mapplanes, MAX_MAP_BOUNDS, mapbrush_s::maxs, mapbrush_s::mins, plane_t::normal, winding_t::numpoints, mapbrush_s::numsides, mapbrush_s::original_sides, winding_t::p, side_s::planenum, side_t, vec3_t, VectorClear, w, side_s::winding, and WindingsNonConvex(). 00244 {
00245 int i, j, planenum;
00246 float dist;
00247 winding_t *w;
00248 plane_t *plane, *plane1, *plane2;
00249 side_t *side;
00250 vec3_t normal;
00251
00252 //calculate the brush bounds
00253 ClearBounds(brush->mins, brush->maxs);
00254 for (i = 0; i < brush->numsides; i++)
00255 {
00256 plane = &mapplanes[brush->original_sides[i].planenum];
00257 w = BaseWindingForPlane(plane->normal, plane->dist);
00258 for (j = 0; j < brush->numsides && w; j++)
00259 {
00260 if (i == j) continue;
00261 //there are no brush bevels marked but who cares :)
00262 if (brush->original_sides[j].flags & SFL_BEVEL) continue;
00263 plane = &mapplanes[brush->original_sides[j].planenum^1];
00264 ChopWindingInPlace(&w, plane->normal, plane->dist, 0); //CLIP_EPSILON);
00265 } //end for
00266
00267 side = &brush->original_sides[i];
00268 side->winding = w;
00269 if (w)
00270 {
00271 for (j = 0; j < w->numpoints; j++)
00272 {
00273 AddPointToBounds(w->p[j], brush->mins, brush->maxs);
00274 } //end for
00275 } //end if
00276 } //end for
00277 //
00278 for (i = 0; i < brush->numsides; i++)
00279 {
00280 for (j = 0; j < brush->numsides; j++)
00281 {
00282 if (i == j) continue;
00283 plane1 = &mapplanes[brush->original_sides[i].planenum];
00284 plane2 = &mapplanes[brush->original_sides[j].planenum];
00285 if (WindingsNonConvex(brush->original_sides[i].winding,
00286 brush->original_sides[j].winding,
00287 plane1->normal, plane2->normal,
00288 plane1->dist, plane2->dist))
00289 {
00290 Log_Print("non convex brush");
00291 } //end if
00292 } //end for
00293 } //end for
00294
00295 //NOW close the fucking brush!!
00296 for (i = 0; i < 3; i++)
00297 {
00298 if (brush->mins[i] < -MAX_MAP_BOUNDS)
00299 {
00300 VectorClear(normal);
00301 normal[i] = -1;
00302 dist = MAX_MAP_BOUNDS - 10;
00303 planenum = FindFloatPlane(normal, dist);
00304 //
00305 Log_Print("mins out of range: added extra brush side\n");
00306 AAS_AddMapBrushSide(brush, planenum);
00307 } //end if
00308 if (brush->maxs[i] > MAX_MAP_BOUNDS)
00309 {
00310 VectorClear(normal);
00311 normal[i] = 1;
00312 dist = MAX_MAP_BOUNDS - 10;
00313 planenum = FindFloatPlane(normal, dist);
00314 //
00315 Log_Print("maxs out of range: added extra brush side\n");
00316 AAS_AddMapBrushSide(brush, planenum);
00317 } //end if
00318 if (brush->mins[i] > MAX_MAP_BOUNDS || brush->maxs[i] < -MAX_MAP_BOUNDS)
00319 {
00320 Log_Print("entity %i, brush %i: no visible sides on brush\n", brush->entitynum, brush->brushnum);
00321 } //end if
00322 } //end for
00323 //free all the windings
00324 FreeBrushWindings(brush);
00325 } //end of the function AAS_FixMapBrush
|
Here is the call graph for this function:

|
|
Definition at line 332 of file aas_map.c. References AddPointToBounds(), BaseWindingForPlane(), mapbrush_s::brushnum, ChopWindingInPlace(), ClearBounds(), plane_t::dist, mapbrush_s::entitynum, side_s::flags, i, j, Log_Print(), mapbrush_t, mapplanes, MAX_MAP_BOUNDS, mapbrush_s::maxs, mapbrush_s::mins, plane_t::normal, winding_t::numpoints, mapbrush_s::numsides, mapbrush_s::original_sides, winding_t::p, side_s::planenum, qboolean, side_t, w, side_s::winding, and WindingsNonConvex(). Referenced by AAS_CreateMapBrushes(), and AAS_PositionFuncRotatingBrush(). 00333 {
00334 int i, j;
00335 winding_t *w;
00336 side_t *side;
00337 plane_t *plane, *plane1, *plane2;
00338
00339 ClearBounds (ob->mins, ob->maxs);
00340
00341 for (i = 0; i < ob->numsides; i++)
00342 {
00343 plane = &mapplanes[ob->original_sides[i].planenum];
00344 w = BaseWindingForPlane(plane->normal, plane->dist);
00345 for (j = 0; j <ob->numsides && w; j++)
00346 {
00347 if (i == j) continue;
00348 if (ob->original_sides[j].flags & SFL_BEVEL) continue;
00349 plane = &mapplanes[ob->original_sides[j].planenum^1];
00350 ChopWindingInPlace(&w, plane->normal, plane->dist, 0); //CLIP_EPSILON);
00351 }
00352
00353 side = &ob->original_sides[i];
00354 side->winding = w;
00355 if (w)
00356 {
00357 side->flags |= SFL_VISIBLE;
00358 for (j = 0; j < w->numpoints; j++)
00359 AddPointToBounds (w->p[j], ob->mins, ob->maxs);
00360 }
00361 }
00362 //check if the brush is convex
00363 for (i = 0; i < ob->numsides; i++)
00364 {
00365 for (j = 0; j < ob->numsides; j++)
00366 {
00367 if (i == j) continue;
00368 plane1 = &mapplanes[ob->original_sides[i].planenum];
00369 plane2 = &mapplanes[ob->original_sides[j].planenum];
00370 if (WindingsNonConvex(ob->original_sides[i].winding,
00371 ob->original_sides[j].winding,
00372 plane1->normal, plane2->normal,
00373 plane1->dist, plane2->dist))
00374 {
00375 Log_Print("non convex brush");
00376 } //end if
00377 } //end for
00378 } //end for
00379 //check for out of bound brushes
00380 for (i = 0; i < 3; i++)
00381 {
00382 //IDBUG: all the indexes into the mins and maxs were zero (not using i)
00383 if (ob->mins[i] < -MAX_MAP_BOUNDS || ob->maxs[i] > MAX_MAP_BOUNDS)
00384 {
00385 Log_Print("entity %i, brush %i: bounds out of range\n", ob->entitynum, ob->brushnum);
00386 Log_Print("ob->mins[%d] = %f, ob->maxs[%d] = %f\n", i, ob->mins[i], i, ob->maxs[i]);
00387 ob->numsides = 0; //remove the brush
00388 break;
00389 } //end if
00390 if (ob->mins[i] > MAX_MAP_BOUNDS || ob->maxs[i] < -MAX_MAP_BOUNDS)
00391 {
00392 Log_Print("entity %i, brush %i: no visible sides on brush\n", ob->entitynum, ob->brushnum);
00393 Log_Print("ob->mins[%d] = %f, ob->maxs[%d] = %f\n", i, ob->mins[i], i, ob->maxs[i]);
00394 ob->numsides = 0; //remove the brush
00395 break;
00396 } //end if
00397 } //end for
00398 return true;
00399 } //end of the function AAS_MakeBrushWindings
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 646 of file aas_map.c. References AAS_PositionFuncRotatingBrush(), atoi, mapbrush_s::contents, plane_t::dist, DotProduct, FindFloatPlane(), FloatForKey(), i, mapbrush_t, mapent, mapplanes, mapbrush_s::modelnum, mapbrush_s::numsides, entity_t::origin, mapbrush_s::original_sides, side_s::planenum, s, side_t, strcmp(), and ValueForKey(). Referenced by AAS_CreateMapBrushes(). 00647 {
00648 side_t *s;
00649 float newdist;
00650 int i, notteam;
00651 char *model;
00652
00653 if (!strcmp(ValueForKey(mapent, "classname"), "func_door_rotating"))
00654 {
00655 AAS_PositionFuncRotatingBrush(mapent, brush);
00656 } //end if
00657 else
00658 {
00659 if (mapent->origin[0] || mapent->origin[1] || mapent->origin[2])
00660 {
00661 for (i = 0; i < brush->numsides; i++)
00662 {
00663 s = &brush->original_sides[i];
00664 newdist = mapplanes[s->planenum].dist +
00665 DotProduct(mapplanes[s->planenum].normal, mapent->origin);
00666 s->planenum = FindFloatPlane(mapplanes[s->planenum].normal, newdist);
00667 } //end for
00668 } //end if
00669 //if it's a trigger hurt
00670 if (!strcmp("trigger_hurt", ValueForKey(mapent, "classname")))
00671 {
00672 notteam = FloatForKey(mapent, "bot_notteam");
00673 if ( notteam == 1 ) {
00674 brush->contents |= CONTENTS_NOTTEAM1;
00675 }
00676 else if ( notteam == 2 ) {
00677 brush->contents |= CONTENTS_NOTTEAM2;
00678 }
00679 else {
00680 // always avoid so set lava contents
00681 brush->contents |= CONTENTS_LAVA;
00682 }
00683 } //end if
00684 //
00685 else if (!strcmp("trigger_push", ValueForKey(mapent, "classname")))
00686 {
00687 //set the jumppad contents
00688 brush->contents = CONTENTS_JUMPPAD;
00689 //Log_Print("found trigger_push brush\n");
00690 } //end if
00691 //
00692 else if (!strcmp("trigger_multiple", ValueForKey(mapent, "classname")))
00693 {
00694 //set teleporter contents
00695 brush->contents = CONTENTS_TELEPORTER;
00696 //Log_Print("found trigger_multiple teleporter brush\n");
00697 } //end if
00698 //
00699 else if (!strcmp("trigger_teleport", ValueForKey(mapent, "classname")))
00700 {
00701 //set teleporter contents
00702 brush->contents = CONTENTS_TELEPORTER;
00703 //Log_Print("found trigger_teleport teleporter brush\n");
00704 } //end if
00705 else if (!strcmp("func_door", ValueForKey(mapent, "classname")))
00706 {
00707 //set mover contents
00708 brush->contents = CONTENTS_MOVER;
00709 //get the model number
00710 model = ValueForKey(mapent, "model");
00711 brush->modelnum = atoi(model+1);
00712 } //end if
00713 } //end else
00714 } //end of the function AAS_PositionBrush
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 594 of file aas_map.c. References AAS_MakeBrushWindings(), AAS_TransformPlane(), AddBrushBevels(), FloatForKey(), FreeBrushWindings(), GetVectorForKey(), i, mapbrush_t, mapent, mapbrush_s::numsides, entity_t::origin, mapbrush_s::original_sides, side_s::planenum, s, side_t, vec3_t, VectorClear, VectorCopy, VectorInverse(), and VectorMA. Referenced by AAS_PositionBrush(). 00595 {
00596 int spawnflags, i;
00597 float distance;
00598 vec3_t movedir, angles, pos1, pos2;
00599 side_t *s;
00600
00601 spawnflags = FloatForKey(mapent, "spawnflags");
00602 VectorClear(movedir);
00603 if (spawnflags & DOOR_X_AXIS)
00604 movedir[2] = 1.0; //roll
00605 else if (spawnflags & DOOR_Y_AXIS)
00606 movedir[0] = 1.0; //pitch
00607 else // Z_AXIS
00608 movedir[1] = 1.0; //yaw
00609
00610 // check for reverse rotation
00611 if (spawnflags & DOOR_REVERSE)
00612 VectorInverse(movedir);
00613
00614 distance = FloatForKey(mapent, "distance");
00615 if (!distance) distance = 90;
00616
00617 GetVectorForKey(mapent, "angles", angles);
00618 VectorCopy(angles, pos1);
00619 VectorMA(angles, -distance, movedir, pos2);
00620 // if it starts open, switch the positions
00621 if (spawnflags & DOOR_START_OPEN)
00622 {
00623 VectorCopy(pos2, angles);
00624 VectorCopy(pos1, pos2);
00625 VectorCopy(angles, pos1);
00626 VectorInverse(movedir);
00627 } //end if
00628 //
00629 for (i = 0; i < brush->numsides; i++)
00630 {
00631 s = &brush->original_sides[i];
00632 s->planenum = AAS_TransformPlane(s->planenum, mapent->origin, pos2);
00633 } //end for
00634 //
00635 FreeBrushWindings(brush);
00636 AAS_MakeBrushWindings(brush);
00637 AddBrushBevels(brush);
00638 FreeBrushWindings(brush);
00639 } //end of the function AAS_PositionFuncRotatingBrush
|
Here is the call graph for this function:

|
|
Definition at line 155 of file aas_map.c. References mapbrush_s::contents, CONTENTS_AREAPORTAL, CONTENTS_CLUSTERPORTAL, CONTENTS_DONOTENTER, CONTENTS_JUMPPAD, CONTENTS_LADDER, CONTENTS_LAVA, CONTENTS_SLIME, CONTENTS_TELEPORTER, CONTENTS_WATER, CONTENTS_WINDOW, side_s::flags, mapbrush_t, n, mapbrush_s::numsides, mapbrush_s::original_sides, SFL_TEXTURED, side_t, and side_s::texinfo. Referenced by AAS_CreateMapBrushes(). 00156 {
00157 int n;
00158 side_t *side;
00159
00160 if (brush->contents & (CONTENTS_LADDER
00161 | CONTENTS_AREAPORTAL
00162 | CONTENTS_CLUSTERPORTAL
00163 | CONTENTS_TELEPORTER
00164 | CONTENTS_JUMPPAD
00165 | CONTENTS_DONOTENTER
00166 | CONTENTS_WATER
00167 | CONTENTS_LAVA
00168 | CONTENTS_SLIME
00169 | CONTENTS_WINDOW
00170 | CONTENTS_PLAYERCLIP))
00171 {
00172 //we just set texinfo to 0 because these brush sides MUST be used as
00173 //bsp splitters textured or not textured
00174 for (n = 0; n < brush->numsides; n++)
00175 {
00176 side = brush->original_sides + n;
00177 //side->flags |= SFL_TEXTURED|SFL_VISIBLE;
00178 side->texinfo = 0;
00179 } //end for
0 |