Class CCPoint

#include <Geode/cocos/cocoa/CCGeometry.h>
classCCPoint{ ... }
No description provided
Examples0
Public static methods1
staticcocos2d::CCPointforAngle()
No description provided
Public member functions33
cocos2d::CCPoint&operator=()
No description provided
cocos2d::CCPoint&operator=()
No description provided
cocos2d::CCPointoperator+()const
No description provided
cocos2d::CCPointoperator-()const
No description provided
cocos2d::CCPointoperator-()const
No description provided
cocos2d::CCPointoperator*()const
No description provided
cocos2d::CCPointoperator/()const
No description provided
cocos2d::CCPointoperator*()const
No description provided
cocos2d::CCPointoperator/()const
No description provided
voidsetPoint(,)
No description provided
boolequals()const
No description provided
boolfuzzyEquals(,)const

Since v2.1.4

No description provided
Return value
if points have fuzzy equality which means equal with some degree of variance.
floatgetLength()const

Since v2.1.4

Calculates distance between point an origin

Return value
float
floatgetLengthSq()const

Since v2.1.4

Calculates the square length of a CCPoint (not calling sqrt() )

Return value
float
floatgetDistanceSq()const

Since v2.1.4

Calculates the square distance between two points (not calling sqrt() )

Return value
float
floatgetDistance()const

Since v2.1.4

Calculates the distance between two points

Return value
float
floatgetAngle()const

Since v2.1.4

No description provided
Return value
the angle in radians between this vector and the x axis
floatgetAngle()const

Since v2.1.4

No description provided
Return value
the angle in radians between two vector directions
floatdot()const

Since v2.1.4

Calculates dot product of two points.

Return value
float
floatcross()const

Since v2.1.4

Calculates cross product of two points.

Return value
float
cocos2d::CCPointgetPerp()const

Since v2.1.4

Calculates perpendicular of v, rotated 90 degrees counter-clockwise – cross(v, perp(v)) >= 0

Return value
CCPoint
cocos2d::CCPointgetRPerp()const

Since v2.1.4

Calculates perpendicular of v, rotated 90 degrees clockwise – cross(v, rperp(v)) <= 0

Return value
CCPoint
cocos2d::CCPointproject()const

Since v2.1.4

Calculates the projection of this over other.

Return value
CCPoint
cocos2d::CCPointrotate()const

Since v2.1.4

Complex multiplication of two points (“rotates” two points).

Return value
CCPoint vector with an angle of this.getAngle() + other.getAngle(), and a length of this.getLength() * other.getLength().
cocos2d::CCPointunrotate()const

Since v2.1.4

Unrotates two points.

Return value
CCPoint vector with an angle of this.getAngle() - other.getAngle(), and a length of this.getLength() * other.getLength().
cocos2d::CCPointnormalize()const

Since v2.1.4

Returns point multiplied to a length of 1. If the point is 0, it returns (1, 0)

Return value
CCPoint
cocos2d::CCPointlerp(,
floatalpha
)
const

Since v2.1.4

Linear Interpolation between two points a and b

Return value
alpha == 0 ? a alpha == 1 ? b otherwise a value between a..b
cocos2d::CCPointrotateByAngle(,
floatangle
)
const

Since v2.1.4

Rotates a point counter clockwise by the angle around a pivot

Parameters

pivot

is the pivot, naturally

angle

is the angle of rotation ccw in radians
Return value
the rotated point
voidadd(,)
No description provided
floatat()
No description provided
boolisZero()const
No description provided
voidset(,)
No description provided
voidswap()
No description provided
Fields2
;
No description provided
;
No description provided
Protected member functions0
Protected fields0