Vector3D Class Reference

#include <Vector3D.h>


Detailed Description

This class contains all the stuff we need for a three dimensional vector.

Definition at line 15 of file Vector3D.h.


Public Member Functions

 Vector3D ()
 The constrcutor.
 Vector3D (float x, float y, float z)
 The constrcutor.
float operator[] (unsigned int i) const
 The index operator.
float & operator[] (unsigned int i)
 The index operator.
float x () const
 Returns the x value of the vector.
float y () const
 Returns the y value of the vector.
float z () const
 Returns the z value of the vector.
float & x ()
 Returns the x value of the vector.
float & y ()
 Returns the y value of the vector.
float & z ()
 Returns the z value of the vector.
Vector3Doperator= (const Vector3D &x)
 The assignment operator.
void SetMin (const Vector3D &x)
 Sets the values of this vector to the minimum of its value and x.
void SetMax (const Vector3D &x)
 Sets the values of this vector to the maximum of its value and x.
int MaxDim () const
Vector3D Abs ()
float Length ()
Vector3D Inverted ()
void Normalize ()
Vector3D Normalized ()
Vector3D operator- ()
Vector3D operator * (const float f)
Vector3Doperator *= (const float f)
Vector3D operator+ (const Vector3D &b)
Vector3Doperator+= (const Vector3D &b)
Vector3D operator- (const Vector3D &b)
Vector3Doperator-= (const Vector3D &b)

Private Attributes

float v [3]

Friends

float Dot (const Vector3D &a, const Vector3D &b)
Vector3D Cross (const Vector3D &a, const Vector3D &b)
Vector3D Product (const Vector3D &a, const Vector3D &b)
Vector3D operator * (float f, const Vector3D &w)

Constructor & Destructor Documentation

Vector3D::Vector3D (  )  [inline]

The constrcutor.

Definition at line 27 of file Vector3D.h.

References v.

Referenced by Abs(), Inverted(), Normalized(), operator *(), operator+(), and operator-().

Vector3D::Vector3D ( float  x,
float  y,
float  z 
) [inline]

The constrcutor.

Definition at line 35 of file Vector3D.h.

References v.


Member Function Documentation

float Vector3D::operator[] ( unsigned int  i  )  const [inline]

The index operator.

Definition at line 45 of file Vector3D.h.

References v.

float & Vector3D::operator[] ( unsigned int  i  )  [inline]

The index operator.

Definition at line 53 of file Vector3D.h.

References v.

float Vector3D::x (  )  const [inline]

Returns the x value of the vector.

Definition at line 61 of file Vector3D.h.

References v.

Referenced by DepthOfFieldCamera::InitRay(), CylindricCamera::InitRay(), Box::Intersect(), AABB::Intersect(), moveSphere(), KDTree::retrySplit(), rotateVec(), WoodShader::Shade(), MarbleShader::Shade(), and CloudShader::Shade().

float Vector3D::y (  )  const [inline]

Returns the y value of the vector.

Definition at line 69 of file Vector3D.h.

References v.

Referenced by DepthOfFieldCamera::InitRay(), CylindricCamera::InitRay(), Box::Intersect(), AABB::Intersect(), moveSphere(), KDTree::retrySplit(), rotateVec(), WoodShader::Shade(), MarbleShader::Shade(), and CloudShader::Shade().

float Vector3D::z (  )  const [inline]

Returns the z value of the vector.

Definition at line 77 of file Vector3D.h.

References v.

Referenced by DepthOfFieldCamera::InitRay(), CylindricCamera::InitRay(), Box::Intersect(), AABB::Intersect(), moveSphere(), KDTree::retrySplit(), rotateVec(), WoodShader::Shade(), MarbleShader::Shade(), and CloudShader::Shade().

float & Vector3D::x (  )  [inline]

Returns the x value of the vector.

Definition at line 85 of file Vector3D.h.

References v.

float & Vector3D::y (  )  [inline]

Returns the y value of the vector.

Definition at line 93 of file Vector3D.h.

References v.

float & Vector3D::z (  )  [inline]

Returns the z value of the vector.

Definition at line 101 of file Vector3D.h.

References v.

Vector3D & Vector3D::operator= ( const Vector3D x  )  [inline]

The assignment operator.

Definition at line 109 of file Vector3D.h.

References v.

void Vector3D::SetMin ( const Vector3D x  )  [inline]

Sets the values of this vector to the minimum of its value and x.

