Contents User Forum Source Index APIs by Task APIs by Level Data


G3D::Vector2 Class Reference

Do not subclass-- this implementation makes assumptions about the memory layout. More...

#include <Vector2.h>

List of all members.

Public Member Functions

Vector2 clamp (float low, float high) const
Vector2 clamp (const Vector2 &low, const Vector2 &high) const
void deserialize (class TextInput &t)
void deserialize (class BinaryInput &b)
Vector2 direction () const
float dot (const Vector2 &s) const
Vector2 fastDirection () const
bool fuzzyEq (const Vector2 &other) const
bool fuzzyNe (const Vector2 &other) const
size_t hashCode () const
bool isFinite () const
bool isUnit () const
bool isZero () const
float length () const
Vector2 lerp (const Vector2 &v, float alpha) const
Vector2 max (const Vector2 &v) const
Vector2 min (const Vector2 &v) const
Vector2 operator * (const Vector2 &v) const
Vector2 operator * (float s) const
Vector2operator *= (const Vector2 &)
Vector2operator *= (float)
 operator const float * () const
 operator float * ()
bool operator!= (const Vector2 &other) const
Vector2 operator+ (const Vector2 &v) const
Vector2operator+= (const Vector2 &)
Vector2 operator- () const
Vector2 operator- (const Vector2 &v) const
Vector2operator-= (const Vector2 &)
Vector2 operator/ (float s) const
Vector2 operator/ (const Vector2 &v) const
Vector2operator/= (const Vector2 &)
Vector2operator/= (float)
Vector2operator= (const Vector2 &other)
bool operator== (const Vector2 &other) const
const float & operator[] (int i) const
float & operator[] (int i)
void serialize (class TextOutput &t) const
void serialize (class BinaryOutput &b) const
float squaredLength () const
float sum () const
std::string toString () const
float unitize (float fTolerance=1e-06)
 Vector2 (const class Vector2int16 &other)
 Vector2 (const Vector2 &other)
 Vector2 (double coordinate[2])
 Vector2 (float coordinate[2])
 Vector2 (float x, float y)
 Vector2 (class BinaryInput &b)
 Vector2 (class TextInput &t)
 Vector2 ()
Vector2 xx () const
Vector3 xxx () const
Vector4 xxxx () const
Vector4 xxxy () const
Vector3 xxy () const
Vector4 xxyx () const
Vector4 xxyy () const
Vector2 xy () const
Vector3 xyx () const
Vector4 xyxx () const
Vector4 xyxy () const
Vector3 xyy () const
Vector4 xyyx () const
Vector4 xyyy () const
Vector2 yx () const
Vector3 yxx () const
Vector4 yxxx () const
Vector4 yxxy () const
Vector3 yxy () const
Vector4 yxyx () const
Vector4 yxyy () const
Vector2 yy () const
Vector3 yyx () const
Vector4 yyxx () const
Vector4 yyxy () const
Vector3 yyy () const
Vector4 yyyx () const
Vector4 yyyy () const

Static Public Member Functions

static const Vector2inf ()
static const Vector2maxFinite ()
static const Vector2minFinite ()
static const Vector2nan ()
static const Vector2one ()
static Vector2 random ()
static const Vector2unitX ()
static const Vector2unitY ()
static const Vector2zero ()

Public Attributes

float x
float y


Detailed Description

Do not subclass-- this implementation makes assumptions about the memory layout.


Constructor & Destructor Documentation

G3D::Vector2::Vector2 (  )  [inline]

Creates the zero vector.

G3D::Vector2::Vector2 ( class TextInput t  ) 

G3D::Vector2::Vector2 ( class BinaryInput b  ) 

G3D::Vector2::Vector2 ( float  x,
float  y 
) [inline]

G3D::Vector2::Vector2 ( float  coordinate[2]  )  [inline]

G3D::Vector2::Vector2 ( double  coordinate[2]  )  [inline]

G3D::Vector2::Vector2 ( const Vector2 other  )  [inline]

G3D::Vector2::Vector2 ( const class Vector2int16 other  ) 


Member Function Documentation

Vector2 G3D::Vector2::clamp ( float  low,
float  high 
) const [inline]

Vector2 G3D::Vector2::clamp ( const Vector2 low,
const Vector2 high 
) const [inline]

void G3D::Vector2::deserialize ( class TextInput t  ) 

void G3D::Vector2::deserialize ( class BinaryInput b  ) 

Vector2 G3D::Vector2::direction (  )  const [inline]

Returns a unit-length vector.

float G3D::Vector2::dot ( const Vector2 s  )  const [inline]

Vector2 G3D::Vector2::fastDirection (  )  const [inline]

Potentially less accurate but faster than direction().

Only works if System::hasSSE is true.

bool G3D::Vector2::fuzzyEq ( const Vector2 other  )  const [inline]

bool G3D::Vector2::fuzzyNe ( const Vector2 other  )  const [inline]

size_t G3D::Vector2::hashCode (  )  const

static const Vector2& G3D::Vector2::inf (  )  [static]

bool G3D::Vector2::isFinite (  )  const [inline]

Returns true if this vector has finite length.

