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 5 of file vector.cpp.

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

VECTOR::~VECTOR  
 

Definition at line 13 of file vector.cpp.

00014 {
00015 }


Member Function Documentation

void VECTOR::CrossVector VECTOR    vect
 

Definition at line 31 of file vector.cpp.

References x, y, and z.

Referenced by QUAT::MultQuat().

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

float VECTOR::DotProduct VECTOR    vect
 

Definition at line 24 of file vector.cpp.

References x, y, and z.

Referenced by QUAT::MultQuat().

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

float VECTOR::GetMagnitude  
 

Definition at line 39 of file vector.cpp.

References x, y, and z.

Referenced by CreateLightmaps(), and Normalize().

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

void VECTOR::Normalize  
 

Definition at line 48 of file vector.cpp.

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

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

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

void VECTOR::Reset  
 

Definition at line 17 of file vector.cpp.

References x, y, and z.

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

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

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:21 2005 for Portals by doxygen1.2.15