示例#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]);
    }
}
示例#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];
    }
}
示例#3
0
文件: Frustum.cpp 项目: obhi-d/nextar
void Frustum::ConstructFrom(Mat4x4F combo) {
    // Left clipping planeT
    planes[PLANE_LEFT] = PlaneNormalize(
                             Vec4ANegate(Vec4AAdd(Mat4x4Row(combo, 0), Mat4x4Row(combo, 3))));
    // Right clipping planeT
    planes[PLANE_RIGHT] = PlaneNormalize(
                              Vec4ASub(Mat4x4Row(combo, 0), Mat4x4Row(combo, 3)));
    // Top clipping planeT
    planes[PLANE_TOP] = PlaneNormalize(
                            Vec4ASub(Mat4x4Row(combo, 1), Mat4x4Row(combo, 3)));
    // Bottom clipping planeT
    planes[PLANE_BOTTOM] = PlaneNormalize(
                               Vec4ANegate(Vec4AAdd(Mat4x4Row(combo, 1), Mat4x4Row(combo, 3))));
    // Near clipping planeT
    planes[PLANE_NEAR] = PlaneNormalize(Vec4ANegate(Mat4x4Row(combo, 2)));
    // Far clipping planeT
    planes[PLANE_FAR] = PlaneNormalize(
                            Vec4ASub(Mat4x4Row(combo, 2), Mat4x4Row(combo, 3)));
}