bool G3D::Vector2::isUnit (  )  const [inline]

Returns true if this vector has length == 1.

bool G3D::Vector2::isZero (  )  const [inline]

Returns true if this vector has length == 0.

float G3D::Vector2::length (  )  const [inline]

Vector2 G3D::Vector2::lerp ( const Vector2 v,
float  alpha 
) const [inline]

Linear interpolation.

Vector2 G3D::Vector2::max ( const Vector2 v  )  const [inline]

static const Vector2& G3D::Vector2::maxFinite (  )  [static]

Largest representable vector.

Vector2 G3D::Vector2::min ( const Vector2 v  )  const [inline]

static const Vector2& G3D::Vector2::minFinite (  )  [static]

smallest (most negative) representable vector

static const Vector2& G3D::Vector2::nan (  )  [static]

static const Vector2& G3D::Vector2::one (  )  [inline, static]

Vector2 G3D::Vector2::operator * ( const Vector2 v  )  const [inline]

Array (pointwise) multiplication.

Vector2 G3D::Vector2::operator * ( float  s  )  const [inline]

Vector2 & G3D::Vector2::operator *= ( const Vector2  )  [inline]

Vector2 & G3D::Vector2::operator *= ( float   )  [inline]

G3D::Vector2::operator const float * (  )  const [inline]

G3D::Vector2::operator float * (  )  [inline]

bool G3D::Vector2::operator!= ( const Vector2 other  )  const [inline]

Vector2 G3D::Vector2::operator+ ( const Vector2 v  )  const [inline]

Vector2 & G3D::Vector2::operator+= ( const Vector2  )  [inline]

Vector2 G3D::Vector2::operator- (  )  const [inline]

Unary minus.

Vector2 G3D::Vector2::operator- ( const Vector2 v  )  const [inline]

Vector2 & G3D::Vector2::operator-= ( const Vector2  )  [inline]

Vector2 G3D::Vector2::operator/ ( float  s  )  const

Vector2 G3D::Vector2::operator/ ( const Vector2 v  )  const [inline]

Array division.

Vector2 & G3D::Vector2::operator/= ( const Vector2  )  [inline]

Vector2& G3D::Vector2::operator/= ( float   ) 

Vector2 & G3D::Vector2::operator= ( const Vector2 other  )  [inline]

bool G3D::Vector2::operator== ( const Vector2 other  )  const [inline]

const float & G3D::Vector2::operator[] ( int  i  )  const [inline]

float & G3D::Vector2::operator[] ( int  i  )  [inline]

static Vector2 G3D::Vector2::random (  )  [static]

Uniformly distributed random vector on the unit sphere.

void G3D::Vector2::serialize ( class TextOutput t  )  const

void G3D::Vector2::serialize ( class BinaryOutput b  )  const

float G3D::Vector2::squaredLength (  )  const [inline]

float G3D::Vector2::sum (  )  const [inline]

x + y

std::string G3D::Vector2::toString (  )  const

float G3D::Vector2::unitize ( float  fTolerance = 1e-06  ) 

Make this vector have unit length and return the old length.

If the vector length was less than tolerance, do not normalize.

static const Vector2& G3D::Vector2::unitX (  )  [static]

static const Vector2& G3D::Vector2::unitY (  )  [static]

Vector2 G3D::Vector2::xx (  )  const

Vector3 G3D::Vector2::xxx (  )  const

Vector4 G3D::Vector2::xxxx (  )  const

Vector4 G3D::Vector2::xxxy (  )  const

Vector3 G3D::Vector2::xxy (  )  const

Vector4 G3D::Vector2::xxyx (  )  const

Vector4 G3D::Vector2::xxyy (  )  const

Vector2 G3D::Vector2::xy (  )  const

Vector3 G3D::Vector2::xyx (  )  const

Vector4 G3D::Vector2::xyxx (  )  const

Vector4 G3D::Vector2::xyxy (  )  const

Vector3 G3D::Vector2::xyy (  )  const

Vector4 G3D::Vector2::xyyx (  )  const

Vector4 G3D::Vector2::xyyy (  )  const

Vector2 G3D::Vector2::yx (  )  const

Vector3 G3D::Vector2::yxx (  )  const

Vector4 G3D::Vector2::yxxx (  )  const

Vector4 G3D::Vector2::yxxy (  )  const

Vector3 G3D::Vector2::yxy (  )  const

Vector4 G3D::Vector2::yxyx (  )  const

Vector4 G3D::Vector2::yxyy (  )  const

Vector2 G3D::Vector2::yy (  )  const

Vector3 G3D::Vector2::yyx (  )  const

Vector4 G3D::Vector2::yyxx (  )  const

Vector4 G3D::Vector2::yyxy (  )  const

Vector3 G3D::Vector2::yyy (  )  const

Vector4 G3D::Vector2::yyyx (  )  const

Vector4 G3D::Vector2::yyyy (  )  const

static const Vector2& G3D::Vector2::zero (  )  [static]


Member Data Documentation


The documentation for this class was generated from the following file:
Generated on Thu Aug 2 11:40:48 2007 for G3D by doxygen 1.5.2
Hosted by SourceForge.net Logo