Definition at line 120 of file Vector3D.h.

References v.

Referenced by Box::Extend().

void Vector3D::SetMax ( const Vector3D x  )  [inline]

Sets the values of this vector to the maximum of its value and x.

Definition at line 130 of file Vector3D.h.

References v.

Referenced by Box::Extend().

int Vector3D::MaxDim (  )  const [inline]

Definition at line 136 of file Vector3D.h.

References v.

Vector3D Vector3D::Abs (  )  [inline]

Definition at line 140 of file Vector3D.h.

References v, and Vector3D().

Referenced by PlasmaShader::Shade(), and DebugShader::Shade().

float Vector3D::Length (  )  [inline]

Definition at line 144 of file Vector3D.h.

References Dot.

Referenced by QuadAreaLight::Illuminate(), PointLight::Illuminate(), Normalize(), Normalized(), QuadAreaLight::QuadAreaLight(), UniAxialCrystalShader::Shade(), TransparentShader::Shade(), SteelShader::Shade(), SilverShader::Shade(), GoldShader::Shade(), CopperShader::Shade(), and CenterMapShader::Shade().

Vector3D Vector3D::Inverted (  )  [inline]

Definition at line 148 of file Vector3D.h.

References v, and Vector3D().

Referenced by AABB::Intersect().

void Vector3D::Normalize (  )  [inline]

Definition at line 152 of file Vector3D.h.

References Length(), and v.

Referenced by QuadAreaLight::Illuminate(), PointLight::Illuminate(), InfinitePlane::InfinitePlane(), PerspectiveCamera::InitRay(), DepthOfFieldCamera::InitRay(), and QuadAreaLight::QuadAreaLight().

Vector3D Vector3D::Normalized (  )  [inline]

Definition at line 159 of file Vector3D.h.

References Length(), v, and Vector3D().

Referenced by DepthOfFieldCamera::DepthOfFieldCamera(), Triangle::GetNormal(), Sphere::GetNormal(), SmoothTriangle::GetNormal(), CylindricCamera::InitRay(), PerspectiveCamera::PerspectiveCamera(), BumpMappedWoodPhongShader::Shade(), BumpMappedPhongShader::Shade(), BumpMappedMarblePhongShader::Shade(), and BumpMappedDebugShader::Shade().

Vector3D Vector3D::operator- (  )  [inline]

Definition at line 164 of file Vector3D.h.

References v, and Vector3D().

Vector3D Vector3D::operator * ( const float  f  )  [inline]

Definition at line 168 of file Vector3D.h.

References v, and Vector3D().

Vector3D& Vector3D::operator *= ( const float  f  )  [inline]

Definition at line 172 of file Vector3D.h.

References v.

Vector3D Vector3D::operator+ ( const Vector3D b  )  [inline]

Definition at line 178 of file Vector3D.h.

References v, and Vector3D().

Vector3D& Vector3D::operator+= ( const Vector3D b  )  [inline]

Definition at line 182 of file Vector3D.h.

References v.

Vector3D Vector3D::operator- ( const Vector3D b  )  [inline]

Definition at line 189 of file Vector3D.h.

References v, and Vector3D().

Vector3D& Vector3D::operator-= ( const Vector3D b  )  [inline]

Definition at line 193 of file Vector3D.h.

References v.


Friends And Related Function Documentation

float Dot ( const Vector3D a,
const Vector3D b 
) [friend]

dot product

Definition at line 205 of file Vector3D.h.

Referenced by Length().

Vector3D Cross ( const Vector3D a,
const Vector3D b 
) [friend]

vector product

Definition at line 215 of file Vector3D.h.

Vector3D Product ( const Vector3D a,
const Vector3D b 
) [friend]

component-wise product

Definition at line 210 of file Vector3D.h.

Vector3D operator * ( float  f,
const Vector3D w 
) [friend]

scale vector

Definition at line 222 of file Vector3D.h.


Field Documentation

float Vector3D::v[3] [private]

Definition at line 201 of file Vector3D.h.

Referenced by Abs(), Inverted(), MaxDim(), Normalize(), Normalized(), operator *(), operator *=(), operator+(), operator+=(), operator-(), operator-=(), operator=(), operator[](), SetMax(), SetMin(), Vector3D(), x(), y(), and z().


The documentation for this class was generated from the following file:
Generated on Thu Jan 31 21:49:00 2008 for RayTracer by  doxygen 1.5.4