Files
Class List
Class Members
Class Hierarchy
cyPoint2f Class Reference
#include <cyPoint.h>
List of all members.
Detailed Description
2D point class
Public Member Functions
Constructors
cyPoint2f
(float _x, float _y)
cyPoint2f
(const float *pt)
cyPoint2f
(const
cyPoint2f
&pt)
Set & Get value functions
cyPoint2f
&
Zero
()
Sets x and y coordinates as zero.
cyPoint2f
&
Set
(float _x, float _y)
Sets x and y coordinates as given.
cyPoint2f
&
Set
(const float *v)
Sets x and y coordinates using the values in the given array.
void
GetValue
(float *v) const
Puts x and y values into the array.
Length and Normalize functions
void
Normalize
()
cyPoint2f
GetNormalized
() const
float
LengthSquared
() const
float
Length
() const
Limit functions
void
ClampMinMax
(float minValue, float maxValue)
void
ClampMin
(float n)
void
ClampMax
(float n)
Unary operators
cyPoint2f
operator-
() const
cyPoint2f
operator+
() const
Binary operators
cyPoint2f
operator+
(const
cyPoint2f
&pt) const
cyPoint2f
operator-
(const
cyPoint2f
&pt) const
cyPoint2f
operator *
(const
cyPoint2f
&pt) const
cyPoint2f
operator/
(const
cyPoint2f
&pt) const
cyPoint2f
operator+
(float n) const
cyPoint2f
operator-
(float n) const
cyPoint2f
operator *
(float n) const
cyPoint2f
operator/
(float n) const
Assignment operators
cyPoint2f
&
operator+=
(const
cyPoint2f
&pt)
cyPoint2f
&
operator-=
(const
cyPoint2f
&pt)
cyPoint2f
&
operator *=
(const
cyPoint2f
&pt)
cyPoint2f
&
operator/=
(const
cyPoint2f
&pt)
cyPoint2f
&
operator+=
(float n)
cyPoint2f
&
operator-=
(float n)
cyPoint2f
&
operator *=
(float n)
cyPoint2f
&
operator/=
(float n)
Test operators
int
operator==
(const
cyPoint2f
&pt) const
int
operator!=
(const
cyPoint2f
&pt) const
Access operators
float &
operator[]
(int i)
float
operator[]
(int i) const
Cross product and dot product
float
Cross
(const
cyPoint2f
&pt) const
Cross product.
float
operator^
(const
cyPoint2f
&pt) const
Cross product operator.
float
Dot
(const
cyPoint2f
&pt) const
Dot product.
float
operator%
(const
cyPoint2f
&pt) const
Dot product operator.
Public Attributes
float
x
float
y
Friends
cyPoint2f
operator+
(const float v, const
cyPoint2f
&pt)
Addition with a constant.
cyPoint2f
operator-
(const float v, const
cyPoint2f
&pt)
Subtraction from a constant.
cyPoint2f
operator *
(const float v, const
cyPoint2f
&pt)
Multiplication with a constant.