A body affect by physics. More...
#include <CCPhysicsBody.h>
Public Member Functions | |
virtual PhysicsShapeCircle * | addCircle (float radius, Point offset=Point(0, 0)) |
Attach a circle shape with body. More... | |
virtual PhysicsShapeBox * | addBox (Size size, Point offset=Point(0, 0)) |
Attach a box shape with body. More... | |
virtual PhysicsShapePolygon * | addPolygon (Point *points, int count, Point offset=Point(0, 0)) |
Attach a polygon shape with body. More... | |
local | addPolygon ( local points, local count, local 0) |
Attach a polygon shape with body. More... | |
virtual PhysicsShapeEdgeSegment * | addEdgeSegment (Point a, Point b, float border=1) |
Attach a edge segment shape with body. More... | |
local | addEdgeSegment ( local a, local b, local 1) |
Attach a edge segment shape with body. More... | |
virtual PhysicsShapeEdgeBox * | addEdgeBox (Size size, float border=1, Point offset=Point(0, 0)) |
Attach a edge box shape with body. More... | |
local | addEdgeBox ( local size, local 1, local 0) |
Attach a edge box shape with body. More... | |
virtual PhysicsShapeEdgePolygon * | addEdgePolygon (Point *points, int count, float border=1) |
Attach a edge polygon shape with body points is an array of Point structs defining a convex hull with a clockwise winding. More... | |
var | addEdgePolygon ( var points, var count, var 1) |
Attach a edge polygon shape with body points is an array of Point structs defining a convex hull with a clockwise winding. More... | |
local | addEdgePolygon ( local points, local count, local 1) |
Attach a edge polygon shape with body points is an array of Point structs defining a convex hull with a clockwise winding. More... | |
virtual PhysicsShapeEdgeChain * | addEdgeChain (Point *points, int count, float border=1) |
Attach a edge chain shape with body points is an array of Point structs defining a convex hull with a clockwise winding. More... | |
virtual void | applyForce (Point force) |
Applies a immediate force to body. More... | |
virtual void | applyForce (Point force, Point offset) |
Applies a immediate force to body. More... | |
local | applyForce ( local force, local offset) |
Applies a immediate force to body. More... | |
virtual void | applyImpulse (Point impulse) |
Applies a continuous force to body. More... | |
virtual void | applyImpulse (Point impulse, Point offset) |
Applies a continuous force to body. More... | |
local | applyImpulse ( local impulse, local offset) |
Applies a continuous force to body. More... | |
virtual void | applyTorque (float torque) |
Applies a torque force to body. More... | |
var | applyTorque ( var torque) |
Applies a torque force to body. More... | |
local | applyTorque ( local torque) |
Applies a torque force to body. More... | |
std::vector< PhysicsShape * > & | getShapes () |
PhysicsShape * | getShape () |
var | getShape () |
local | getShape () |
void | removeShape (PhysicsShape *shape) |
local | removeShape ( local shape) |
void | removeAllShapes () |
PhysicsWorld * | getWorld () const |
local | getWorld () |
const std::vector < PhysicsJoint * > * | getJoints () const |
local | getJoints () |
Sprite * | getOwner () const |
local | getOwner () |
void | setCategoryBitmask (int bitmask) |
var | setCategoryBitmask ( var bitmask) |
local | setCategoryBitmask ( local bitmask) |
int | getCategoryBitmask () const |
void | setContactTestBitmask (int bitmask) |
var | setContactTestBitmask ( var bitmask) |
local | setContactTestBitmask ( local bitmask) |
int | getContactTestBitmask () const |
void | setCollisionBitmask (int bitmask) |
int | getCollisionBitmask () const |
Point | getPosition () const |
float | getRotation () const |
bool | isDynamic () |
void | setDynamic (bool dynamic) |
local | setDynamic ( local dynamic) |
void | setMass (float mass) |
float | getMass () |
void | setAngularDamping (float angularDamping) |
var | setAngularDamping ( var angularDamping) |
local | setAngularDamping ( local angularDamping) |
float | getAngularDamping () |
Public Member Functions inherited from Object | |
Object () | |
Constructor. More... | |
virtual | ~Object () |
void | release () |
Release the ownership immediately. More... | |
void | retain () |
Retains the ownership. More... | |
Object * | autorelease () |
Release the ownership sometime soon automatically. More... | |
bool | isSingleReference () const |
Returns a boolean value that indicates whether there is only one reference to the object. More... | |
unsigned int | retainCount () const |
Returns the object's current reference count. More... | |
virtual bool | isEqual (const Object *object) |
Returns a boolean value that indicates whether this object and a given object are equal. More... | |
virtual void | acceptVisitor (DataVisitor &visitor) |
virtual void | update (float dt) |
Static Public Member Functions | |
static PhysicsBody * | createCircle (float radius) |
Create a body contains a circle shape. More... | |
var | createCircle ( var radius) |
Create a body contains a circle shape. More... | |
local | createCircle ( local radius) |
Create a body contains a circle shape. More... | |
static PhysicsBody * | createBox (Size size) |
Create a body contains a box shape. More... | |
static PhysicsBody * | createPolygon (Point *points, int count) |
Create a body contains a polygon shape. More... | |
var | createPolygon ( var points, var count) |
Create a body contains a polygon shape. More... | |
local | createPolygon ( local points, local count) |
Create a body contains a polygon shape. More... | |
static PhysicsBody * | createEdgeSegment (Point a, Point b, float border=1) |
Create a body contains a EdgeSegment shape. More... | |
var | createEdgeSegment ( var a, var b, var 1) |
Create a body contains a EdgeSegment shape. More... | |
local | createEdgeSegment ( local a, local b, local 1) |
Create a body contains a EdgeSegment shape. More... | |
static PhysicsBody * | createEdgeBox (Size size, float border=1) |
Create a body contains a EdgeBox shape. More... | |
static PhysicsBody * | createEdgePolygon (Point *points, int count, float border=1) |
Create a body contains a EdgePolygon shape. More... | |
static PhysicsBody * | createEdgeChain (Point *points, int count, float border=1) |
Create a body contains a EdgeChain shape. More... | |
local | createEdgeChain ( local points, local count, local 1) |
Create a body contains a EdgeChain shape. More... | |
Protected Member Functions | |
bool | init () |
bool | initStatic () |
virtual void | setPosition (Point position) |
local | setPosition ( local position) |
virtual void | setRotation (float rotation) |
local | setRotation ( local rotation) |
virtual void | addShape (PhysicsShape *shape) |
var | addShape ( var shape) |
local | addShape ( local shape) |
PhysicsBody () | |
virtual | ~PhysicsBody () |
Friends | |
class | PhysicsWorld |
class | PhysicsShape |
class | PhysicsJoint |
class | Sprite |
Additional Inherited Members | |
Public Attributes inherited from Object | |
unsigned int | _ID |
object id, ScriptSupport need public _ID More... | |
int | _luaID |
Lua reference id. More... | |
A body affect by physics.
it can attach one or more shapes.
|
protected |
|
protected |
|
protected |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
virtual |
Attach a box shape with body.
|
virtual |
Attach a box shape with body.
|
virtual |
Attach a box shape with body.
|
virtual |
Attach a circle shape with body.
|
virtual |
Attach a circle shape with body.
|
virtual |
Attach a circle shape with body.
|
virtual |
Attach a edge box shape with body.
|
virtual |
Attach a edge box shape with body.
|
virtual |
Attach a edge box shape with body.
|
virtual |
Attach a edge chain shape with body points is an array of Point structs defining a convex hull with a clockwise winding.
|
virtual |
Attach a edge chain shape with body points is an array of Point structs defining a convex hull with a clockwise winding.
|
virtual |
Attach a edge chain shape with body points is an array of Point structs defining a convex hull with a clockwise winding.
|
virtual |
Attach a edge polygon shape with body points is an array of Point structs defining a convex hull with a clockwise winding.
|
virtual |
Attach a edge polygon shape with body points is an array of Point structs defining a convex hull with a clockwise winding.
|
virtual |
Attach a edge polygon shape with body points is an array of Point structs defining a convex hull with a clockwise winding.
|
virtual |
Attach a edge segment shape with body.
|
virtual |
Attach a edge segment shape with body.
|
virtual |
Attach a edge segment shape with body.
|
virtual |
Attach a polygon shape with body.
|
virtual |
Attach a polygon shape with body.
|
virtual |
Attach a polygon shape with body.
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
virtual |
Applies a immediate force to body.
|
virtual |
Applies a immediate force to body.
|
virtual |
Applies a immediate force to body.
|
virtual |
Applies a immediate force to body.
|
virtual |
Applies a immediate force to body.
|
virtual |
Applies a continuous force to body.
|
virtual |
Applies a continuous force to body.
|
virtual |
Applies a continuous force to body.
Applies a continuous force to body.
|
virtual |
Applies a continuous force to body.
|
virtual |
Applies a continuous force to body.
|
virtual |
Applies a torque force to body.
|
virtual |
Applies a torque force to body.
|
virtual |
Applies a torque force to body.
|
static |
Create a body contains a box shape.
|
static |
Create a body contains a box shape.
|
static |
Create a body contains a box shape.
|
static |
Create a body contains a circle shape.
|
static |
Create a body contains a circle shape.
|
static |
Create a body contains a circle shape.
|
static |
Create a body contains a EdgeBox shape.
|
static |
Create a body contains a EdgeBox shape.
|
static |
Create a body contains a EdgeBox shape.
|
static |
Create a body contains a EdgeChain shape.
|
static |
Create a body contains a EdgeChain shape.
|
static |
Create a body contains a EdgeChain shape.
|
static |
Create a body contains a EdgePolygon shape.
|
static |
Create a body contains a EdgePolygon shape.
|
static |
Create a body contains a EdgePolygon shape.
|
static |
Create a body contains a EdgeSegment shape.
|
static |
Create a body contains a EdgeSegment shape.
|
static |
Create a body contains a EdgeSegment shape.
|
static |
Create a body contains a polygon shape.
points is an array of Point structs defining a convex hull with a clockwise winding.
|
static |
Create a body contains a polygon shape.
points is an array of Point structs defining a convex hull with a clockwise winding.
|
static |
Create a body contains a polygon shape.
points is an array of Point structs defining a convex hull with a clockwise winding.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Point getPosition | ( | ) | const |
var getPosition | ( | ) |
local getPosition | ( | ) |
float getRotation | ( | ) | const |
var getRotation | ( | ) |
local getRotation | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
inline |
|
inline |
|
inline |
void removeAllShapes | ( | ) |
var removeAllShapes | ( | ) |
local removeAllShapes | ( | ) |
void removeShape | ( | PhysicsShape * | shape) |
var removeShape | ( | var | shape) |
local removeShape | ( | local | shape) |
void setAngularDamping | ( | float | angularDamping) |
var setAngularDamping | ( | var | angularDamping) |
local setAngularDamping | ( | local | angularDamping) |
void setCategoryBitmask | ( | int | bitmask) |
var setCategoryBitmask | ( | var | bitmask) |
local setCategoryBitmask | ( | local | bitmask) |
void setCollisionBitmask | ( | int | bitmask) |
var setCollisionBitmask | ( | var | bitmask) |
local setCollisionBitmask | ( | local | bitmask) |
void setContactTestBitmask | ( | int | bitmask) |
var setContactTestBitmask | ( | var | bitmask) |
local setContactTestBitmask | ( | local | bitmask) |
void setDynamic | ( | bool | dynamic) |
var setDynamic | ( | var | dynamic) |
local setDynamic | ( | local | dynamic) |
void setMass | ( | float | mass) |
var setMass | ( | var | mass) |
local setMass | ( | local | mass) |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |