CL_Pointf Class Reference
[clanCore Math]

2D (x,y) point structure - Float More...

#include <point.h>

Inheritance diagram for CL_Pointf:

CL_Pointx< float > CL_Vec2< float > List of all members.

Public Types

typedef float datatype

Public Member Functions

 CL_Pointf ()
 CL_Pointf (float x, float y)
 CL_Pointf (const CL_Pointx< float > &p)
 CL_Pointf (const CL_Vec2< float > &p)
CL_Vec2< float > & normalize ()
 Normalizes this vector.
float dot (const CL_Vec2< float > &vector) const
 Dot products this vector with an other vector.
CL_Vec2< float > & round ()
 Rounds all components of this vector.
CL_Vec2< float > & rotate (const CL_Vec2< float > &hotspot, const CL_Angle &angle)
 Rotate this vector around another point.
float length () const
 Returns the length (magnitude) of this vector.
CL_Angle angle (const CL_Vec2< float > &vector) const
 Calculate the angle between this vector and an other vector.
float distance (const CL_Vec2< float > &vector) const
 Calculate the distance between this vector and an other vector.
float round_value (float value) const
 Rounds a value for the datatype.
const float & operator[] (unsigned int i) const
float & operator[] (unsigned int i)
 operator float * ()
 operator float *const () const
void operator+= (const CL_Vec2< float > &vector)
 += operator.
void operator+= (floatvalue)
 += operator.
CL_Vec2< float > operator+ (const CL_Vec2< float > &vector) const
 + operator.
CL_Vec2< float > operator+ (floatvalue) const
 + operator.
void operator-= (const CL_Vec2< float > &vector)
 -= operator.
void operator-= (floatvalue)
 -= operator.
CL_Vec2< float > operator- (const CL_Vec2< float > &vector) const
 
  • operator.

CL_Vec2< float > operator- (floatvalue) const
 
  • operator.

CL_Vec2< float > operator- () const
 
  • operator.

void operator *= (const CL_Vec2< float > &vector)
 *= operator.
void operator *= (floatvalue)
 *= operator.
CL_Vec2< float > operator * (const CL_Vec2< float > &vector) const
 * operator.
CL_Vec2< float > operator * (floatvalue) const
 * operator.
void operator/= (const CL_Vec2< float > &vector)
 /= operator.
void operator/= (floatvalue)
 /= operator.
CL_Vec2< float > operator/ (const CL_Vec2< float > &vector) const
 / operator.
CL_Vec2< float > operator/ (floatvalue) const
 / operator.
bool operator== (const CL_Vec2< float > &vector) const
 == operator.
bool operator!= (const CL_Vec2< float > &vector) const
 != operator.

Static Public Member Functions

static CL_Vec2< float > normalize (const CL_Vec2< float > &vector)
 Normalizes a vector.
static float dot (const CL_Vec2< float > &vector_1, const CL_Vec2< float > &vector_2)
 Dot products a vector with an other vector.
static CL_Vec2< float > round (const CL_Vec2< float > &vector)
 Rounds all components on a vector.
static CL_Vec2< float > rotate (const CL_Vec2< float > &vector, const CL_Vec2< float > &hotspot, const CL_Angle &angle)
 Rotate a vector around another point.
static CL_Pointx< float > calc_origin (CL_Origin origin, const CL_Sizex< float > &size)
 Returns the anchor point for the origin within the dimensions of the size structure.

Public Attributes

float x
float s
float r
float y
float t
float g

Detailed Description

2D (x,y) point structure - Float


Member Typedef Documentation

typedef float CL_Vec2< float >::datatype [inherited]
 


Constructor & Destructor Documentation

CL_Pointf::CL_Pointf  )  [inline]
 

CL_Pointf::CL_Pointf float  x,
float  y
[inline]
 

CL_Pointf::CL_Pointf const CL_Pointx< float > &  p  )  [inline]
 

CL_Pointf::CL_Pointf const CL_Vec2< float > &  p  )  [inline]
 


Member Function Documentation

CL_Angle CL_Vec2< float >::angle const CL_Vec2< float > &  vector  )  const [inherited]
 

Calculate the angle between this vector and an other vector.

Parameters:
vector = Second vector used to calculate angle.
Returns:
The angle between the two vectors.

static CL_Pointx<float > CL_Vec2< float >::calc_origin CL_Origin  origin,
const CL_Sizex< float > &  size
[static, inherited]
 

Returns the anchor point for the origin within the dimensions of the size structure.

Parameters:
origin = The origin
size = The size
Returns:
The point

float CL_Vec2< float >::distance const CL_Vec2< float > &  vector  )  const [inherited]
 

Calculate the distance between this vector and an other vector.

Parameters:
vector = Second vector used to calculate distance.
Returns:
The distance between the two vectors.

float CL_Vec2< float >::dot const CL_Vec2< float > &  vector  )  const [inline, inherited]
 

Dot products this vector with an other vector.

Operates in the native datatype

Parameters:
vector Second vector used for the dot product.
Returns:
The resulting dot product of the two vectors.

static float CL_Vec2< float >::dot const CL_Vec2< float > &  vector_1,
const CL_Vec2< float > &  vector_2
[inline, static, inherited]
 

Dot products a vector with an other vector.

