newspeoplefor developersdocumentationdownloads

_vector3 Class Reference
[Math Data Types]

#include <_vector3.h>

List of all members.


Detailed Description

Generic vector3 class. Uses 16 Byte of mem instead of 12 (!)

(C) 2002 RadonLabs GmbH

Definition at line 16 of file _vector3.h.


Public Member Functions

 _vector3 ()
 constructor 1
 _vector3 (const float _x, const float _y, const float _z)
 constructor 2
 _vector3 (const _vector3 &vec)
 constructor 3
void set (const float _x, const float _y, const float _z)
 set elements 1
void set (const _vector3 &vec)
 set elements 2
float len () const
 return length
float lensquared () const
 return length squared
void norm ()
 normalize
void operator+= (const _vector3 &v0)
 inplace add
void operator-= (const _vector3 &v0)
 inplace sub
void operator *= (float s)
 inplace scalar multiplication
bool operator> (const _vector3 &rhs)
 true if any of the elements are greater
bool operator< (const _vector3 &rhs)
 true if any of the elements are smaller
bool operator== (const _vector3 &v0)
 true if all elements are equal
bool operator!= (const _vector3 &v0)
 true if any of the elements is not equal
bool isequal (const _vector3 &v, float tol) const
 fuzzy compare, return true/false
int compare (const _vector3 &v, float tol) const
 fuzzy compare, returns -1, 0, +1
void rotate (const _vector3 &axis, float angle)
 rotate around axis
void lerp (const _vector3 &v0, float lerpVal)
 inplace linear interpolation
void lerp (const _vector3 &v0, const _vector3 &v1, float lerpVal)
 set this vector to the linear interpolation between v0 and v1
_vector3 findortho () const
 returns a vector orthogonal to self, not normalized
void saturate ()
 saturate components between 0 and 1
float dot (const _vector3 &v0) const
 dot product

Static Public Member Functions

static float distance (const _vector3 &v0, const _vector3 &v1)
 distance between 2 vector3's
static float angle (const _vector3 &v0, const _vector3 &v1)
 returns the angle between 2 vectors

Public Attributes

float x
float y
float z

Static Public Attributes

static const _vector3 zero = _vector3()

Constructor & Destructor Documentation

_vector3::_vector3  )  [inline]
 

constructor 1

Definition at line 80 of file _vector3.h.

_vector3::_vector3 const float  _x,
const float  _y,
const float  _z
[inline]
 

constructor 2

Definition at line 92 of file _vector3.h.

_vector3::_vector3 const _vector3 vec  )  [inline]
 

constructor 3

Definition at line 104 of file _vector3.h.


Member Function Documentation

void _vector3::set const float  _x,
const float  _y,
const float  _z
[inline]
 

set elements 1

Definition at line 117 of file _vector3.h.

void _vector3::set const _vector3 vec  )  [inline]
 

set elements 2

Definition at line 129 of file _vector3.h.

float _vector3::len  )  const [inline]
 

return length

Definition at line 141 of file _vector3.h.

float _vector3::lensquared  )  const [inline]
 

return length squared

Definition at line 151 of file _vector3.h.

void _vector3::norm  )  [inline]
 

normalize

Definition at line 161 of file _vector3.h.

void _vector3::operator+= const _vector3 v0  )  [inline]
 

inplace add

Definition at line 177 of file _vector3.h.

void _vector3::operator-= const _vector3 v0  )  [inline]
 

inplace sub

Definition at line 189 of file _vector3.h.

void _vector3::operator *= float  s  )  [inline]
 

inplace scalar multiplication

Definition at line 201 of file _vector3.h.

bool _vector3::operator> const _vector3 rhs  )  [inline]
 

true if any of the elements are greater

Definition at line 455 of file _vector3.h.

bool _vector3::operator< const _vector3 rhs  )  [inline]
 

true if any of the elements are smaller

Definition at line 472 of file _vector3.h.

bool _vector3::operator== const _vector3 v0  )  [inline]
 

true if all elements are equal

Definition at line 421 of file _vector3.h.

bool _vector3::operator!= const _vector3 v0  )  [inline]
 

true if any of the elements is not equal

Definition at line 438 of file _vector3.h.

bool _vector3::isequal const _vector3 v,
float  tol
const [inline]
 

fuzzy compare, return true/false

Definition at line 213 of file _vector3.h.

int _vector3::compare const _vector3 v,
float  tol
const [inline]
 

fuzzy compare, returns -1, 0, +1

Definition at line 226 of file _vector3.h.

void _vector3::rotate const _vector3 axis,
float  angle
[inline]
 

rotate around axis

Definition at line 239 of file _vector3.h.

void _vector3::lerp const _vector3 v0,
float  lerpVal
[inline]
 

inplace linear interpolation

Definition at line 347 of file _vector3.h.

void _vector3::lerp const _vector3 v0,
const _vector3 v1,
float  lerpVal
[inline]
 

set this vector to the linear interpolation between v0 and v1

Definition at line 359 of file _vector3.h.

_vector3 _vector3::findortho  )  const [inline]
 

returns a vector orthogonal to self, not normalized

Find a vector that is orthogonal to self. Self should not be (0,0,0). Return value is not normalized.

Definition at line 385 of file _vector3.h.

void _vector3::saturate  )  [inline]
 

saturate components between 0 and 1

Definition at line 371 of file _vector3.h.

float _vector3::dot const _vector3 v0  )  const [inline]
 

dot product

Dot product for vector3

Definition at line 411 of file _vector3.h.

float _vector3::distance const _vector3 v0,
const _vector3 v1
[inline, static]
 

distance between 2 vector3's

Definition at line 489 of file _vector3.h.

float _vector3::angle const _vector3 v0,
const _vector3 v1
[inline, static]
 

returns the angle between 2 vectors

Definition at line 500 of file _vector3.h.


Member Data Documentation

const _vector3 _vector3::zero = _vector3() [static]
 

Definition at line 3 of file _vector3.cc.

float _vector3::x
 

Definition at line 73 of file _vector3.h.

float _vector3::y
 

Definition at line 73 of file _vector3.h.

float _vector3::z
 

Definition at line 73 of file _vector3.h.


The documentation for this class was generated from the following files:

Copyright © 1999-2005 by the contributing authors. Ideas, requests, problems: Send feedback.