Math::Vector Class Reference

#include <Vector.hh>

Inheritance diagram for Math::Vector:

Inheritance graph
[legend]
Collaboration diagram for Math::Vector:

Collaboration graph
[legend]

List of all members.


Detailed Description

Class which holds point-related information.

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)

Constructor & Destructor Documentation

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().

Here is the caller graph for this function:

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.


Member Function Documentation

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().

Here is the caller graph for this function:

void Math::Vector::Transform ( const Matrix M  ) 

Transforms vector in place by a specified transformation matrix

See also:
Vector::operator*(const Matrix &M)

Definition at line 35 of file Vector.cc.

References Math::Tuple< Double, false, 3 >::D.

Referenced by operator*().

Here is the caller graph for this function:

Vector Math::Vector::operator* ( const Matrix M  )  const

Returns vector transformed by matrix M.

See also:
Transform()

Definition at line 67 of file Vector.cc.

References Transform().

Here is the call graph for this function:

Vector Math::Vector::Cross ( const Vector M  )  const

Returns:
New vector which is a cross product of this, and specified vector.

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().

Here is the call graph for this function:

Here is the caller graph for this function:

Double Math::Vector::Dot ( const Vector M  )  const [inline]

Returns:
Double which is equal a dot product of this, and specified vector.

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().

Here is the caller graph for this function:


Friends And Related Function Documentation

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

Pretty-printer

Definition at line 25 of file Vector.cc.


The documentation for this class was generated from the following files:

Generated on Wed Mar 12 00:35:44 2008 for blaRAY by  doxygen 1.5.5