Operates in the native datatype

Parameters:
vector_1 = First vector used for the dot product.
vector_2 = Second vector used for the dot product.
Returns:
The resulting dot product of the two vectors.

float CL_Vec2< float >::length  )  const [inherited]
 

Returns the length (magnitude) of this vector.

Operates in the native datatype

Returns:
the length of the vector

CL_Vec2<float >& CL_Vec2< float >::normalize  )  [inherited]
 

Normalizes this vector.

Operates in the native datatype

Returns:
reference to this object

static CL_Vec2<float > CL_Vec2< float >::normalize const CL_Vec2< float > &  vector  )  [static, inherited]
 

Normalizes a vector.

Operates in the native datatype

Parameters:
vector = Vector to use
Returns:
normalized vector

CL_Vec2<float > CL_Vec2< float >::operator * float   value  )  const [inline, inherited]
 

* operator.

CL_Vec2<float > CL_Vec2< float >::operator * const CL_Vec2< float > &  vector  )  const [inline, inherited]
 

* operator.

void CL_Vec2< float >::operator *= float   value  )  [inline, inherited]
 

*= operator.

void CL_Vec2< float >::operator *= const CL_Vec2< float > &  vector  )  [inline, inherited]
 

*= operator.

CL_Vec2< float >::operator float *  )  [inline, inherited]
 

CL_Vec2< float >::operator float *const  )  const [inline, inherited]
 

bool CL_Vec2< float >::operator!= const CL_Vec2< float > &  vector  )  const [inline, inherited]
 

!= operator.

CL_Vec2<float > CL_Vec2< float >::operator+ float   value  )  const [inline, inherited]
 

+ operator.

CL_Vec2<float > CL_Vec2< float >::operator+ const CL_Vec2< float > &  vector  )  const [inline, inherited]
 

+ operator.

void CL_Vec2< float >::operator+= float   value  )  [inline, inherited]
 

+= operator.

void CL_Vec2< float >::operator+= const CL_Vec2< float > &  vector  )  [inline, inherited]
 

+= operator.

CL_Vec2<float > CL_Vec2< float >::operator-  )  const [inline, inherited]
 

  • operator.

CL_Vec2<float > CL_Vec2< float >::operator- float   value  )  const [inline, inherited]
 

  • operator.

CL_Vec2<float > CL_Vec2< float >::operator- const CL_Vec2< float > &  vector  )  const [inline, inherited]
 

  • operator.

void CL_Vec2< float >::operator-= float   value  )  [inline, inherited]
 

-= operator.

void CL_Vec2< float >::operator-= const CL_Vec2< float > &  vector  )  [inline, inherited]
 

-= operator.

CL_Vec2<float > CL_Vec2< float >::operator/ float   value  )  const [inline, inherited]
 

/ operator.

CL_Vec2<float > CL_Vec2< float >::operator/ const CL_Vec2< float > &  vector  )  const [inline, inherited]
 

/ operator.

void CL_Vec2< float >::operator/= float   value  )  [inline, inherited]
 

/= operator.

void CL_Vec2< float >::operator/= const CL_Vec2< float > &  vector  )  [inline, inherited]
 

/= operator.

bool CL_Vec2< float >::operator== const CL_Vec2< float > &  vector  )  const [inline, inherited]
 

== operator.

float & CL_Vec2< float >::operator[] unsigned int  i  )  [inline, inherited]
 

const float & CL_Vec2< float >::operator[] unsigned int  i  )  const [inline, inherited]
 

CL_Vec2<float >& CL_Vec2< float >::rotate const CL_Vec2< float > &  hotspot,
const CL_Angle angle
[inherited]
 

Rotate this vector around another point.

Parameters:
hotspot The point around which to rotate.
angle = Angle to rotate.
Returns:
reference to this object

static CL_Vec2<float > CL_Vec2< float >::rotate const CL_Vec2< float > &  vector,
const CL_Vec2< float > &  hotspot,
const CL_Angle angle
[static, inherited]
 

Rotate a vector around another point.

Parameters:
vector = Vector to use
hotspot The point around which to rotate.
angle = Angle to rotate.

CL_Vec2<float >& CL_Vec2< float >::round  )  [inherited]
 

Rounds all components of this vector.

Uses Asymmetric Arithmetic Rounding

Returns:
reference to this object

static CL_Vec2<float > CL_Vec2< float >::round const CL_Vec2< float > &  vector  )  [static, inherited]
 

Rounds all components on a vector.

Uses Asymmetric Arithmetic Rounding

Parameters:
vector = Vector to use
Returns:
The rounded vector

float CL_Vec2< float >::round_value float  value  )  const [inherited]
 

Rounds a value for the datatype.

For doubles and floats, this function does not round.

Parameters:
value = Value to round
Returns:
The rounded value


Member Data Documentation

float CL_Vec2< float >::g [inherited]
 

float CL_Vec2< float >::r [inherited]
 

float CL_Vec2< float >::s [inherited]
 

float CL_Vec2< float >::t [inherited]
 

float CL_Vec2< float >::x [inherited]
 

float CL_Vec2< float >::y [inherited]
 


The documentation for this class was generated from the following file:
Generated on Thu Dec 3 02:39:39 2009 for ClanLib by  doxygen 1.4.6