Exemplo n.º 1
0
void CoordinateFrame::pointToWorldSpace(const Array<Vector3>& v, Array<Vector3>& vout) const {
    vout.resize(v.size());

    for (int i = 0; i < v.size(); ++i) {
        vout[i] = pointToWorldSpace(v[i]);
    }
}
Exemplo n.º 2
0
Ray CoordinateFrame::toWorldSpace(const Ray& r) const 
{
	Ray ray;
	ray.setOrigin(pointToWorldSpace(r.getOrigin()));
	ray.setDirection(vectorToWorldSpace(r.getDirection()));
	return ray;
}
Exemplo n.º 3
0
Box CoordinateFrame::toWorldSpace(const Box& b) const {
    Box out(b);

    for (int i = 0; i < 8; ++i) {
        out._corner[i] = pointToWorldSpace(b._corner[i]);
        debugAssert(! isNaN(out._corner[i].x));
    }

    for (int i = 0; i < 3; ++i) {
        out._axis[i] = vectorToWorldSpace(b._axis[i]);
    }

    out._center = pointToWorldSpace(b._center);

    return out;
}
Exemplo n.º 4
0
Plane CoordinateFrame::toWorldSpace(const Plane& p) const {
    Vector3 N, P;
    double d;
    p.getEquation(N, d);
    P = N * (float)d;
    P = pointToWorldSpace(P);
    N = normalToWorldSpace(N);
    return Plane(N, P);
}
Exemplo n.º 5
0
Box CoordinateFrame::toWorldSpace(const Box& b) const {
    if(!b.isFinite()) {
        return b;
    }
    Box out(b);
    out._center = pointToWorldSpace(b._center);
    for (int i = 0; i < 3; ++i) {
        out._edgeVector[i] = vectorToWorldSpace(out._edgeVector[i]);
    }

    out._area   = b._area;
    out._volume = b._volume;

    return out;
}
Exemplo n.º 6
0
Ray CoordinateFrame::toWorldSpace(const Ray& r) const {
    return Ray::fromOriginAndDirection(pointToWorldSpace(r.origin()), vectorToWorldSpace(r.direction()));
}
Exemplo n.º 7
0
Sphere CoordinateFrame::toWorldSpace(const Sphere &b) const {
    return Sphere(pointToWorldSpace(b.center), b.radius);
}
Exemplo n.º 8
0
Capsule CoordinateFrame::toWorldSpace(const Capsule& c) const {
    return Capsule(
        pointToWorldSpace(c.point(0)),
        pointToWorldSpace(c.point(1)),
        c.radius());
}
Exemplo n.º 9
0
Cylinder CoordinateFrame::toWorldSpace(const Cylinder& c) const {
    return Cylinder(
        pointToWorldSpace(c.point(0)),
        pointToWorldSpace(c.point(1)),
        c.radius());
}
Exemplo n.º 10
0
Triangle CoordinateFrame::toWorldSpace(const Triangle& t) const {
    return Triangle(pointToWorldSpace(t.vertex(0)),
        pointToWorldSpace(t.vertex(1)),
        pointToWorldSpace(t.vertex(2)));
}