这篇教程C++ BaseWindingForPlane函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中BaseWindingForPlane函数的典型用法代码示例。如果您正苦于以下问题:C++ BaseWindingForPlane函数的具体用法?C++ BaseWindingForPlane怎么用?C++ BaseWindingForPlane使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了BaseWindingForPlane函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: MakeBrushWindings/* ================ MakeBrushWindings makes basewindigs for sides and mins / maxs for the brush ================ */qboolean MakeBrushWindings( mapbrush_t *ob ){ int i, j; winding_t *w; side_t *side; plane_t *plane; ClearBounds( ob->mins, ob->maxs ); for ( i = 0 ; i < ob->numsides ; i++ ) { plane = &mapplanes[ob->original_sides[i].planenum]; w = BaseWindingForPlane( plane->normal, plane->dist ); for ( j = 0 ; j < ob->numsides && w; j++ ) { if ( i == j ) { continue; } if ( ob->original_sides[j].bevel ) { continue; } plane = &mapplanes[ob->original_sides[j].planenum ^ 1]; ChopWindingInPlace( &w, plane->normal, plane->dist, 0 ); //CLIP_EPSILON); } side = &ob->original_sides[i]; side->winding = w; if ( w ) { side->visible = true; for ( j = 0 ; j < w->numpoints ; j++ ) AddPointToBounds( w->p[j], ob->mins, ob->maxs ); } } for ( i = 0 ; i < 3 ; i++ ) { if ( ob->mins[0] < -4096 || ob->maxs[0] > 4096 ) { Sys_Printf( "entity %i, brush %i: bounds out of range/n", ob->entitynum, ob->brushnum ); } if ( ob->mins[0] > 4096 || ob->maxs[0] < -4096 ) { Sys_Printf( "entity %i, brush %i: no visible sides on brush/n", ob->entitynum, ob->brushnum ); } } return true;}
开发者ID:Barbatos,项目名称:GtkRadiant,代码行数:52,
示例2: TestExpandBrushes/*================TestExpandBrushesExpands all the brush planes and saves a new map out================*/void TestExpandBrushes (void){ FILE *f; side_t *s; int i, j, bn; winding_t *w; char *name = "expanded.map"; mapbrush_t *brush; vec_t dist; printf ("writing %s/n", name); f = fopen (name, "wb"); if (!f) Error ("Can't write %s/b", name); fprintf (f, "{/n/"classname/" /"worldspawn/"/n"); for (bn=0 ; bn<nummapbrushes ; bn++) { brush = &mapbrushes[bn]; fprintf (f, "{/n"); for (i=0 ; i<brush->numsides ; i++) { s = brush->original_sides + i; dist = mapplanes[s->planenum].dist; for (j=0 ; j<3 ; j++) dist += fabs( 16 * mapplanes[s->planenum].normal[j] ); w = BaseWindingForPlane (mapplanes[s->planenum].normal, dist); fprintf (f,"( %i %i %i ) ", (int)w->p[0][0], (int)w->p[0][1], (int)w->p[0][2]); fprintf (f,"( %i %i %i ) ", (int)w->p[1][0], (int)w->p[1][1], (int)w->p[1][2]); fprintf (f,"( %i %i %i ) ", (int)w->p[2][0], (int)w->p[2][1], (int)w->p[2][2]); fprintf (f, "%s 0 0 0 1 1/n", texinfo[s->texinfo].texture); FreeWinding (w); } fprintf (f, "}/n"); } fprintf (f, "}/n"); fclose (f); Error ("can't proceed after expanding brushes");}
开发者ID:MyLittleRobo,项目名称:Quake-2-Tools,代码行数:52,
示例3: CM_ValidateFacet/*==================CM_ValidateFacetIf the facet isn't bounded by its borders, we screwed up.==================*/static qboolean CM_ValidateFacet( facet_t *facet ) { float plane[4]; int j; winding_t *w; vec3_t bounds[2]; if ( facet->surfacePlane == -1 ) { return qfalse; } Vector4Copy( planes[ facet->surfacePlane ].plane, plane ); w = BaseWindingForPlane( plane, plane[3] ); for ( j = 0 ; j < facet->numBorders && w ; j++ ) { if ( facet->borderPlanes[j] == -1 ) { return qfalse; } Vector4Copy( planes[ facet->borderPlanes[j] ].plane, plane ); if ( !facet->borderInward[j] ) { VectorSubtract( vec3_origin, plane, plane ); plane[3] = -plane[3]; } ChopWindingInPlace( &w, plane, plane[3], 0.1f ); } if ( !w ) { return qfalse; // winding was completely chopped away } // see if the facet is unreasonably large WindingBounds( w, bounds[0], bounds[1] ); FreeWinding( w ); for ( j = 0 ; j < 3 ; j++ ) { if ( bounds[1][j] - bounds[0][j] > MAX_MAP_BOUNDS ) { return qfalse; // we must be missing a plane } if ( bounds[0][j] >= MAX_MAP_BOUNDS ) { return qfalse; } if ( bounds[1][j] <= -MAX_MAP_BOUNDS ) { return qfalse; } } return qtrue; // winding is fine}
开发者ID:entdark,项目名称:q3mme,代码行数:52,
示例4: MakeNodePortal/*==================MakeNodePortalcreate the new portal by taking the full plane winding for the cutting planeand clipping it by all of the planes from the other portals.Each portal tracks the node that created it, so unused nodescan be removed later.==================*/void MakeNodePortal (node_t *node){ portal_t *new_portal, *p; dplane_t *plane; dplane_t clipplane; winding_t *w; int side; plane = &dplanes[node->planenum]; w = BaseWindingForPlane (plane); new_portal = AllocPortal (); new_portal->plane = *plane; new_portal->onnode = node; side = 0; // shut up compiler warning for (p = node->portals ; p ; p = p->next[side]) { clipplane = p->plane; if (p->nodes[0] == node) side = 0; else if (p->nodes[1] == node) { clipplane.dist = -clipplane.dist; VectorSubtract (vec3_origin, clipplane.normal, clipplane.normal); side = 1; } else Error ("MakeNodePortal: mislinked portal"); w = ClipWinding (w, &clipplane, true); if (!w) { printf ("WARNING: MakeNodePortal:new portal was clipped away from [email C++ Basename函数代码示例 C++ BaseType函数代码示例
|