2D (x,y) point structure - Integer More...
#include <point.h>
Public Types | |
typedef int | datatype |
Public Member Functions | |
CL_Point () | |
CL_Point (const CL_Vec2< int > &p) | |
CL_Point (const CL_Pointx< int > &p) | |
CL_Point (int x, int y) | |
Attributes | |
CL_Vec2< int > & | normalize () |
Normalizes this vector. | |
int | dot (const CL_Vec2< int > &vector) const |
Dot products this vector with an other vector. | |
CL_Vec2< int > & | round () |
Rounds all components of this vector. | |
CL_Vec2< int > & | rotate (const CL_Vec2< int > &hotspot, const CL_Angle &angle) |
Rotate this vector around another point. | |
int | length () const |
Returns the length (magnitude) of this vector. | |
CL_Angle | angle (const CL_Vec2< int > &vector) const |
Calculate the angle between this vector and an other vector. | |
CL_Angle | angle_relative (const CL_Vec2< int > &vector) const |
Calculate the angle between this vector relative to another vector. | |
int | distance (const CL_Vec2< int > &vector) const |
Calculate the distance between this vector and an other vector. | |
int | round_value (float value) const |
Rounds a value for the datatype. | |
Operators | |
const int & | operator[] (unsigned int i) const |
int & | operator[] (unsigned int i) |
operator int * () | |
operator int *const () const | |
void | operator+= (const CL_Vec2< int > &vector) |
+= operator. | |
void | operator+= (intvalue) |
+= operator. | |
CL_Vec2< int > | operator+ (const CL_Vec2< int > &vector) const |
+ operator. | |
CL_Vec2< int > | operator+ (intvalue) const |
+ operator. | |
void | operator-= (const CL_Vec2< int > &vector) |
-= operator. | |
void | operator-= (intvalue) |
-= operator. | |
CL_Vec2< int > | operator- (const CL_Vec2< int > &vector) const |
| |
CL_Vec2< int > | operator- (intvalue) const |
| |
CL_Vec2< int > | operator- () const |
| |
void | operator*= (const CL_Vec2< int > &vector) |
*= operator. | |
void | operator*= (intvalue) |
*= operator. | |
CL_Vec2< int > | operator* (const CL_Vec2< int > &vector) const |
* operator. | |
CL_Vec2< int > | operator* (intvalue) const |
* operator. | |
void | operator/= (const CL_Vec2< int > &vector) |
/= operator. | |
void | operator/= (intvalue) |
/= operator. | |
CL_Vec2< int > | operator/ (const CL_Vec2< int > &vector) const |
/ operator. | |
CL_Vec2< int > | operator/ (intvalue) const |
/ operator. | |
bool | operator== (const CL_Vec2< int > &vector) const |
== operator. | |
bool | operator!= (const CL_Vec2< int > &vector) const |
!= operator. | |
Static Public Member Functions | |
static CL_Pointx< int > | calc_origin (CL_Origin origin, const CL_Sizex< int > &size) |
Returns the anchor point for the origin within the dimensions of the size structure. | |
static int | dot (const CL_Vec2< int > &vector_1, const CL_Vec2< int > &vector_2) |
Dot products a vector with an other vector. | |
static CL_Vec2< int > | normalize (const CL_Vec2< int > &vector) |
Normalizes a vector. | |
static CL_Vec2< int > | rotate (const CL_Vec2< int > &vector, const CL_Vec2< int > &hotspot, const CL_Angle &angle) |
Rotate a vector around another point. | |
static CL_Vec2< int > | round (const CL_Vec2< int > &vector) |
Rounds all components on a vector. | |
Public Attributes | |
union { | |
Type g | |
Type t | |
Type y | |
}; | |
union { | |
Type r | |
Type s | |
Type x | |
}; | |
int | g |
int | r |
int | s |
int | t |
int | x |
int | y |
2D (x,y) point structure - Integer
CL_Point::CL_Point | ( | ) | [inline] |
CL_Point::CL_Point | ( | int | x, | |
int | y | |||
) | [inline] |
CL_Point::CL_Point | ( | const CL_Pointx< int > & | p | ) | [inline] |
CL_Point::CL_Point | ( | const CL_Vec2< int > & | p | ) | [inline] |
Calculate the angle between this vector and an other vector.
vector | = Second vector used to calculate angle. |
Calculate the angle between this vector relative to another vector.
vector | = Second vector used to calculate angle. |
static CL_Pointx<int > CL_Vec2< int >::calc_origin | ( | CL_Origin | origin, | |
const CL_Sizex< int > & | size | |||
) | [static, inherited] |
Returns the anchor point for the origin within the dimensions of the size structure.
origin | = The origin | |
size | = The size |
Calculate the distance between this vector and an other vector.
vector | = Second vector used to calculate distance. |
Dot products this vector with an other vector.
Operates in the native datatype
vector | Second vector used for the dot product. |
References CL_Vec2< Type >::x, and CL_Vec2< Type >::y.
static int CL_Vec2< int >::dot | ( | const CL_Vec2< int > & | vector_1, | |
const CL_Vec2< int > & | vector_2 | |||
) | [inline, static, inherited] |
Dot products a vector with an other vector.
Operates in the native datatype
vector_1 | = First vector used for the dot product. | |
vector_2 | = Second vector used for the dot product. |
References CL_Vec2< Type >::x, and CL_Vec2< Type >::y.
int CL_Vec2< int >::length | ( | ) | const [inherited] |
Returns the length (magnitude) of this vector.
Operates in the native datatype
Normalizes this vector.
Operates in the native datatype
static CL_Vec2<int > CL_Vec2< int >::normalize | ( | const CL_Vec2< int > & | vector | ) | [static, inherited] |
Normalizes a vector.
Operates in the native datatype
vector | = Vector to use |
CL_Vec2< int >::operator int * | ( | ) | [inline, inherited] |
CL_Vec2< int >::operator int *const | ( | ) | const [inline, inherited] |
!= operator.
References CL_Vec2< Type >::x, and CL_Vec2< Type >::y.
* operator.
References CL_Vec2< Type >::x, and CL_Vec2< Type >::y.
* operator.
References CL_Vec2< Type >::x, and CL_Vec2< Type >::y.
*= operator.
References CL_Vec2< Type >::x, and CL_Vec2< Type >::y.
void CL_Vec2< int >::operator*= | ( | int | value | ) | [inline, inherited] |
*= operator.
References CL_Vec2< Type >::x, and CL_Vec2< Type >::y.
+ operator.
References CL_Vec2< Type >::x, and CL_Vec2< Type >::y.
+ operator.
References CL_Vec2< Type >::x, and CL_Vec2< Type >::y.
+= operator.
References CL_Vec2< Type >::x, and CL_Vec2< Type >::y.
void CL_Vec2< int >::operator+= | ( | int | value | ) | [inline, inherited] |
+= operator.
References CL_Vec2< Type >::x, and CL_Vec2< Type >::y.
References CL_Vec2< Type >::x, and CL_Vec2< Type >::y.
References CL_Vec2< Type >::x, and CL_Vec2< Type >::y.
References CL_Vec2< Type >::x, and CL_Vec2< Type >::y.
-= operator.
References CL_Vec2< Type >::x, and CL_Vec2< Type >::y.
void CL_Vec2< int >::operator-= | ( | int | value | ) | [inline, inherited] |
-= operator.
References CL_Vec2< Type >::x, and CL_Vec2< Type >::y.
/ operator.
References CL_Vec2< Type >::x, and CL_Vec2< Type >::y.
/ operator.
References CL_Vec2< Type >::x, and CL_Vec2< Type >::y.
/= operator.
References CL_Vec2< Type >::x, and CL_Vec2< Type >::y.
void CL_Vec2< int >::operator/= | ( | int | value | ) | [inline, inherited] |
/= operator.
References CL_Vec2< Type >::x, and CL_Vec2< Type >::y.
== operator.
References CL_Vec2< Type >::x, and CL_Vec2< Type >::y.
const int & CL_Vec2< int >::operator[] | ( | unsigned int | i | ) | const [inline, inherited] |
int & CL_Vec2< int >::operator[] | ( | unsigned int | i | ) | [inline, inherited] |
static CL_Vec2<int > CL_Vec2< int >::rotate | ( | const CL_Vec2< int > & | vector, | |
const CL_Vec2< int > & | hotspot, | |||
const CL_Angle & | angle | |||
) | [static, inherited] |
Rotate a vector around another point.
vector | = Vector to use | |
hotspot | The point around which to rotate. | |
angle | = Angle to rotate. |
CL_Vec2<int >& CL_Vec2< int >::rotate | ( | const CL_Vec2< int > & | hotspot, | |
const CL_Angle & | angle | |||
) | [inherited] |
Rotate this vector around another point.
hotspot | The point around which to rotate. | |
angle | = Angle to rotate. |
Rounds all components on a vector.
Uses Asymmetric Arithmetic Rounding
vector | = Vector to use |
Rounds all components of this vector.
Uses Asymmetric Arithmetic Rounding
int CL_Vec2< int >::round_value | ( | float | value | ) | const [inherited] |
Rounds a value for the datatype.
For doubles and floats, this function does not round.
value | = Value to round |
union { ... } [inherited] |
union { ... } [inherited] |