A shape for body. More...
#include <CCPhysicsShape.h>
Public Types | |
enum | Type { UNKNOWN, CIRCLE, BOX, POLYGEN, EDGESEGMENT, EDGEBOX, EDGEPOLYGEN, EDGECHAIN } |
Public Member Functions | |
PhysicsBody * | getBody () const |
Type | getType () const |
float | getArea () const |
float | getMoment () const |
void | setMoment (float moment) |
local | setMoment ( local moment) |
void | setTag (int tag) |
int | getTag () const |
float | getMass () const |
void | setMass (float mass) |
float | getDensity () const |
void | setDensity (float density) |
void | setRestitution (float restitution) |
local | setRestitution ( local restitution) |
void | setFriction (float friction) |
void | setMaterial (const PhysicsMaterial &material) |
virtual float | calculateDefaultMoment () |
virtual float | calculateDefaultArea () |
var | calculateDefaultArea () |
local | calculateDefaultArea () |
virtual Point | getOffset () |
virtual Point | getCenter () |
local | getCenter () |
bool | containsPoint (const Point &point) const |
void | setCategoryBitmask (int bitmask) |
var | setCategoryBitmask ( var bitmask) |
local | setCategoryBitmask ( local bitmask) |
int | getCategoryBitmask () const |
void | setContactTestBitmask (int bitmask) |
int | getContactTestBitmask () const |
void | setCollisionBitmask (int bitmask) |
int | getCollisionBitmask () const |
void | setGroup (int group) |
int | getGroup () |
![]() | |
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 Point * | recenterPoints (Point *points, int count, const Point ¢er=Point::ZERO) |
local | recenterPoints ( local points, local count, local ZERO) |
static Point | getPolyonCenter (const Point *points, int count) |
var | getPolyonCenter ( var points, var count) |
local | getPolyonCenter ( local points, local count) |
Protected Member Functions | |
bool | init (Type type) |
local | init ( local type) |
PhysicsBodyInfo * | bodyInfo () const |
PhysicsShape is PhysicsBody's friend class, but all the subclasses isn't. More... | |
var | bodyInfo () |
PhysicsShape is PhysicsBody's friend class, but all the subclasses isn't. More... | |
void | setBody (PhysicsBody *body) |
PhysicsShape () | |
virtual | ~PhysicsShape ()=0 |
Protected Attributes | |
PhysicsBody * | _body |
PhysicsShapeInfo * | _info |
local | _info |
Type | _type |
float | _area |
var | _area |
local | _area |
float | _mass |
var | _mass |
local | _mass |
float | _moment |
var | _moment |
local | _moment |
PhysicsMaterial | _material |
var | _material |
local | _material |
int | _tag |
int | _categoryBitmask |
var | _categoryBitmask |
local | _categoryBitmask |
int | _collisionBitmask |
var | _collisionBitmask |
local | _collisionBitmask |
int | _contactTestBitmask |
var | _contactTestBitmask |
local | _contactTestBitmask |
int | _group |
![]() | |
unsigned int | _reference |
count of references More... | |
unsigned int | _autoReleaseCount |
count of autorelease More... | |
Friends | |
class | PhysicsWorld |
class | PhysicsBody |
class | PhysicsJoint |
class | PhysicsDebugDraw |
Additional Inherited Members | |
![]() | |
unsigned int | _ID |
object id, ScriptSupport need public _ID More... | |
int | _luaID |
Lua reference id. More... | |
A shape for body.
You do not create PhysicsWorld objects directly, instead, you can view PhysicsBody to see how to create it.
|
strong |
|
strong |
|
strong |
|
protected |
|
protected |
|
protected |
|
protectedpure virtual |
|
protectedpure virtual |
|
protectedpure virtual |
|
protected |
PhysicsShape is PhysicsBody's friend class, but all the subclasses isn't.
so this method is use for subclasses to catch the bodyInfo from PhysicsBody.
|
protected |
PhysicsShape is PhysicsBody's friend class, but all the subclasses isn't.
so this method is use for subclasses to catch the bodyInfo from PhysicsBody.
|
protected |
PhysicsShape is PhysicsBody's friend class, but all the subclasses isn't.
so this method is use for subclasses to catch the bodyInfo from PhysicsBody.
|
inlinevirtual |
Reimplemented in PhysicsShapePolygon, PhysicsShapeBox, and PhysicsShapeCircle.
|
inlinevirtual |
Reimplemented in PhysicsShapePolygon, PhysicsShapeBox, and PhysicsShapeCircle.
|
inlinevirtual |
Reimplemented in PhysicsShapePolygon, PhysicsShapeBox, and PhysicsShapeCircle.
|
inlinevirtual |
Reimplemented in PhysicsShapePolygon, PhysicsShapeBox, and PhysicsShapeCircle.
|
inlinevirtual |
Reimplemented in PhysicsShapePolygon, PhysicsShapeBox, and PhysicsShapeCircle.
|
inlinevirtual |
Reimplemented in PhysicsShapePolygon, PhysicsShapeBox, and PhysicsShapeCircle.
bool containsPoint | ( | const Point & | point) | const |
var containsPoint | ( | var | point) |
local containsPoint | ( | local | point) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
Reimplemented in PhysicsShapeEdgeChain, PhysicsShapeEdgePolygon, PhysicsShapeEdgeSegment, and PhysicsShapePolygon.
|
inlinevirtual |
Reimplemented in PhysicsShapeEdgeChain, PhysicsShapeEdgePolygon, PhysicsShapeEdgeSegment, and PhysicsShapePolygon.
|
inlinevirtual |
Reimplemented in PhysicsShapeEdgeChain, PhysicsShapeEdgePolygon, PhysicsShapeEdgeSegment, and PhysicsShapePolygon.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
Reimplemented in PhysicsShapeEdgeBox, PhysicsShapeBox, and PhysicsShapeCircle.
|
inlinevirtual |
Reimplemented in PhysicsShapeEdgeBox, PhysicsShapeBox, and PhysicsShapeCircle.
|
inlinevirtual |
Reimplemented in PhysicsShapeEdgeBox, PhysicsShapeBox, and PhysicsShapeCircle.
|
static |
|
static |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
|
protected |
|
protected |
|
static |
|
static |
|
static |
|
protected |
|
protected |
|
protected |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void setDensity | ( | float | density) |
var setDensity | ( | var | density) |
local setDensity | ( | local | density) |
void setFriction | ( | float | friction) |
var setFriction | ( | var | friction) |
local setFriction | ( | local | friction) |
void setGroup | ( | int | group) |
var setGroup | ( | var | group) |
local setGroup | ( | local | group) |
void setMass | ( | float | mass) |
var setMass | ( | var | mass) |
local setMass | ( | local | mass) |
void setMaterial | ( | const PhysicsMaterial & | material) |
var setMaterial | ( | var | material) |
local setMaterial | ( | local | material) |
void setMoment | ( | float | moment) |
var setMoment | ( | var | moment) |
local setMoment | ( | local | moment) |
void setRestitution | ( | float | restitution) |
var setRestitution | ( | var | restitution) |
local setRestitution | ( | local | restitution) |
|
inline |
|
inline |
|
inline |
|
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 |