Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages

Vector3d Class Reference

#include <nemath.h>

Collaboration diagram for Vector3d:

Collaboration graph
[legend]
List of all members.

Detailed Description

3D vector Simple 3D vector class with useful math operations

Author:
Mattias Jansson (mattias@realityrift.com)


Public Member Functions

 Vector3d ()
 Vector3d (float fX, float fY, float fZ)
 Vector3d (float afComponents[])
Vector3dSet (float fX, float fY, float fZ)
Vector3dSet (float afComponents[])
Vector3dReset ()
float Len () const
float Len2 () const
Vector3dNormalize ()
Vector3dScaleTo (float fLen)
bool operator== (const Vector3d &rkVector) const
bool operator!= (const Vector3d &rkVector) const
float operator * (const Vector3d &rkVector) const
Vector3d operator% (const Vector3d &rkVector) const
Vector3doperator%= (const Vector3d &rkVector)
Vector3d operator * (float fScalar) const
Vector3doperator *= (float fScalar)
Vector3d operator+ (const Vector3d &rkVector) const
Vector3doperator+= (const Vector3d &rkVector)
Vector3d operator- (const Vector3d &rkVector) const
Vector3doperator-= (const Vector3d &rkVector)
Vector3d operator- () const
float & operator[] (int iComponent)
const float & operator[] (int iComponent) const
bool operator< (const Vector3d &rkVector) const

Public Attributes

float x
float y
float z

Static Public Attributes

const NE_STATIC Vector3d ZERO
const NE_STATIC Vector3d ORIGO
const NE_STATIC Vector3d AXES [3]


Constructor & Destructor Documentation

NEOENGINE_API Vector3d  )  [inline]
 

Reset components to zero vector

NEOENGINE_API Vector3d float  fX,
float  fY,
float  fZ
[inline]
 

Set components

Parameters:
fX x component
fY y component
fZ z component

NEOENGINE_API Vector3d float  afComponents[]  )  [inline]
 

Set components

Parameters:
afComponents Array of floats to copy components from [x,y,z]


Member Function Documentation

NEOENGINE_API Vector3d & Set float  fX,
float  fY,
float  fZ
[inline]
 

Set compontents

Parameters:
fX x component
fY y component
fZ z component
Returns:
Resulting Vector3d ref (this)

NEOENGINE_API Vector3d & Set float  afComponents[]  )  [inline]
 

Set compontents

Parameters:
afComponents Array of floats to copy components from [x,y,z]
Returns:
Resulting Vector3d ref (this)

NEOENGINE_API Vector3d & Reset  )  [inline]
 

Reset components to zero vector

Returns:
Resulting Vector3d ref (this)

NEOENGINE_API float Len  )  const [inline]
 

Calculate length of vector

Returns:
vector length

NEOENGINE_API float Len2  )  const [inline]
 

Calculate squared length of vector

Returns:
squared vector length

NEOENGINE_API Vector3d & Normalize  )  [inline]
 

Normalize vector

Returns:
Normalized vector

NEOENGINE_API Vector3d & ScaleTo float  fLen  )  [inline]
 

Scale to length

Parameters:
fLen New length
Returns:
Scaled vector

NEOENGINE_API bool operator== const Vector3d rkVector  )  const [inline]
 

Compare vectors with epsilon tolerance

Parameters:
rkVector Vector ref object to compare this to
Returns:
true if all components equal (in tolerance zone), false otherwise

NEOENGINE_API bool operator!= const Vector3d rkVector  )  const [inline]
 

Compare vectors with epsilon tolerance

Parameters:
rkVector Vector3d ref object to compare this to
Returns:
false if all components equal (in tolerance zone), true otherwise

NEOENGINE_API float operator * const Vector3d rkVector  )  const [inline]
 

Dot product

Parameters:
rkVector Vector ref object to multiply with
Returns:
Dot product (scalar = x*x + y*y + z*z)

NEOENGINE_API Vector3d operator% const Vector3d rkVector  )  const [inline]
 

Cross product

Parameters:
rkVector Vector ref object to cross product with
Returns:
resulting vector (result = this X rkVector) (right-hand system)

NEOENGINE_API Vector3d & operator%= const Vector3d rkVector  )  [inline]
 

Cross product and assignment

Parameters:
rkVector Vector ref object to cross product with, this = this X rkVector
Returns:
Resulting Vector3d ref (this)

NEOENGINE_API Vector3d operator * float  fScalar  )  const [inline]
 

Scalar product

Parameters:
fScalar Scalar value to multiply this with
Returns:
Resulting scaled vector, result( x*fScalar, y*fScalar, z*fScalar)

NEOENGINE_API Vector3d & operator *= float  fScalar  )  [inline]
 

Scalar product and assignment

Parameters:
fScalar Scalar value to multiply this with -> this( x*fScalar, y*fScalar, z*fScalar)
Returns:
Resulting Vector3d ref (this)

NEOENGINE_API Vector3d operator+ const Vector3d rkVector  )  const [inline]
 

Addition

Parameters:
rkVector Vector to add
Returns:
Resulting vector, result = this + rkVector

NEOENGINE_API Vector3d & operator+= const Vector3d rkVector  )  [inline]
 

Addition and assignment

Parameters:
rkVector Vector to add
Returns:
Resulting Vector3d ref (this)

NEOENGINE_API Vector3d operator- const Vector3d rkVector  )  const [inline]
 

Subtraction

Parameters:
rkVector Vector to subtract
Returns:
Resulting vector, result = this - rkVector

NEOENGINE_API Vector3d & operator-= const Vector3d rkVector  )  [inline]
 

Subtraction and assignment

Parameters:
rkVector Vector to subtract
Returns:
Resulting Vector3d ref (this)

NEOENGINE_API Vector3d operator-  )  const [inline]
 

Negation

Returns:
Negated vector

NEOENGINE_API float & operator[] int  iComponent  )  [inline]
 

Array access

Parameters:
iComponent Component to access

NEOENGINE_API const float & operator[] int  iComponent  )  const [inline]
 

Array access

Parameters:
iComponent Component to access

bool operator< const Vector3d rkVector  )  const [inline]
 

Dummy operator for Win32 template instantiation

Parameters:
rkVector Vector ref object to compare this to
Returns:
false


Member Data Documentation

float x
 

Components

float y
 

Components

float z
 

Components

const NE_STATIC Vector3d ZERO [static]
 

Null vector (0,0,0)

const NE_STATIC Vector3d ORIGO [static]
 

Null vector (0,0,0)

const NE_STATIC Vector3d AXES[3] [static]
 

Axes vectors (1,0,0) (0,1,0) (0,0,1)


The documentation for this class was generated from the following file:
Generated on Wed Jan 21 14:21:12 2004 for NeoEngine by doxygen 1.3.5