-static colpointf_t polyf_pointsstart[256], polyf_pointsend[256];
-static colplanef_t polyf_planesstart[256 + 2], polyf_planesend[256 + 2];
-static colbrushf_t polyf_brushstart, polyf_brushend;
-
-void Collision_TraceBrushPolygonTransformFloat(trace_t *trace, const colbrushf_t *thisbrush_start, const colbrushf_t *thisbrush_end, int numpoints, const float *points, const matrix4x4_t *polygonmatrixstart, const matrix4x4_t *polygonmatrixend, int supercontents, int q3surfaceflags, texture_t *texture)
-{
- int i;
- if (numpoints > 256)
- {
- Con_Print("Polygon with more than 256 points not supported yet (fixme!)\n");
- return;
- }
- polyf_brushstart.numpoints = numpoints;
- polyf_brushstart.numedgedirs = numpoints;
- polyf_brushstart.numplanes = numpoints + 2;
- polyf_brushstart.points = polyf_pointsstart;//(colpointf_t *)points;
- polyf_brushstart.planes = polyf_planesstart;
- polyf_brushstart.supercontents = supercontents;
- polyf_brushstart.q3surfaceflags = q3surfaceflags;
- polyf_brushstart.texture = texture;
- for (i = 0;i < numpoints;i++)
- Matrix4x4_Transform(polygonmatrixstart, points + i * 3, polyf_brushstart.points[i].v);
- polyf_brushend.numpoints = numpoints;
- polyf_brushend.numedgedirs = numpoints;
- polyf_brushend.numplanes = numpoints + 2;
- polyf_brushend.points = polyf_pointsend;//(colpointf_t *)points;
- polyf_brushend.planes = polyf_planesend;
- polyf_brushend.supercontents = supercontents;
- polyf_brushend.q3surfaceflags = q3surfaceflags;
- polyf_brushend.texture = texture;
- for (i = 0;i < numpoints;i++)
- Matrix4x4_Transform(polygonmatrixend, points + i * 3, polyf_brushend.points[i].v);
- for (i = 0;i < polyf_brushstart.numplanes;i++)
- {
- polyf_brushstart.planes[i].q3surfaceflags = q3surfaceflags;
- polyf_brushstart.planes[i].texture = texture;
- }
- Collision_SnapCopyPoints(polyf_brushstart.numpoints, polyf_pointsstart, polyf_pointsstart, COLLISION_SNAPSCALE, COLLISION_SNAP);
- Collision_SnapCopyPoints(polyf_brushend.numpoints, polyf_pointsend, polyf_pointsend, COLLISION_SNAPSCALE, COLLISION_SNAP);
- Collision_CalcEdgeDirsForPolygonBrushFloat(&polyf_brushstart);
- Collision_CalcEdgeDirsForPolygonBrushFloat(&polyf_brushend);
- Collision_CalcPlanesForPolygonBrushFloat(&polyf_brushstart);
- Collision_CalcPlanesForPolygonBrushFloat(&polyf_brushend);
-
- //Collision_PrintBrushAsQHull(&polyf_brushstart, "polyf_brushstart");
- //Collision_PrintBrushAsQHull(&polyf_brushend, "polyf_brushend");
-
- Collision_TraceBrushBrushFloat(trace, thisbrush_start, thisbrush_end, &polyf_brushstart, &polyf_brushend);
-}
-
-
-