|
cocos2d-x
2.2.3-gd2.113-rev1ec524e
|
NA. More...
#include <CCGeometry.h>
Public Member Functions | |
| CCPoint () | |
| CCPoint (float x, float y) | |
| CCPoint (const CCPoint &other) | |
| NA. More... | |
| CCPoint (const CCSize &size) | |
| NA. More... | |
| CCPoint & | operator= (const CCPoint &other) |
| NA. More... | |
| CCPoint & | operator= (const CCSize &size) |
| NA. More... | |
| CCPoint | operator+ (const CCPoint &right) const |
| NA. More... | |
| CCPoint | operator- (const CCPoint &right) const |
| NA. More... | |
| CCPoint | operator- () const |
| NA. More... | |
| CCPoint | operator* (float a) const |
| NA. More... | |
| CCPoint | operator/ (float a) const |
| NA. More... | |
| void | setPoint (float x, float y) |
| NA. More... | |
| bool | equals (const CCPoint &target) const |
| bool | fuzzyEquals (const CCPoint &target, float variance) const |
| float | getLength () const |
| Calculates distance between point an origin. More... | |
| float | getLengthSq () const |
| Calculates the square length of a CCPoint (not calling sqrt() ) More... | |
| float | getDistanceSq (const CCPoint &other) const |
| Calculates the square distance between two points (not calling sqrt() ) More... | |
| float | getDistance (const CCPoint &other) const |
| Calculates the distance between two points. More... | |
| float | getAngle () const |
| float | getAngle (const CCPoint &other) const |
| float | dot (const CCPoint &other) const |
| Calculates dot product of two points. More... | |
| float | cross (const CCPoint &other) const |
| Calculates cross product of two points. More... | |
| CCPoint | getPerp () const |
| Calculates perpendicular of v, rotated 90 degrees counter-clockwise – cross(v, perp(v)) >= 0. More... | |
| CCPoint | getRPerp () const |
| Calculates perpendicular of v, rotated 90 degrees clockwise – cross(v, rperp(v)) <= 0. More... | |
| CCPoint | project (const CCPoint &other) const |
| Calculates the projection of this over other. More... | |
| CCPoint | rotate (const CCPoint &other) const |
| Complex multiplication of two points ("rotates" two points). More... | |
| CCPoint | unrotate (const CCPoint &other) const |
| Unrotates two points. More... | |
| CCPoint | normalize () const |
| Returns point multiplied to a length of 1. More... | |
| CCPoint | lerp (const CCPoint &other, float alpha) const |
| Linear Interpolation between two points a and b. More... | |
| CCPoint | rotateByAngle (const CCPoint &pivot, float angle) const |
| Rotates a point counter clockwise by the angle around a pivot. More... | |
| CCPoint | operator* (const CCPoint &right) const |
| CCPoint | operator/ (const CCPoint &right) const |
Static Public Member Functions | |
| static CCPoint | forAngle (const float a) |
Public Attributes | |
| float | x |
| float | y |
NA.
| CCPoint | ( | ) |
| CCPoint | ( | float | x, |
| float | y | ||
| ) |
|
inline |
Calculates cross product of two points.
|
inline |
Calculates dot product of two points.
| bool equals | ( | const CCPoint & | target | ) | const |
|
inlinestatic |
| bool fuzzyEquals | ( | const CCPoint & | target, |
| float | variance | ||
| ) | const |
|
inline |
| float getAngle | ( | const CCPoint & | other | ) | const |
|
inline |
Calculates the distance between two points.
|
inline |
Calculates the square distance between two points (not calling sqrt() )
|
inline |
Calculates distance between point an origin.
|
inline |
|
inline |
Calculates perpendicular of v, rotated 90 degrees counter-clockwise – cross(v, perp(v)) >= 0.
|
inline |
Calculates perpendicular of v, rotated 90 degrees clockwise – cross(v, rperp(v)) <= 0.
Linear Interpolation between two points a and b.
|
inline |
Returns point multiplied to a length of 1.
If the point is 0, it returns (1, 0)
| CCPoint operator* | ( | float | a | ) | const |
NA.
| CCPoint operator- | ( | ) | const |
NA.
| CCPoint operator/ | ( | float | a | ) | const |
NA.
Complex multiplication of two points ("rotates" two points).
Rotates a point counter clockwise by the angle around a pivot.
| pivot | is the pivot, naturally |
| angle | is the angle of rotation ccw in radians |
| void setPoint | ( | float | x, |
| float | y | ||
| ) |
NA.
Unrotates two points.
| float x |
| float y |