Example #1
0
Ray CoordinateFrame::toObjectSpace(const Ray& r) const
{
	Ray ray;
	ray.setOrigin(pointToObjectSpace(r.getOrigin()));
	ray.setDirection(vectorToObjectSpace(r.getDirection()));
	return ray;
}
Example #2
0
void CoordinateFrame::pointToObjectSpace(const Array<Vector3>& v, Array<Vector3>& vout) const {
    vout.resize(v.size());

    for (int i = v.size() - 1; i >= 0; --i) {
        vout[i] = pointToObjectSpace(v[i]);
    }
}
Example #3
0
Plane CoordinateFrame::toObjectSpace(const Plane& p) const {
    Vector3 N, P;
    double d;
    p.getEquation(N, d);
    P = N * (float)d;
    P = pointToObjectSpace(P);
    N = normalToObjectSpace(N);
    return Plane(N, P);
}
Example #4
0
Plane CoordinateFrame::toObjectSpace(const Plane& p) const {
    // TODO
    Vector3 N, P;
    double d;
    p.getEquation(N, d);
    P = N * (float)d;
    P = pointToObjectSpace(P);
    N = normalToObjectSpace(N);
    debugAssertM(isFinite(d), "Not implemented for infinite planes");
    return Plane(N, P);
}
Example #5
0
Ray CoordinateFrame::toObjectSpace(const Ray& r) const {
    return Ray::fromOriginAndDirection(pointToObjectSpace(r.origin()), vectorToObjectSpace(r.direction()));
}
Example #6
0
Sphere CoordinateFrame::toObjectSpace(const Sphere &b) const {
    return Sphere(pointToObjectSpace(b.center), b.radius);
}
Example #7
0
Triangle CoordinateFrame::toObjectSpace(const Triangle& t) const {
    return Triangle(pointToObjectSpace(t.vertex(0)),
        pointToObjectSpace(t.vertex(1)),
        pointToObjectSpace(t.vertex(2)));
}