Al's Programming Resource Homepage  Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

VECTOR Class Reference

#include <vector.h>

List of all members.

Public Methods

 VECTOR (float sx=0.0, float sy=0.0, float sz=0.0)
 ~VECTOR ()
void Reset ()
void Set (float sx, float sy, float sz)
void CrossVector (VECTOR vect)
float DotProduct (VECTOR vect)
float GetMagnitude ()
void Normalize ()

Public Attributes

float x
float y
float z


Constructor & Destructor Documentation

VECTOR::VECTOR float    sx = 0.0,
float    sy = 0.0,
float    sz = 0.0
 

Definition at line 6 of file vector.cpp.

00007 :
00008     x(sx),
00009     y(sy),
00010     z(sz)
00011 {
00012 }

VECTOR::~VECTOR  
 

Definition at line 14 of file vector.cpp.

00015 {
00016 }


Member Function Documentation

void VECTOR::CrossVector VECTOR    vect
 

Definition at line 32 of file vector.cpp.

References x, y, and z.

Referenced by QUAT::MultQuat().

00033 {
00034       VECTOR temp = *this;
00035       x = vect.y * temp.z - vect.z * temp.y;
00036       y = vect.z * temp.x - vect.x * temp.z;
00037       z = vect.x * temp.y - vect.y * temp.x;
00038 }

float VECTOR::DotProduct VECTOR    vect
 

Definition at line 25 of file vector.cpp.

References x, y, and z.

Referenced by QUAT::MultQuat().

00026 {
00027       float dot;
00028       dot = vect.x * x + vect.y * y + vect.z * z;
00029       return dot;
00030 }

float VECTOR::GetMagnitude  
 

Definition at line 40 of file vector.cpp.

References x, y, and z.

Referenced by CreateLightmaps(), and Normalize().

00041 {
00042     float magnitude = (float)sqrt(x * x + y * y + z * z);
00043     if (magnitude != 0.0f)
00044         return magnitude;
00045     else
00046         return 1.0;
00047 }

void VECTOR::Normalize  
 

Definition at line 49 of file vector.cpp.

References GetMagnitude(), x, y, and z.

Referenced by CreateLargePortal(), CreateLightmaps(), DrawFire(), and DrawHalo().

00050 {
00051     float magnitude = this->GetMagnitude();
00052     x /= magnitude;
00053     y /= magnitude;
00054     z /= magnitude;
00055 }

void VECTOR::Reset  
 

Definition at line 18 of file vector.cpp.

References x, y, and z.

Referenced by OBJECT::Reset(), and CAMERA::Reset().

00019 {
00020     x = 0;
00021     y = 0;
00022     z = 0;
00023 }

void VECTOR::Set float    sx,
float    sy,
float    sz
[inline]
 

Definition at line 13 of file vector.h.

References x, y, and z.

Referenced by LIGHT::Reset().

00013 {x = sx, y = sy, z = sz;}


Member Data Documentation

float VECTOR::x
 

Definition at line 19 of file vector.h.

Referenced by AddSpline(), LIGHT::Apply(), CAMERA::Apply(), AxisAngleToMatrix(), QUAT::AxisAngleToQuat(), bspline(), bsplinepoint(), CalculatePVS(), CheckClipPlanes(), CheckForCollision(), CheckPointInSphere(), CheckPointInTriangle(), ClassifyInvertedPortal(), ClassifyPoint(), ClassifyPortal(), ClosestPointOnLine(), ClosestPointOnPolygon(), compute_point(), CreateLargePortal(), CreateLightmaps(), CrossVector(), CrossVector(), DotProduct(), DotProduct(), DrawFire(), DrawGLScene(), DrawHalo(), DrawIntersectionSphere(), DrawSplines(), FindCurrentLeaf(), FindVisibleLeaves(), GetEdgeIntersection(), GetEdgeVector(), GetMagnitude(), PORTAL::GetNormal(), POLYGON::GetNormal(), GetUnitVector(), OBJECT::GetXUnit(), OBJECT::GetYUnit(), OBJECT::GetZUnit(), IntersectRaySphere(), InvertPortals(), IsZeroVector(), LoadSplines(), MagnitudeVector(), MATRIX::MatrixFromAxisAngle(), OBJECT::MoveX(), OBJECT::MoveY(), OBJECT::MoveZ(), QUAT::MultQuat(), MultQuat(), Normalize(), PointInFrustum(), RenderBSP(), Reset(), LIGHT::Reset(), Set(), SetLength(), SetStaticLights(), SphereInFrustum(), SplitPolygon(), SplitPortal(), TangentPlaneNormalOfEllipsoid(), and Wedge().

float VECTOR::y
 

Definition at line 20 of file vector.h.

Referenced by AddSpline(), LIGHT::Apply(), CAMERA::Apply(), AxisAngleToMatrix(), QUAT::AxisAngleToQuat(), bspline(), bsplinepoint(), CalculatePVS(), CheckClipPlanes(), CheckForCollision(), CheckPointInSphere(), CheckPointInTriangle(), ClassifyInvertedPortal(), ClassifyPoint(), ClassifyPortal(), ClosestPointOnLine(), ClosestPointOnPolygon(), compute_point(), CreateLargePortal(), CreateLightmaps(), CrossVector(), CrossVector(), DotProduct(), DotProduct(), DrawFire(), DrawGLScene(), DrawHalo(), DrawIntersectionSphere(), DrawSplines(), FindCurrentLeaf(), FindVisibleLeaves(), GetEdgeIntersection(), GetEdgeVector(), GetMagnitude(), PORTAL::GetNormal(), POLYGON::GetNormal(), GetUnitVector(), OBJECT::GetXUnit(), OBJECT::GetYUnit(), OBJECT::GetZUnit(), IntersectRaySphere(), InvertPortals(), IsZeroVector(), LoadSplines(), MagnitudeVector(), MATRIX::MatrixFromAxisAngle(), OBJECT::MoveX(), OBJECT::MoveY(), OBJECT::MoveZ(), QUAT::MultQuat(), MultQuat(), Normalize(), PointInFrustum(), RenderBSP(), Reset(), LIGHT::Reset(), Set(), SetLength(), SetStaticLights(), SphereInFrustum(), SplitPolygon(), SplitPortal(), TangentPlaneNormalOfEllipsoid(), and Wedge().

float VECTOR::z
 

Definition at line 21 of file vector.h.

Referenced by AddSpline(), LIGHT::Apply(), CAMERA::Apply(), AxisAngleToMatrix(), QUAT::AxisAngleToQuat(), bspline(), bsplinepoint(), CalculatePVS(), CheckClipPlanes(), CheckForCollision(), CheckPointInSphere(), CheckPointInTriangle(), ClassifyInvertedPortal(), ClassifyPoint(), ClassifyPortal(), ClosestPointOnLine(), ClosestPointOnPolygon(), compute_point(), CreateLargePortal(), CreateLightmaps(), CrossVector(), CrossVector(), DotProduct(), DotProduct(), DrawFire(), DrawGLScene(), DrawHalo(), DrawIntersectionSphere(), DrawSplines(), FindCurrentLeaf(), FindVisibleLeaves(), GetEdgeIntersection(), GetEdgeVector(), GetMagnitude(), PORTAL::GetNormal(), POLYGON::GetNormal(), GetUnitVector(), OBJECT::GetXUnit(), OBJECT::GetYUnit(), OBJECT::GetZUnit(), IntersectRaySphere(), InvertPortals(), IsZeroVector(), LoadSplines(), MagnitudeVector(), MATRIX::MatrixFromAxisAngle(), OBJECT::MoveX(), OBJECT::MoveY(), OBJECT::MoveZ(), QUAT::MultQuat(), MultQuat(), Normalize(), PointInFrustum(), RenderBSP(), Reset(), LIGHT::Reset(), Set(), SetLength(), SetStaticLights(), SphereInFrustum(), SplitPolygon(), SplitPortal(), TangentPlaneNormalOfEllipsoid(), and Wedge().


The documentation for this class was generated from the following files:
Generated on Fri Dec 23 05:20:42 2005 for Potentially Visible Sets by doxygen1.2.15