Example #1
0
static inline void _BrushTransormPlanes(ConvexPolyhedron *pBrush, Matrix *pMtx)
{
    //go through the sides
    for(s32 i = 0; i < pBrush->numPlane; i++)
    {
        PlaneTransform(pMtx, &pBrush->planes[i], &pBrush->tPlanes[i]);
        PlaneNormalize(&pBrush->tPlanes[i], &pBrush->tPlanes[i]);
    }
}
Example #2
0
//transform the plane model space
static inline void _BrushRawTransormPlanes(ConvexPolyhedron *pBrush, Matrix *pMtx)
{
    //go through the sides
    for(int i = 0; i < pBrush->numPlane; i++)
    {
        pBrush->planes[i].d *= -1; //convert d's sign, for some reason, PlaneTransform doesn't
        //like id software's plane format...
        PlaneTransform(pMtx, &pBrush->planes[i], &pBrush->planes[i]);
        PlaneNormalize(&pBrush->planes[i], &pBrush->planes[i]);

        pBrush->tPlanes[i] = pBrush->planes[i];
    }
}
Example #3
0
static void ddRenderPlanes(const mat4& projview)
{
	const ShaderInfo* shader = g_dbgdrawShader.get();
	GLint mvpLoc = shader->m_uniforms[BIND_Mvp];
	glUniformMatrix4fv(mvpLoc, 1, 0, projview.m);

	const ddPlane* cur = g_lists.m_planes;
	while(cur)
	{
		Plane plane = PlaneTransform(cur->m_xfm, cur->m_plane);
		ddDrawPlane(plane, cur->m_bounds, cur->m_color);
		cur = cur->m_next;
	}
}