Files Class List
Point2f Class Reference

Detailed Description

2D point (vector) class with float type elements

+ Inheritance diagram for Point2f:

Public Member Functions

Binary operators
Point2 operator+ (const Point2 &p) const
 
Point2 operator+ (const float &v) const
 
Point2 operator- (const Point2 &p) const
 
Point2 operator- (const float &v) const
 
Point2 operator* (const Point2 &p) const
 
Point2 operator* (const float &v) const
 
Point2 operator/ (const Point2 &p) const
 
Point2 operator/ (const float &v) const
 
Unary operators
Point2 operator- () const
 
Set & Get value methods
void Zero ()
 
void Get (float *p) const
 
void Set (const float *p)
 
void Set (const float &v)
 
void Set (const float &_x, const float &_y)
 
General methods
float LengthSquared () const
 
float Length () const
 
void Normalize ()
 
Point2 GetNormalized () const
 
float Sum () const
 
bool IsZero () const
 
float Min () const
 
float Max () const
 
int MinID () const
 
int MaxID () const
 
Limit methods
void Clamp (const float &minValue, const float &maxValue)
 
void ClampMin (const float &v)
 
void ClampMax (const float &v)
 
void Abs ()
 
Assignment operators
const Point2operator+= (const Point2 &p)
 
const Point2operator+= (const float &v)
 
const Point2operator-= (const Point2 &p)
 
const Point2operator-= (const float &v)
 
const Point2operator*= (const Point2 &p)
 
const Point2operator*= (const float &v)
 
const Point2operator/= (const Point2 &p)
 
const Point2operator/= (const float &v)
 
Test operators
bool operator== (const Point2 &p) const
 
bool operator!= (const Point2 &p) const
 
Access operators
float & operator[] (int i)
 
const float & operator[] (int i) const
 
float & Element (int i)
 
const float & Element (int i) const
 
float * Data ()
 
const float * Data () const
 
Cross product and dot product
float Cross (const Point2 &p) const
 
float operator^ (const Point2 &p) const
 
float Dot (const Point2 &p) const
 
float operator% (const Point2 &p) const
 

Public Attributes

Components of the point/vector
float x
 
float y
 

Member Function Documentation

§ Zero()

void Zero ( )
inherited

Sets the coordinates as zero.

§ Get()

void Get ( float *  p) const
inherited

Puts the coordinate values into the array.

§ Set() [1/3]

void Set ( const float *  p)
inherited

Sets the coordinates using the values in the given array.

§ Set() [2/3]

void Set ( const float &  v)
inherited

Sets all coordinates using the given value.

§ Set() [3/3]

void Set ( const float &  _x,
const float &  _y 
)
inherited

Sets the coordinates using the given values.

§ LengthSquared()

float LengthSquared ( ) const
inherited

Returns the square of the length. Effectively, this is the dot product of the vector with itself.

§ Length()

float Length ( ) const
inherited

Returns the length of the vector.

§ Normalize()

void Normalize ( )
inherited

Normalizes the vector, such that its length becomes 1.

§ GetNormalized()

Point2 GetNormalized ( ) const
inherited

Returns a normalized copy of the vector.

§ Sum()

float Sum ( ) const
inherited

Returns the sum of its components.

§ IsZero()

bool IsZero ( ) const
inherited

Returns true if all components are exactly zero.

§ Min()

float Min ( ) const
inherited

Returns the square of the length. Effectively, this is the dot product of the vector with itself.

§ Max()

float Max ( ) const
inherited

Returns the square of the length. Effectively, this is the dot product of the vector with itself.

§ MinID()

int MinID ( ) const
inherited

Returns the square of the length. Effectively, this is the dot product of the vector with itself.

§ MaxID()

int MaxID ( ) const
inherited

Returns the square of the length. Effectively, this is the dot product of the vector with itself.

§ Clamp()

void Clamp ( const float &  minValue,
const float &  maxValue 
)
inherited

Converts all negative components to positive values.

§ ClampMin()

void ClampMin ( const float &  v)
inherited

Converts all negative components to positive values.

§ ClampMax()

void ClampMax ( const float &  v)
inherited

Converts all negative components to positive values.

§ Abs()

void Abs ( )
inherited

Converts all negative components to positive values.

§ Cross()

float Cross ( const Point2< float > &  p) const
inherited

Cross product.

§ operator^()

float operator^ ( const Point2< float > &  p) const
inherited

Cross product operator.

§ Dot()

float Dot ( const Point2< float > &  p) const
inherited

Dot product.

§ operator%()

float operator% ( const Point2< float > &  p) const
inherited

Dot product operator.