nn::math::VEC2 Class

Syntax

class VEC2 : public nn::math::VEC2_

Description

A two-dimensional vector class.

typedef Definitions

self_type This class's type.
value_type The type of this class's elements.

Member Constants

S DIMENSION const int Number of dimensions.

Member Functions

Creation
VEC2 Constructor.
Conversions
operator f32 * Casts to an f32-type value.
operator const f32 * Casts to an f32-type value.
Operators
operator+= Assigns the values of the added vector.
operator-= Assigns the values after vector subtraction.
operator*= Assigns the values of the multiplied vector.
operator/= Assigns the values after vector division.
operator+ Returns its own vector.
operator- Returns the inverse of the vector.
operator * Returns the result of vector multiplication.
operator/ Returns the result of vector division.
Lerp Linearly interpolates between two vectors and sets the result.
Dot Calculates the dot product with the specified vector.
LenSq Calculates the square of a vector length.
LengthSquare Calculates the square of a vector length.
Length Calculates the vector length.
Normalize Normalizes a vector.
SafeNormalize Normalizes a vector. If normalization fails, sets the specified vector.
DistanceSquare Calculates the squared distance to the specified vector.
Maximize Creates the vector formed by the larger of each component of two input vectors.
Minimize Creates the vector formed by the smaller of each component of two input vectors.
Settings
Set Sets values individually.
Comparisons
operator== Returns true if the values are equal.
operator!= Returns TRUE if the values are equal.
IsZero Returns true if this is a zero vector.
Other
S Zero This is a zero vector.
S One All of the elements are vectors of 1.
Report Outputs the state.

Class Hierarchy

nn::math::VEC2_
  nn::math::VEC2

Revision History

2010/02/09
Initial version.

CONFIDENTIAL