Ejemplo n.º 1
0
Frustum CoordinateFrame::toWorldSpace(const Frustum& f) const {
    Frustum g;
    g.vertexPos.resize(f.vertexPos.size());
    g.faceArray.resize(f.faceArray.size());

    for (int i = 0; i < f.vertexPos.size(); ++i) {
        g.vertexPos[i] = toWorldSpace(f.vertexPos[i]);
    }
    for (int i = 0; i < f.faceArray.size(); ++i) {
        g.faceArray[i].plane = toWorldSpace(f.faceArray[i].plane);
        for (int j = 0; j < 4; ++j) {
            g.faceArray[i].vertexIndex[j] = f.faceArray[i].vertexIndex[j];
        }
    }

    return g;
}
Ejemplo n.º 2
0
void CoordinateFrame::toWorldSpace(const AABox& b, AABox& result) const {
    if (b.isEmpty()) {
        result = b;
    } else if (! b.isFinite()) {
        // We can't combine infinite elements under a matrix
        // multiplication: if the computation performs inf-inf we'll
        // get NaN.  So treat the box as infinite in all directions.
        result = AABox::inf();
    } else {
        toWorldSpace(Box(b)).getBounds(result);
    }
}
Ejemplo n.º 3
0
Box CoordinateFrame::toWorldSpace(const AABox& b) const {
    Box b2(b);
    return toWorldSpace(b2);
}
Ejemplo n.º 4
0
frustum::frustum(const glm::mat4& projectionMatrix, const glm::mat4& viewMatrix) :
	sidesWorld()
{
	toWorldSpace(projectionMatrix, viewMatrix);
}
Ejemplo n.º 5
0
Box CoordinateFrame::toWorldSpace(const AABox& b) const {
    return toWorldSpace(Box(b));
}