#include "cmdlib.h"
#include "mathlib.h"
#include "bspfile.h"
Include dependency graph for vis.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 40 of file vis.h. Referenced by CreatePassages(). |
|
|
|
|
|
|
|
|
|
|
|
|
Referenced by CreatePassages(), PassageMemory(), RecursivePassageFlow(), and RecursivePassagePortalFlow(). |
|
|
Referenced by AllocStackWinding(), CheckStack(), ClipToSeperators(), FreeStackWinding(), RecursiveLeafFlow(), RecursivePassageFlow(), RecursivePassagePortalFlow(), and VisChopWinding(). |
|
|
Definition at line 68 of file vis.h. 00068 {stat_none, stat_working, stat_done} vstatus_t;
|
|
|
Definition at line 1505 of file visflow.c. References c_flood, CountBits(), d, plane_t::dist, DotProduct, j, k, vportal_t::leaf, malloc(), memset(), plane_t::normal, vportal_t::nummightsee, winding_t::numpoints, numportals, p, vportal_t::plane, winding_t::points, portalbytes, vportal_t::portalflood, vportal_t::portalfront, portals, vportal_t::portalvis, vportal_t::removed, SimpleFlood(), w, and vportal_t::winding. Referenced by CalcVis(). 01506 {
01507 int j, k;
01508 vportal_t *tp, *p;
01509 float d;
01510 winding_t *w;
01511
01512 p = portals+portalnum;
01513
01514 if (p->removed)
01515 return;
01516
01517 p->portalfront = malloc (portalbytes);
01518 memset (p->portalfront, 0, portalbytes);
01519
01520 p->portalflood = malloc (portalbytes);
01521 memset (p->portalflood, 0, portalbytes);
01522
01523 p->portalvis = malloc (portalbytes);
01524 memset (p->portalvis, 0, portalbytes);
01525
01526 for (j=0, tp = portals ; j<numportals*2 ; j++, tp++)
01527 {
01528 if (j == portalnum)
01529 continue;
01530 if (tp->removed)
01531 continue;
01532 /*
01533 if (farplanedist >= 0)
01534 {
01535 vec3_t dir;
01536 VectorSubtract(p->origin, tp->origin, dir);
01537 if (VectorLength(dir) > farplanedist - p->radius - tp->radius)
01538 continue;
01539 }
01540 */
01541 w = tp->winding;
01542 for (k=0 ; k<w->numpoints ; k++)
01543 {
01544 d = DotProduct (w->points[k], p->plane.normal)
01545 - p->plane.dist;
01546 if (d > ON_EPSILON)
01547 break;
01548 }
01549 if (k == w->numpoints)
01550 continue; // no points on front
01551
01552 w = p->winding;
01553 for (k=0 ; k<w->numpoints ; k++)
01554 {
01555 d = DotProduct (w->points[k], tp->plane.normal)
01556 - tp->plane.dist;
01557 if (d < -ON_EPSILON)
01558 break;
01559 }
01560 if (k == w->numpoints)
01561 continue; // no points on front
01562
01563 p->portalfront[j>>3] |= (1<<(j&7));
01564 }
01565
01566 SimpleFlood (p, p->leaf);
01567
01568 p->nummightsee = CountBits (p->portalflood, numportals*2);
01569 // _printf ("portal %i: %i mightsee\n", portalnum, p->nummightsee);
01570 c_flood += p->nummightsee;
01571 }
|
Here is the call graph for this function:

|
|
Definition at line 1641 of file visflow.c. References c_vis, CountBits(), vportal_t::leaf, vportal_t::nummightsee, numportals, p, vportal_t::portalflood, portals, vportal_t::portalvis, RecursiveLeafBitFlow(), and vportal_t::removed. 01642 {
01643 vportal_t *p;
01644
01645 p = portals+portalnum;
01646
01647 if (p->removed)
01648 return;
01649
01650 RecursiveLeafBitFlow (p->leaf, p->portalflood, p->portalvis);
01651
01652 // build leaf vis information
01653 p->nummightsee = CountBits (p->portalvis, numportals*2);
01654 c_vis += p->nummightsee;
01655 }
|
Here is the call graph for this function:

