cocos2d-x  2.2
CCPointExtension.h File Reference

CCPoint extensions based on Chipmunk's cpVect file. More...

`#include "cocoa/CCGeometry.h"`
`#include <math.h>`

cocos2d

cocos2d

## Macros

#define ccp(__X__, __Y__)   cocos2d::CCPointMake((float)(__X__), (float)(__Y__))
Helper macro that creates a CCPoint. More...

## Functions

float CC_DLL  (const CCPoint &v)
Calculates distance between point an origin. More...

float CC_DLL  (const CCPoint &v1, const CCPoint &v2)
Calculates the distance between two points. More...

var  ( var v1, var v2)
Calculates the distance between two points. More...

local  ( local v1, local v2)
Calculates the distance between two points. More...

CCPoint CC_DLL  (const CCPoint &v)
Returns point multiplied to a length of 1. More...

CCPoint CC_DLL  (const float a)
Converts radians to a normalized vector. More...

float CC_DLL  (const CCPoint &v)
Converts a vector to radians. More...

float CC_DLL  (float value, float min_inclusive, float max_inclusive)
Clamp a value between from and to. More...

CCPoint CC_DLL  (const CCPoint &p, const CCPoint &from, const CCPoint &to)
Clamp a point between from and to. More...

CCPoint CC_DLL  (const CCSize &s)
Quickly convert CCSize to a CCPoint. More...

CCPoint CC_DLL  (const CCPoint &p, float(*opFunc)(float))
Run a math operation function on each point component absf, fllorf, ceilf, roundf any function that has the signature: float func(float); For example: let's try to take the floor of x,y ccpCompOp(p,floorf);. More...

CCPoint CC_DLL  (const CCPoint &a, const CCPoint &b, float alpha)
Linear Interpolation between two points a and b. More...

bool CC_DLL  (const CCPoint &a, const CCPoint &b, float variance)
CCPoint CC_DLL  (const CCPoint &a, const CCPoint &b)
Multiplies a and b components, a.x*b.x, a.y*b.y. More...

float CC_DLL  (const CCPoint &a, const CCPoint &b)
float CC_DLL  (const CCPoint &a, const CCPoint &b)
CCPoint CC_DLL  (const CCPoint &v, const CCPoint &pivot, float angle)
Rotates a point counter clockwise by the angle around a pivot. More...

bool CC_DLL  (const CCPoint &p1, const CCPoint &p2, const CCPoint &p3, const CCPoint &p4, float *s, float *t)
A general line-line intersection test. More...

bool CC_DLL  (const CCPoint &A, const CCPoint &B, const CCPoint &C, const CCPoint &D)
CCPoint CC_DLL  (const CCPoint &A, const CCPoint &B, const CCPoint &C, const CCPoint &D)

## Detailed Description

CCPoint extensions based on Chipmunk's cpVect file.

These extensions work both with CCPoint and cpVect.

The "ccp" prefix means: "CoCos2d Point"

Examples: