Cocos2d-x  v3.15
PhysicsHelper Class Reference

A physics helper class. More...

Static Public Member Functions

static Vec2 cpv2point (const cpVect &vec)
 Make cpVect type convert to Vec2 type. More...
 
static cpVect point2cpv (const Vec2 &point)
 Make Vec2 type convert to cpVect type. More...
 
static Size cpv2size (const cpVect &vec)
 Make cpVect type convert to Size type. More...
 
static cpVect size2cpv (const Size &size)
 Make Size type convert to cpVect type. More...
 
static float cpfloat2float (cpFloat f)
 Make cpFloat type convert to float type. More...
 
static cpBB rect2cpbb (const Rect &rect)
 Make Rect type convert to cpBB type. More...
 
static Rect cpbb2rect (const cpBB &bb)
 Make cpBB type convert to Rect type. More...
 
static Vec2cpvs2points (const cpVect *cpvs, Vec2 *out, int count)
 Make cpVect array convert to Vec2 array. More...
 
static cpVect * points2cpvs (const Vec2 *points, cpVect *out, int count)
 Make Vec2 array convert to cpVect array. More...
 

Detailed Description

A physics helper class.

Support for conversion between the chipmunk types and cocos types, eg: cpVect to Vec2, cpVect to Size, cpFloat to float.

Member Function Documentation

◆ cpv2point()

static Vec2 cpv2point ( const cpVect &  vec)
inlinestatic

Make cpVect type convert to Vec2 type.

◆ point2cpv()

static cpVect point2cpv ( const Vec2 point)
inlinestatic

Make Vec2 type convert to cpVect type.

◆ cpv2size()

static Size cpv2size ( const cpVect &  vec)
inlinestatic

Make cpVect type convert to Size type.

◆ size2cpv()

static cpVect size2cpv ( const Size &  size)
inlinestatic

Make Size type convert to cpVect type.

◆ cpfloat2float()

static float cpfloat2float ( cpFloat  f)
inlinestatic

Make cpFloat type convert to float type.

◆ rect2cpbb()

static cpBB rect2cpbb ( const Rect rect)
inlinestatic

Make Rect type convert to cpBB type.

◆ cpbb2rect()

static Rect cpbb2rect ( const cpBB &  bb)
inlinestatic

Make cpBB type convert to Rect type.

◆ cpvs2points()

static Vec2* cpvs2points ( const cpVect *  cpvs,
Vec2 out,
int  count 
)
inlinestatic

Make cpVect array convert to Vec2 array.

Parameters
cpvsThe be converted object, it's a cpVect array.
outThe converted object, it's a Vec2 array.
countIt's cpvs array length.
Returns
The out object's pointer.

◆ points2cpvs()

static cpVect* points2cpvs ( const Vec2 points,
cpVect *  out,
int  count 
)
inlinestatic

Make Vec2 array convert to cpVect array.

Parameters
pointsThe be converted object, it's a Vec2 array.
outThe converted object, it's a cpVect array.
countIt's points array length.
Returns
The out object's pointer.

The documentation for this class was generated from the following file: