Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# XFcVector2 Class Reference

2-Dimensional vector. More...

Collaboration diagram for XFcVector2:

[legend]
List of all members.

## Public Member Functions
| XFcVector2 ()
| XFcVector2 (REAL aX, REAL aY)
XFcVector2 & | operator+= (const XFcVector2 &aVec)
| Adds components of another vector to this vector.
XFcVector2 | operator+ (const XFcVector2 &aVec) const
| Adds components of another vector to this vector.
XFcVector2 | operator+ (const INT32 aArg) const
| Adds an integer value to each component of this vector.
XFcVector2 | operator+ (const FLOAT32 aArg) const
| Adds a floating point value to each component of this vector.
XFcVector2 & | operator-= (const XFcVector2 &aVec)
| Subtracts components of another vector from this vector.
XFcVector2 | operator- (const XFcVector2 &aVec) const
| Subtracts components of another vector from this vector.
XFcVector2 | operator- (const INT32 aArg) const
| Subtracts an integer value from each component of this vector.
XFcVector2 | operator- (const FLOAT32 aArg) const
| Subtracts a floating point value from each component of this vector.
XFcVector2 & | operator *= (const INT32 aArg)
| Multiplies components of this vector with an integer value.
XFcVector2 & | operator *= (const FLOAT32 aArg)
| Multiplies components of this vector with a floating point value.
XFcVector2 | operator * (const INT32 aArg) const
| Multiplies components of this vector with an integer value.
XFcVector2 | operator * (const FLOAT32 aArg) const
| Multiplies components of this vector with a floating point value.
XFcVector2 & | operator/= (const INT32 aArg)
| Divides components of this vector with an integer value.
XFcVector2 & | operator/= (const FLOAT32 aArg)
| Divides components of this vector with a floating point value.
XFcVector2 | operator/ (const INT32 aArg) const
| Divides components of this vector with an integer value.
XFcVector2 | operator/ (const FLOAT32 aArg) const
| Divides components of this vector with a floating point value.
XFcVector2 | operator+ (const REAL &aArg) const
| Adds a REAL value to each component of this vector.
XFcVector2 | operator- (const REAL &aArg) const
| Subtracts a REAL value from each component of this vector.
XFcVector2 & | operator *= (const REAL &aArg)
| Multiplies components of this vector with a REAL value.
XFcVector2 | operator * (const REAL &aArg) const
| Multiplies components of this vector with a REAL value.
XFcVector2 & | operator/= (const REAL &aArg)
| Divides components of this vector with a REAL value.
XFcVector2 | operator/ (const REAL &aArg) const
| Divides components of this vector with a REAL value.
XFcVector2 | operator- () const
| Negates all components of this vector.
REAL | dotProduct (const XFcVector2 &aVec)
| Returns dot product of this vector with an another vector.
REAL | length ()
| Returns length of this vector.
REAL | lengthSq ()
| Returns squared length of this vector.
void | normalize ()
| Normalizes this vector.
void | normalizeFast ()
| Normalizes this vector. This is fast but has problems with large vectors.
void | pseudoNormalize ()
| "Normalizes" this vector to length between 1 and 2. This can be used to make fixed point vector math safe.
## Public Attributes
REAL | x
REAL | y
## Friends
XFcVector2 | operator * (const INT32 aArg, const XFcVector2 &aVec)
| Multiplies components of a vector with an integer value.
XFcVector2 | operator * (const FLOAT32 aArg, const XFcVector2 &aVec)
| Multiplies components of a vector with a floating point value.
XFcVector2 | operator/ (const INT32 aArg, const XFcVector2 &aVec)
| Divides components of a vector with an integer value.
XFcVector2 | operator/ (const FLOAT32 aArg, const XFcVector2 &aVec)
| Divides components of a vector with a floating point value.
XFcVector2 | operator * (const REAL &aArg, const XFcVector2 &aVec)
| Multiplies components of a vector with a REAL value.
XFcVector2 | operator/ (const REAL &aArg, const XFcVector2 &aVec)
| Divides components of a vector with a REAL value.

## Detailed Description

2-Dimensional vector.

Typical vector operators implemented.

See also:
  XFcVector3

## Constructor & Destructor Documentation

XFcVector2::XFcVector2 | ( |  | ) | `[inline]`

XFcVector2::XFcVector2 | ( | REAL | aX,
|  | REAL | aY
| ) | `[inline]`

## Member Function Documentation

REAL XFcVector2::dotProduct | ( | const XFcVector2 & | aVec | ) | `[inline]`

  | Returns dot product of this vector with an another vector. Parameters:
  aVec | the other vector of the dot product.
Returns: dot product of the vectors.

REAL XFcVector2::length | ( |  | ) | `[inline]`

| Returns length of this vector. See also: lengthSq

REAL XFcVector2::lengthSq | ( |  | ) | `[inline]`

| Returns squared length of this vector. Note: Calculating squared length is faster than calculating length. See also: length

void XFcVector2::normalize | ( |  | ) | `[inline]`

| Normalizes this vector.

void XFcVector2::normalizeFast | ( |  | ) | `[inline]`

| Normalizes this vector. This is fast but has problems with large vectors.

XFcVector2 XFcVector2::operator * | ( | const REAL & | aArg | ) | const`[inline]`

  | Multiplies components of this vector with a REAL value. Parameters:
  aArg | value for the multiplication.
Returns: a new result vector.

XFcVector2 XFcVector2::operator * | ( | const FLOAT32 | aArg | ) | const`[inline]`

  | Multiplies components of this vector with a floating point value. Parameters:
  aArg | floating point value for the multiplication.
Returns: a new result vector.

XFcVector2 XFcVector2::operator * | ( | const INT32 | aArg | ) | const`[inline]`

  | Multiplies components of this vector with an integer value. Parameters:
  aArg | integer value for the multiplication.
Returns: a new result vector.

XFcVector2 & XFcVector2::operator *= | ( | const REAL & | aArg | ) | `[inline]`

  | Multiplies components of this vector with a REAL value. Parameters:
  aArg | value for the multiplication.
Returns: reference to this vector.

XFcVector2 & XFcVector2::operator *= | ( | const FLOAT32 | aArg | ) | `[inline]`

  | Multiplies components of this vector with a floating point value. Parameters:
  aArg | floating point value for the multiplication.
Returns: reference to this vector.

XFcVector2 & XFcVector2::operator *= | ( | const INT32 | aArg | ) | `[inline]`

  | Multiplies components of this vector with an integer value. Parameters:
  aArg | integer value for the multiplication.
Returns: reference to this vector.

XFcVector2 XFcVector2::operator+ | ( | const REAL & | aArg | ) | const`[inline]`

  | Adds a REAL value to each component of this vector. Parameters:
  aArg | value for the addition.
Returns: a new result vector.

XFcVector2 XFcVector2::operator+ | ( | const FLOAT32 | aArg | ) | const`[inline]`

  | Adds a floating point value to each component of this vector. Parameters:
  aArg | floating point value for the addition.
Returns: a new result vector.

XFcVector2 XFcVector2::operator+ | ( | const INT32 | aArg | ) | const`[inline]`

  | Adds an integer value to each component of this vector. Parameters:
  aArg | integer value for the addition.
Returns: a new result vector.

XFcVector2 XFcVector2::operator+ | ( | const XFcVector2 & | aVec | ) | const`[inline]`

  | Adds components of another vector to this vector. Parameters:
  aVec | vector to be added to this vector.
Returns: a new result vector.

XFcVector2 & XFcVector2::operator+= | ( | const XFcVector2 & | aVec | ) | `[inline]`

  | Adds components of another vector to this vector. Parameters:
  aVec | vector to be added to this vector.
Returns: reference to this vector.

XFcVector2 XFcVector2::operator- | ( |  | ) | const`[inline]`

| Negates all components of this vector. Returns: a new result vector.

XFcVector2 XFcVector2::operator- | ( | const REAL & | aArg | ) | const`[inline]`

  | Subtracts a REAL value from each component of this vector. Parameters:
  aArg | value for the subtraction.
Returns: a new result vector.

XFcVector2 XFcVector2::operator- | ( | const FLOAT32 | aArg | ) | const`[inline]`

  | Subtracts a floating point value from each component of this vector. Parameters:
  aArg | floating point value for the subtraction.
Returns: a new result vector.

