#include <Vector.hh>


With the help of this class one can define a vector in 3D environment, add it or substract from another vector, calculate their dot or cross product. Vectors can be also normalized and transformed with transformation matrices.
Definition at line 34 of file Vector.hh.
Public Types | |
| enum | { X, Y, Z } |
Public Member Functions | |
| Vector (Double x, Double y, Double z) | |
| Vector () | |
| Vector (const Tuple< Double, false, 3 > &T) | |
| void | Set (Double x, Double y, Double z) |
| void | Transform (const Matrix &M) |
| Vector | operator* (const Matrix &M) const |
| Vector | Cross (const Vector &M) const |
| Double | Dot (const Vector &M) const |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const Vector &V) |
| Math::Vector::Vector | ( | Double | x, | |
| Double | y, | |||
| Double | z | |||
| ) | [inline] |
Initialize vector with given parameters
Definition at line 38 of file Vector.hh.
References Math::Tuple< Double, false, 3 >::D.
| Math::Vector::Vector | ( | ) | [inline] |
Default vector constructor (initialize with zeroes)
Definition at line 45 of file Vector.hh.
References Math::Tuple< Double, false, 3 >::D.
Referenced by Cross().

| Math::Vector::Vector | ( | const Tuple< Double, false, 3 > & | T | ) | [inline] |
Create vector back from Tuple after calculations
Definition at line 50 of file Vector.hh.
References Math::Tuple< Double, false, 3 >::D.
| void Math::Vector::Set | ( | Double | x, | |
| Double | y, | |||
| Double | z | |||
| ) | [inline] |
Set all vector coordinates at once
Definition at line 60 of file Vector.hh.
References Math::Tuple< Double, false, 3 >::D.
Referenced by World::Camera::Camera().

| void Math::Vector::Transform | ( | const Matrix & | M | ) |
Transforms vector in place by a specified transformation matrix
Definition at line 35 of file Vector.cc.
References Math::Tuple< Double, false, 3 >::D.
Referenced by operator*().

Returns vector transformed by matrix M.
Definition at line 67 of file Vector.cc.
References Transform().

Definition at line 74 of file Vector.cc.
References Math::Tuple< T, DoCropping, Count >::D, Math::Tuple< Double, false, 3 >::D, and Vector().
Referenced by World::Camera::CreateView(), and Testcases::Math().


| Double Math::Vector::Dot | ( | const Vector & | M | ) | const [inline] |
Definition at line 86 of file Vector.hh.
References Math::Tuple< T, DoCropping, Count >::D, and Math::Tuple< Double, false, 3 >::D.
Referenced by World::Sphere::Collide(), World::Plane::Collide(), Testcases::Math(), Render::Ray::Reflect(), Render::Ray::Refract(), and Render::Raytracer::TraceLights().

| std::ostream& operator<< | ( | std::ostream & | os, | |
| const Vector & | V | |||
| ) | [friend] |
1.5.5