30 lines
716 B
C++
30 lines
716 B
C++
|
|
#ifndef TRANSFORM_H
|
|
#define TRANSFORM_H TRANSFORM_H
|
|
|
|
#include "Matrix.h"
|
|
#include "Ray.h"
|
|
#include "Vector.h"
|
|
#include <stack>
|
|
|
|
class Transform
|
|
{
|
|
public:
|
|
Transform();
|
|
void translate(double x, double y, double z);
|
|
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);
|
|
Vector transform_normal(Transform & t, const Vector & v);
|
|
Ray transform_ray(Transform & t, const Ray & r);
|
|
|
|
protected:
|
|
Matrix m_matrix;
|
|
};
|
|
|
|
|
|
#endif
|
|
|