|
|
Definition at line 322 of file l_poly.c. References AllocWinding(), c, memcpy(), winding_t::numpoints, winding_t::p, and w. Referenced by AAS_CreateArea(), AddWindingToConvexHull(), BspFaceForPortal(), ClipSidesIntoTree(), ClipWindingEpsilon(), CM_AddFacetBevels(), CopyBrush(), FaceFromPortal(), HL_FaceOnWinding(), HL_SplitBrush(), MakeBspBrushList(), MakeStructuralBspFaceList(), MakeVisibleBspFaceList(), Q1_FaceOnWinding(), Q1_SplitBrush(), Q2_FaceOnWinding(), Q3_FaceOnWinding(), Sin_FaceOnWinding(), and SplitBrush(). 00323 {
00324 int size;
00325 winding_t *c;
00326
00327 c = AllocWinding (w->numpoints);
00328 size = (int)((winding_t *)0)->p[w->numpoints];
00329 memcpy (c, w, size);
00330 return c;
00331 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 43 of file visflow.c. References bits, byte, c, and i. Referenced by BasePortalVis(), BetterPortalVis(), LeafVectorFromPortalVector(), and PortalFlow(). 00044 {
00045 int i;
00046 int c;
00047
00048 c = 0;
00049 for (i=0 ; i<numbits ; i++)
00050 if (bits[i>>3] & (1<<(i&7)) )
00051 c++;
00052
00053 return c;
00054 }
|
|
|
Definition at line 1303 of file visflow.c. References _printf(), AddSeperators(), passage_s::cansee, d, plane_t::dist, DotProduct, i, in, j, k, vportal_t::leaf, leaf_t, leafs, malloc(), MAX_SEPERATORS, memcpy(), memset(), n, passage_s::next, plane_t::normal, winding_t::numpoints, leaf_s::numportals, numportals, vportal_t::origin, p, passage_t, PassageChopWinding(), vportal_t::passages, winding_t::points, portalbytes, vportal_t::portalflood, leaf_s::portals, portals, qfalse, qtrue, vportal_t::radius, vportal_t::removed, sorted_portals, vportal_t::status, w, and vportal_t::winding. Referenced by CalcPassagePortalVis(), and CalcPassageVis(). 01304 {
01305 int i, j, k, n, numseperators, numsee;
01306 float d;
01307 vportal_t *portal, *p, *target;
01308 leaf_t *leaf;
01309 passage_t *passage, *lastpassage;
01310 plane_t seperators[MAX_SEPERATORS*2];
01311 winding_t *w;
01312 winding_t in, out, *res;
01313
01314 #ifdef MREDEBUG
01315 _printf("\r%6d", portalnum);
01316 #endif
01317
01318 portal = sorted_portals[portalnum];
01319
01320 if (portal->removed)
01321 {
01322 portal->status = stat_done;
01323 return;
01324 }
01325
01326 lastpassage = NULL;
01327 leaf = &leafs[portal->leaf];
01328 for (i = 0; i < leaf->numportals; i++)
01329 {
01330 target = leaf->portals[i];
01331 if (target->removed)
01332 continue;
01333
01334 passage = (passage_t *) malloc(sizeof(passage_t) + portalbytes);
01335 memset(passage, 0, sizeof(passage_t) + portalbytes);
01336 numseperators = AddSeperators(portal->winding, target->winding, qfalse, seperators, MAX_SEPERATORS*2);
01337 numseperators += AddSeperators(target->winding, portal->winding, qtrue, &seperators[numseperators], MAX_SEPERATORS*2-numseperators);
01338
01339 passage->next = NULL;
01340 if (lastpassage)
01341 lastpassage->next = passage;
01342 else
01343 portal->passages = passage;
01344 lastpassage = passage;
01345
01346 numsee = 0;
01347 //create the passage->cansee
01348 for (j = 0; j < numportals * 2; j++)
01349 {
01350 p = &portals[j];
01351 if (p->removed)
01352 continue;
01353 if ( ! (target->portalflood[j >> 3] & (1<<(j&7)) ) )
01354 continue;
01355 if ( ! (portal->portalflood[j >> 3] & (1<<(j&7)) ) )
01356 continue;
01357 for (k = 0; k < numseperators; k++)
01358 {
01359 //
01360 d = DotProduct (p->origin, seperators[k].normal) - seperators[k].dist;
01361 //if completely at the back of the seperator plane
01362 if (d < -p->radius + ON_EPSILON)
01363 break;
01364 w = p->winding;
01365 for (n = 0; n < w->numpoints; n++)
01366 {
01367 d = DotProduct (w->points[n], seperators[k].normal) - seperators[k].dist;
01368 //if at the front of the seperator
01369 if (d > ON_EPSILON)
01370 break;
01371 }
01372 //if no points are at the front of the seperator
01373 if (n >= w->numpoints)
01374 break;
01375 }
01376 if (k < numseperators)
01377 continue;
01378 memcpy(&in, p->winding, sizeof(winding_t));
01379 for (k = 0; k < numseperators; k++)
01380 {
01381 res = PassageChopWinding(&in, &out, &seperators[k]);
01382 if (res == &out)
01383 memcpy(&in, &out, sizeof(winding_t));
01384 if (res == NULL)
01385 break;
01386 }
01387 if (k < numseperators)
01388 continue;
01389 passage->cansee[j >> 3] |= (1<<(j&7));
01390 numsee++;
01391 }
01392 }
01393 }
|
Here is the call graph for this function:

|
Here is the call graph for this function:

|
|
|
|
|
Definition at line 91 of file vis.c. References Error(), malloc(), memset(), winding_t::points, points, and w. Referenced by LoadPortals(), and TryMergeWinding(). 00092 {
00093 winding_t *w;
00094 int size;
00095
00096 if (points > MAX_POINTS_ON_WINDING)
00097 Error ("NewWinding: %i points", points);
00098
00099 size = (int)((winding_t *)0)->points[points];
00100 w = malloc (size);
00101 memset (w, 0, size);
00102
00103 return w;
00104 }
|
Here is the call graph for this function:

|
|
Definition at line 751 of file visflow.c. References _printf(), data, i, memset(), p, vportal_t::plane, vportal_t::portalflood, RecursivePassageFlow(), vportal_t::removed, sorted_portals, vportal_t::status, and vportal_t::winding. Referenced by CalcPassageVis(). 00752 {
00753 threaddata_t data;
00754 int i;
00755 vportal_t *p;
00756 // int c_might, c_can;
00757
00758 #ifdef MREDEBUG
00759 _printf("\r%6d", portalnum);
00760 #endif
00761
00762 p = sorted_portals[portalnum];
00763
00764 if (p->removed)
00765 {
00766 p->status = stat_done;
00767 return;
00768 }
00769
00770 p->status = stat_working;
00771
00772 // c_might = CountBits (p->portalflood, numportals*2);
00773
00774 memset (&data, 0, sizeof(data));
00775 data.base = p;
00776
00777 data.pstack_head.portal = p;
00778 data.pstack_head.source = p->winding;
00779 data.pstack_head.portalplane = p->plane;
00780 data.pstack_head.depth = 0;
00781 for (i=0 ; i<portallongs ; i++)
00782 ((long *)data.pstack_head.mightsee)[i] = ((long *)p->portalflood)[i];
00783
00784 RecursivePassageFlow (p, &data, &data.pstack_head);
00785
00786 p->status = stat_done;
00787
00788 /*
00789 c_can = CountBits (p->portalvis, numportals*2);
00790
00791 qprintf ("portal:%4i mightsee:%4i cansee:%4i (%i chains)\n",
00792 (int)(p - portals), c_might, c_can, data.c_chains);
00793 */
00794 }
|
Here is the call graph for this function:

|
|
Definition at line 1014 of file visflow.c. References _printf(), data, i, memset(), p, vportal_t::plane, vportal_t::portalflood, RecursivePassagePortalFlow(), vportal_t::removed, sorted_portals, vportal_t::status, and vportal_t::winding. Referenced by CalcPassagePortalVis(). 01015 {
01016 threaddata_t data;
01017 int i;
01018 vportal_t *p;
01019 // int c_might, c_can;
01020
01021 #ifdef MREDEBUG
01022 _printf("\r%6d", portalnum);
01023 #endif
01024
01025 p = sorted_portals[portalnum];
01026
01027 if (p->removed)
01028 {
01029 p->status = stat_done;
01030 return;
01031 }
01032
01033 p->status = stat_working;
01034
01035 // c_might = CountBits (p->portalflood, numportals*2);
01036
01037 memset (&data, 0, sizeof(data));
01038 data.base = p;
01039
01040 data.pstack_head.portal = p;
01041 data.pstack_head.source = p->winding;
01042 data.pstack_head.portalplane = p->plane;
01043 data.pstack_head.depth = 0;
01044 for (i=0 ; i<portallongs ; i++)
01045 ((long *)data.pstack_head.mightsee)[i] = ((long *)p->portalflood)[i];
01046
01047 RecursivePassagePortalFlow (p, &data, &data.pstack_head);
01048
01049 p->status = stat_done;
01050
01051 /*
01052 c_can = CountBits (p->portalvis, numportals*2);
01053
01054 qprintf ("portal:%4i mightsee:%4i cansee:%4i (%i chains)\n",
01055 (int)(p - portals), c_might, c_can, data.c_chains);
01056 */
01057 }
|
Here is the call graph for this function:

|
|
Definition at line 624 of file visflow.c. References _printf(), CountBits(), data, i, vportal_t::leaf, memset(), numportals, p, vportal_t::plane, vportal_t::portalflood, portals, vportal_t::portalvis, qprintf(), RecursiveLeafFlow(), vportal_t::removed, sorted_portals, vportal_t::status, and vportal_t::winding. Referenced by CalcPortalVis(). 00625 {
00626 threaddata_t data;
00627 int i;
00628 vportal_t *p;
00629 int c_might, c_can;
00630
00631 #ifdef MREDEBUG
00632 _printf("\r%6d", portalnum);
00633 #endif
00634
00635 p = sorted_portals[portalnum];
00636
00637 if (p->removed)
00638 {
00639 p->status = stat_done;
00640 return;
00641 }
00642
00643 p->status = stat_working;
00644
00645 c_might = CountBits (p->portalflood, numportals*2);
00646
00647 memset (&data, 0, sizeof(data));
00648 data.base = p;
00649
00650 data.pstack_head.portal = p;
00651 data.pstack_head.source = p->winding;
00652 data.pstack_head.portalplane = p->plane;
00653 data.pstack_head.depth = 0;
00654 for (i=0 ; i<portallongs ; i++)
00655 ((long *)data.pstack_head.mightsee)[i] = ((long *)p->portalflood)[i];
00656
00657 RecursiveLeafFlow (p->leaf, &data, &data.pstack_head);
00658
00659 p->status = stat_done;
00660
00661 c_can = CountBits (p->portalvis, numportals*2);
00662
00663 qprintf ("portal:%4i mightsee:%4i cansee:%4i (%i chains)\n",
00664 (int)(p - portals), c_might, c_can, data.c_chains);
00665 }
|
Here is the call graph for this function:

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 50 of file vis.c. Referenced by CalcPHS(), ClusterMerge(), and LoadPortals(). |
|
|
Definition at line 51 of file vis.c. Referenced by LoadPortals(). |
|
|
|
|
|
|
|
|
Definition at line 53 of file vis.c. Referenced by BasePortalVis(), ClusterMerge(), CreatePassages(), LoadPortals(), RecursivePassageFlow(), and RecursivePassagePortalFlow(). |
|
|
|
|
|
Definition at line 53 of file vis.c. Referenced by LoadPortals(). |
|
|
|
|
|
Definition at line 66 of file vis.c. Referenced by CreatePassages(), PassageFlow(), PassageMemory(), PassagePortalFlow(), PortalFlow(), and SortPortals(). |
|
|
Definition at line 62 of file vis.c. Referenced by VisMain(). |
|
|
Referenced by CalcPHS(), and ClusterMerge(). |
|
|
|
|
|
|
|
|
|
1.3.9.1