Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

gbmath::V3 Class Reference

3D Vector class. More...

#include <v3.h>

List of all members.

Public Methods

Constructors
 V3 (float x=0.f, float y=0.f, float z=0.f)
 .

 V3 (const V3 &v)
 .

Initializers
void Set (float x, float y, float z)
 .

void Set (const V3 &v)
 .

void SetLess (const V3 &v)
 .

void SetGreater (const V3 &v)
 .

Overloaded Operators
V3 operator- () const
 .

V3 operator+ (float d) const
 .

V3 operator+ (const V3 &v) const
 .

V3 operator- (float d) const
 .

V3 operator- (const V3 &v) const
 .

V3 operator * (float d) const
 .

V3 operator * (const V3 &v) const
 .

V3 operator/ (float d) const
 .

V3 operator/ (const V3 &v) const
 .

void operator+= (const V3 &v)
 .

void operator-= (const V3 &v)
 .

void operator *= (float d)
 .

void operator *= (const V3 &v)
 .

void operator *= (const Mat44 &m)
 .

void operator *= (const Mat33 &m)
 .

void operator/= (float d)
 .

Operations
float Dot (const V3 &v) const
 Dot product (inner product).

V3 Cross (const V3 &v) const
 Cross product.

float Mag () const
 Magnitude of vector.

float MagSquared () const
 Squared magnitude of vector.

V3 GetNorm () const
 Returns the vector normalized.

V3 & Normalize ()
 Normalizes the vector in place.

V3 GetReflect (const V3 &normal) const
 Returns the vector reflected around the normal.

V3 & Reflect (const V3 &normal)
 Reflects the vector around the normal in place.

V3 GetOProjectPerp (int c) const
 Removes the indexed component and returns the perpendicular vector.

V3 & OProjectPerp (int c)
 Removes the indexed component and returns the perpendicular vector in place.

V3 GetOProject (int c) const
 Returns a vector with the indexed component removed.

bool Equals (const V3 &v, float eps=constants::Eps3) const
 Checks vector equality given a threshold.


Static Public Attributes

V3 Axes [3]
 Cardinal vectors X, Y, and Z.

V3 O
 Zero vector.

V3 Inf
 Inifinite vector.


Detailed Description

3D Vector class.

Union members: float x, y, z; float xyz [3];


Member Data Documentation

V3 gbmath::V3::Axes [static]
 

Initial value:

 { V3 (1.f, 0.f, 0.f), 
                        V3 (0.f, 1.f, 0.f), 
                        V3 (0.f, 0.f, 1.f) }
Cardinal vectors X, Y, and Z.


The documentation for this class was generated from the following files:
Generated on Mon Sep 2 14:52:33 2002 for GunBuster Engine by doxygen1.2.17