Visit Cem Yuksel's web site

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
cyPoint2fZero ()
 Sets x and y coordinates as zero.
cyPoint2fSet (float _x, float _y)
 Sets x and y coordinates as given.
cyPoint2fSet (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
cyPoint2foperator+= (const cyPoint2f &pt)
cyPoint2foperator-= (const cyPoint2f &pt)
cyPoint2foperator *= (const cyPoint2f &pt)
cyPoint2foperator/= (const cyPoint2f &pt)
cyPoint2foperator+= (float n)
cyPoint2foperator-= (float n)
cyPoint2foperator *= (float n)
cyPoint2foperator/= (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.

Visit Cem Yuksel's website!