clray

diff src/vector.cc @ 54:6a30f27fa1e6

separated the OpenGL visualization and added a CPU raytracing mode
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 10 Sep 2010 16:47:00 +0100
parents 51f115e337c2
children
line diff
     1.1 --- a/src/vector.cc	Sun Sep 05 16:43:55 2010 +0100
     1.2 +++ b/src/vector.cc	Fri Sep 10 16:47:00 2010 +0100
     1.3 @@ -18,6 +18,13 @@
     1.4  	this->z = z;
     1.5  }
     1.6  
     1.7 +Vector3::Vector3(const float *arr)
     1.8 +{
     1.9 +	x = arr[0];
    1.10 +	y = arr[1];
    1.11 +	z = arr[2];
    1.12 +}
    1.13 +
    1.14  void Vector3::normalize()
    1.15  {
    1.16  	float len = sqrt(x * x + y * y + z * z);