working on Scene::process*() functions to load the scene from a file

git-svn-id: svn://anubis/fart/trunk@164 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
Josh Holtrop committed 2009-02-28 19:59:22 +00:00
1 parent 1924bea5cf
commit 0462a2e7bc
6 files changed
+167 -49

No files matched your search

+7
View File
@@ -29,6 +29,13 @@ Color::Color(const Vector & v)
b = v[2];
}
Color::Color(refptr<Vector> v)
{
r = (*v)[0];
g = (*v)[1];
b = (*v)[2];
}
Color Color::operator*(const Color & other) const
{
Color result;
+2
View File
@@ -2,6 +2,7 @@
#ifndef COLOR_H
#define COLOR_H COLOR_H
#include "refptr.h"
#include <iostream>
#include "util/Vector.h"
@@ -13,6 +14,7 @@ class Color
Color();
Color(double r, double g, double b);
Color(const Vector & v);
Color(refptr<Vector> v);
Color operator*(const Color & other) const;
Color operator*(double scale) const;
+13
View File
@@ -2,6 +2,7 @@
#ifndef TRANSFORM_H
#define TRANSFORM_H TRANSFORM_H
#include "refptr.h"
#include "Matrix.h"
#include "Ray.h"
#include "Vector.h"
@@ -16,8 +17,20 @@ class Transform
const Vector & focus,
const Vector & up);
void translate(double x, double y, double z);
void translate(refptr<Vector> vec)
{
translate((*vec)[0], (*vec)[1], (*vec)[2]);
}
void rotate(double angle, double xv, double yv, double zv);
void rotate(double angle, refptr<Vector> vec)
{
rotate(angle, (*vec)[0], (*vec)[1], (*vec)[2]);
}
void scale(double xs, double ys, double zs);
void scale(refptr<Vector> vec)
{
scale((*vec)[0], (*vec)[1], (*vec)[2]);
}
Matrix & getMatrix() { return m_matrix; }
Vector transform_point(const Vector & v);
Vector transform_direction(const Vector & v);