renamed transformation operations in util/Transform for clarity
git-svn-id: svn://anubis/fart/trunk@32 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
parent
277252ef77
commit
63d56c5e43
@ -54,17 +54,17 @@ void Transform::scale(double xs, double ys, double zs)
|
||||
m_matrix *= t;
|
||||
}
|
||||
|
||||
Vector operator*(Transform & t, const Vector & v)
|
||||
Vector Transform::transform_point(Transform & t, const Vector & v)
|
||||
{
|
||||
return t.getMatrix() * v;
|
||||
}
|
||||
|
||||
Vector operator%(Transform & t, const Vector & v)
|
||||
Vector Transform::transform_direction(Transform & t, const Vector & v)
|
||||
{
|
||||
return t.getMatrix() % v;
|
||||
}
|
||||
|
||||
Ray operator*(Transform & t, const Ray & r)
|
||||
Ray Transform::transform_ray(Transform & t, const Ray & r)
|
||||
{
|
||||
Vector newPosition = t.getMatrix() * r.getOrigin();
|
||||
Vector newDirection = t.getMatrix() % r.getDirection();
|
||||
|
@ -15,14 +15,14 @@ class Transform
|
||||
void rotate(double angle, double xv, double yv, double zv);
|
||||
void scale(double xs, double ys, double zs);
|
||||
Matrix & getMatrix() { return m_matrix; }
|
||||
Vector transform_point(Transform & t, const Vector & v);
|
||||
Vector transform_direction(Transform & t, const Vector & v);
|
||||
Ray transform_ray(Transform & t, const Ray & r);
|
||||
|
||||
protected:
|
||||
Matrix m_matrix;
|
||||
};
|
||||
|
||||
Vector operator*(Transform & t, const Vector & v);
|
||||
Vector operator%(Transform & t, const Vector & v);
|
||||
Ray operator*(Transform & t, const Ray & r);
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user