ClanLib
2.3.7
|
2D (x,y) point structure. More...
#include <point.h>
Public Types | |
typedef Type | datatype |
Public Member Functions | |
CL_Pointx () | |
CL_Pointx (Type x, Type y) | |
CL_Pointx (const CL_Pointx< Type > &p) | |
CL_Pointx (const CL_Vec2< Type > &p) | |
Attributes | |
CL_Vec2< Type > & | normalize () |
Normalizes this vector. More... | |
Type | dot (const CL_Vec2< Type > &vector) const |
Dot products this vector with an other vector. More... | |
CL_Vec2< Type > & | round () |
Rounds all components of this vector. More... | |
CL_Vec2< Type > & | rotate (const CL_Vec2< Type > &hotspot, const CL_Angle &angle) |
Rotate this vector around another point. More... | |
Type | length () const |
Returns the length (magnitude) of this vector. More... | |
CL_Angle | angle (const CL_Vec2< Type > &vector) const |
Calculate the angle between this vector and an other vector. More... | |
CL_Angle | angle_relative (const CL_Vec2< Type > &vector) const |
Calculate the angle between this vector relative to another vector. More... | |
Type | distance (const CL_Vec2< Type > &vector) const |
Calculate the distance between this vector and an other vector. More... | |
Type | round_value (float value) const |
Rounds a value for the datatype. More... | |
Operators | |
const Type & | operator[] (unsigned int i) const |
Type & | operator[] (unsigned int i) |
operator Type * () | |
operator Type *const () const | |
void | operator+= (const CL_Vec2< Type > &vector) |
+= operator. More... | |
void | operator+= (Type value) |
+= operator. More... | |
CL_Vec2< Type > | operator+ (const CL_Vec2< Type > &vector) const |
| |
CL_Vec2< Type > | operator+ (Type value) const |
| |
void | operator-= (const CL_Vec2< Type > &vector) |
-= operator. More... | |
void | operator-= (Type value) |
-= operator. More... | |
CL_Vec2< Type > | operator- (const CL_Vec2< Type > &vector) const |
| |
CL_Vec2< Type > | operator- (Type value) const |
| |
CL_Vec2< Type > | operator- () const |
| |
void | operator*= (const CL_Vec2< Type > &vector) |
*= operator. More... | |
void | operator*= (Type value) |
*= operator. More... | |
CL_Vec2< Type > | operator* (const CL_Vec2< Type > &vector) const |
| |
CL_Vec2< Type > | operator* (Type value) const |
| |
void | operator/= (const CL_Vec2< Type > &vector) |
/= operator. More... | |
void | operator/= (Type value) |
/= operator. More... | |
CL_Vec2< Type > | operator/ (const CL_Vec2< Type > &vector) const |
/ operator. More... | |
CL_Vec2< Type > | operator/ (Type value) const |
/ operator. More... | |
bool | operator== (const CL_Vec2< Type > &vector) const |
== operator. More... | |
bool | operator!= (const CL_Vec2< Type > &vector) const |
!= operator. More... | |
Static Public Member Functions | |
static CL_Pointx< Type > | calc_origin (CL_Origin origin, const CL_Sizex< Type > &size) |
Returns the anchor point for the origin within the dimensions of the size structure. More... | |
static Type | dot (const CL_Vec2< Type > &vector_1, const CL_Vec2< Type > &vector_2) |
Dot products a vector with an other vector. More... | |
static CL_Vec2< Type > | normalize (const CL_Vec2< Type > &vector) |
Normalizes a vector. More... | |
static CL_Vec2< Type > | rotate (const CL_Vec2< Type > &vector, const CL_Vec2< Type > &hotspot, const CL_Angle &angle) |
Rotate a vector around another point. More... | |
static CL_Vec2< Type > | round (const CL_Vec2< Type > &vector) |
Rounds all components on a vector. More... | |
Public Attributes | |
union { | |
Type g | |
Type t | |
Type y | |
}; | |
union { | |
Type r | |
Type s | |
Type x | |
}; | |
2D (x,y) point structure.
These point templates are defined for: int (CL_Point), float (CL_Pointf), double (CL_Pointd)
|
inherited |
Calculate the angle between this vector and an other vector.
vector | = Second vector used to calculate angle. |
|
inherited |
Calculate the angle between this vector relative to another vector.
vector | = Second vector used to calculate angle. |
|
staticinherited |
Returns the anchor point for the origin within the dimensions of the size structure.
origin | = The origin |
size | = The size |
Referenced by CL_Rectx< int >::apply_alignment().
|
inherited |
Calculate the distance between this vector and an other vector.
vector | = Second vector used to calculate distance. |
|
inlinestaticinherited |
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. |
|
inlineinherited |
Dot products this vector with an other vector.
Operates in the native datatype
vector | Second vector used for the dot product. |
|
inherited |
Returns the length (magnitude) of this vector.
Operates in the native datatype
|
staticinherited |
Normalizes a vector.
Operates in the native datatype
vector | = Vector to use |
Normalizes this vector.
Operates in the native datatype
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
!= operator.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
*= operator.
|
inlineinherited |
*= operator.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
+= operator.
|
inlineinherited |
+= operator.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
-= operator.
|
inlineinherited |
-= operator.
|
inlineinherited |
/ operator.
|
inlineinherited |
/ operator.
|
inlineinherited |
/= operator.
|
inlineinherited |
/= operator.
|
inlineinherited |
== operator.
|
inlineinherited |
|
inlineinherited |
|
staticinherited |
Rotate a vector around another point.
vector | = Vector to use |
hotspot | The point around which to rotate. |
angle | = Angle to rotate. |
|
inherited |
Rotate this vector around another point.
hotspot | The point around which to rotate. |
angle | = Angle to rotate. |
|
staticinherited |
Rounds all components on a vector.
Uses Asymmetric Arithmetic Rounding
vector | = Vector to use |
Rounds all components of this vector.
Uses Asymmetric Arithmetic Rounding
|
inherited |
Rounds a value for the datatype.
For doubles and floats, this function does not round.
value | = Value to round |
union { ... } |
union { ... } |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Referenced by CL_Rectx< int >::apply_alignment(), CL_Rectx< int >::CL_Rectx(), CL_Vec1< Type >::CL_Vec1(), CL_Vec2< int >::CL_Vec2(), CL_Vec2< float >::CL_Vec2(), CL_Vec2< double >::CL_Vec2(), CL_Vec2< Type >::CL_Vec2(), CL_Vec3< int >::CL_Vec3(), CL_Vec4< Type >::CL_Vec4(), CL_OutlineCircle::collide(), CL_Rectx< int >::contains(), CL_Vec2< int >::dot(), CL_Vec2< int >::operator!=(), CL_Vec2< int >::operator*(), operator*(), CL_Vec2< int >::operator*=(), CL_Vec2< int >::operator+(), CL_Vec2< int >::operator+=(), CL_Vec2< int >::operator-(), CL_Vec2< int >::operator-=(), CL_Vec2< int >::operator/(), CL_Vec2< int >::operator/=(), CL_Vec2< int >::operator=(), CL_Vec2< int >::operator==(), CL_Line2x< int >::point_right_of_line(), CL_LineSegment2x< int >::point_right_of_line(), CL_Rectx< int >::set_bottom_left(), CL_Rectx< int >::set_bottom_right(), CL_Rectx< int >::set_top_left(), CL_Rectx< int >::set_top_right(), CL_ProgramObject::set_uniform2b(), CL_ProgramObject::set_uniform2f(), CL_ProgramObject::set_uniform2i(), CL_ProgramObject::set_uniform2s(), and CL_Rectx< int >::translate().
|
inherited |
Referenced by CL_Rectx< int >::apply_alignment(), CL_Rectx< int >::CL_Rectx(), CL_Vec2< int >::CL_Vec2(), CL_Vec2< double >::CL_Vec2(), CL_Vec2< float >::CL_Vec2(), CL_Vec2< Type >::CL_Vec2(), CL_Vec3< int >::CL_Vec3(), CL_Vec4< Type >::CL_Vec4(), CL_OutlineCircle::collide(), CL_Rectx< int >::contains(), CL_Vec2< int >::dot(), CL_Vec2< int >::operator!=(), CL_Vec2< int >::operator*(), operator*(), CL_Vec2< int >::operator*=(), CL_Vec2< int >::operator+(), CL_Vec2< int >::operator+=(), CL_Vec2< int >::operator-(), CL_Vec2< int >::operator-=(), CL_Vec2< int >::operator/(), CL_Vec2< int >::operator/=(), CL_Vec2< int >::operator=(), CL_Vec2< int >::operator==(), CL_Line2x< int >::point_right_of_line(), CL_LineSegment2x< int >::point_right_of_line(), CL_Rectx< int >::set_bottom_left(), CL_Rectx< int >::set_bottom_right(), CL_Rectx< int >::set_top_left(), CL_Rectx< int >::set_top_right(), CL_ProgramObject::set_uniform2b(), CL_ProgramObject::set_uniform2f(), CL_ProgramObject::set_uniform2i(), CL_ProgramObject::set_uniform2s(), and CL_Rectx< int >::translate().