XFcVector2 XFcVector2::operator- | ( | const INT32 | aArg | ) | const`[inline]`

  | Subtracts an integer value from each component of this vector. Parameters:
  aArg | integer value for the subtraction.
Returns: a new result vector.

XFcVector2 XFcVector2::operator- | ( | const XFcVector2 & | aVec | ) | const`[inline]`

  | Subtracts components of another vector from this vector. Parameters:
  aVec | vector to be subtracted from this vector.
Returns: a new result vector.

XFcVector2 & XFcVector2::operator-= | ( | const XFcVector2 & | aVec | ) | `[inline]`

  | Subtracts components of another vector from this vector. Parameters:
  aVec | vector to be subtracted from this vector.
Returns: reference to this vector.

XFcVector2 XFcVector2::operator/ | ( | const REAL & | aArg | ) | const`[inline]`

  | Divides components of this vector with a REAL value. Parameters:
  aArg | integer value for the division.
Returns: a new result vector.

XFcVector2 XFcVector2::operator/ | ( | const FLOAT32 | aArg | ) | const`[inline]`

  | Divides components of this vector with a floating point value. Parameters:
  aArg | floating point value for the division.
Returns: a new result vector.

XFcVector2 XFcVector2::operator/ | ( | const INT32 | aArg | ) | const`[inline]`

  | Divides components of this vector with an integer value. Parameters:
  aArg | integer value for the division.
Returns: a new result vector.

XFcVector2 & XFcVector2::operator/= | ( | const REAL & | aArg | ) | `[inline]`

  | Divides components of this vector with a REAL value. Parameters:
  aArg | value for the division.
Returns: reference to this vector.

XFcVector2 & XFcVector2::operator/= | ( | const FLOAT32 | aArg | ) | `[inline]`

  | Divides components of this vector with a floating point value. Parameters:
  aArg | floating point value for the division.
Returns: reference to this vector.

XFcVector2 & XFcVector2::operator/= | ( | const INT32 | aArg | ) | `[inline]`

  | Divides components of this vector with an integer value. Parameters:
  aArg | integer value for the division.
Returns: reference to this vector.

void XFcVector2::pseudoNormalize | ( |  | ) | `[inline]`

| "Normalizes" this vector to length between 1 and 2. This can be used to make fixed point vector math safe.

## Friends And Related Function Documentation

XFcVector2 operator * | ( | const REAL & | aArg,
|  | const XFcVector2 & | aVec
| ) | `[friend]`

  | Multiplies components of a vector with a REAL value. Parameters:
  aArg | value for the multiplication.
  aVec | vector to be multiplied.
Returns: a new result vector.

XFcVector2 operator * | ( | const FLOAT32 | aArg,
|  | const XFcVector2 & | aVec
| ) | `[friend]`

  | Multiplies components of a vector with a floating point value. Parameters:
  aArg | floating point value for the multiplication.
  aVec | vector to be multiplied.
Returns: a new result vector.

XFcVector2 operator * | ( | const INT32 | aArg,
|  | const XFcVector2 & | aVec
| ) | `[friend]`

  | Multiplies components of a vector with an integer value. Parameters:
  aArg | integer value for the multiplication.
  aVec | vector to be multiplied.
Returns: a new result vector.

XFcVector2 operator/ | ( | const REAL & | aArg,
|  | const XFcVector2 & | aVec
| ) | `[friend]`

  | Divides components of a vector with a REAL value. Parameters:
  aArg | value for the division.
  aVec | vector to be divided.
Returns: a new result vector.

XFcVector2 operator/ | ( | const FLOAT32 | aArg,
|  | const XFcVector2 & | aVec
| ) | `[friend]`

  | Divides components of a vector with a floating point value. Parameters:
  aArg | floating point value for the division.
  aVec | vector to be divided.
Returns: a new result vector.

XFcVector2 operator/ | ( | const INT32 | aArg,
|  | const XFcVector2 & | aVec
| ) | `[friend]`

  | Divides components of a vector with an integer value. Parameters:
  aArg | integer value for the division.
  aVec | vector to be divided.
Returns: a new result vector.

## Member Data Documentation

REAL XFcVector2::x

REAL XFcVector2::y

|  | X-Forge Documentation Confidential Copyright © 2002-2003 Fathammer |  | Documentation generated with doxygen by Dimitri van Heesch