cocos2d-x  3.2alpha0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PhysicsShapeEdgeChain Class Reference

a chain shape More...

#include <CCPhysicsShape.h>

Inheritance diagram for PhysicsShapeEdgeChain:
PhysicsShape Ref

Public Member Functions

virtual Vec2 getCenter () override
 Get center of this shape. More...
 
void getPoints (Vec2 *outPoints) const
int getPointsCount () const
- Public Member Functions inherited from PhysicsShape
PhysicsBodygetBody () const
 Get the body that this shape attaches. More...
 
Type getType () const
 Return the type of this shape. More...
 
float getArea () const
 return the area of this shape More...
 
float getMoment () const
 get moment More...
 
void setMoment (float moment)
 Set moment, it will change the body's moment this shape attaches. More...
 
void setTag (int tag)
int getTag () const
float getMass () const
 get mass More...
 
void setMass (float mass)
 Set mass, it will change the body's mass this shape attaches. More...
 
float getDensity () const
void setDensity (float density)
float getRestitution () const
void setRestitution (float restitution)
float getFriction () const
void setFriction (float friction)
const PhysicsMaterialgetMaterial () const
local getMaterial ()
void setMaterial (const PhysicsMaterial &material)
virtual float calculateDefaultMoment ()
 Calculate the default moment value. More...
 
var calculateDefaultMoment ()
 Calculate the default moment value. More...
 
local calculateDefaultMoment ()
 Calculate the default moment value. More...
 
virtual Vec2 getOffset ()
 Get offset. More...
 
bool containsPoint (const Vec2 &point) const
 Test point is in shape or not. More...
 
void setCategoryBitmask (int bitmask)
 A mask that defines which categories this physics body belongs to. More...
 
int getCategoryBitmask () const
void setContactTestBitmask (int bitmask)
 A mask that defines which categories of bodies cause intersection notifications with this physics body. More...
 
int getContactTestBitmask () const
void setCollisionBitmask (int bitmask)
 A mask that defines which categories of physics bodies can collide with this physics body. More...
 
int getCollisionBitmask () const
void setGroup (int group)
int getGroup ()
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()

Static Public Member Functions

static PhysicsShapeEdgeChaincreate (const Vec2 *points, int count, const PhysicsMaterial &material=PHYSICSSHAPE_MATERIAL_DEFAULT, float border=1)
var create ( var points, var count, var PHYSICSSHAPE_MATERIAL_DEFAULT, var 1)
local create ( local points, local count, local PHYSICSSHAPE_MATERIAL_DEFAULT, local 1)
- Static Public Member Functions inherited from PhysicsShape
static void recenterPoints (Vec2 *points, int count, const Vec2 &center=Vec2::ZERO)
 move the points to the center More...
 
local recenterPoints ( local points, local count, local ZERO)
 move the points to the center More...
 
static Vec2 getPolyonCenter (const Vec2 *points, int count)
 get center of the polyon points More...
 

Protected Member Functions

bool init (const Vec2 *points, int count, const PhysicsMaterial &material=PHYSICSSHAPE_MATERIAL_DEFAULT, float border=1)
var init ( var points, var count, var PHYSICSSHAPE_MATERIAL_DEFAULT, var 1)
local init ( local points, local count, local PHYSICSSHAPE_MATERIAL_DEFAULT, local 1)
 PhysicsShapeEdgeChain ()
virtual ~PhysicsShapeEdgeChain ()
- Protected Member Functions inherited from PhysicsShape
bool init (Type type)
PhysicsBodyInfobodyInfo () const
 PhysicsShape is PhysicsBody's friend class, but all the subclasses isn't. More...
 
local bodyInfo ()
 PhysicsShape is PhysicsBody's friend class, but all the subclasses isn't. More...
 
void setBody (PhysicsBody *body)
virtual float calculateArea ()
 calculate the area of this shape More...
 
 PhysicsShape ()
virtual ~PhysicsShape ()=0
- Protected Member Functions inherited from Ref
 Ref ()
 Constructor. More...
 
 Ref ()
 Constructor. More...
 

Protected Attributes

Vec2 _center
- Protected Attributes inherited from PhysicsShape
PhysicsBody_body
PhysicsShapeInfo_info
Type _type
float _area
float _mass
float _moment
PhysicsMaterial _material
int _tag
int _categoryBitmask
int _collisionBitmask
int _contactTestBitmask
int _group
- Protected Attributes inherited from Ref
unsigned int _referenceCount
 count of references More...
 
local _referenceCount
 count of references More...
 

Friends

class PhysicsBody

Additional Inherited Members

- Public Types inherited from PhysicsShape
enum  Type {
  UNKNOWN, CIRCLE, BOX, POLYGEN,
  EDGESEGMENT, EDGEBOX, EDGEPOLYGEN, EDGECHAIN
}
 

Detailed Description

a chain shape

Constructor & Destructor Documentation

PhysicsShapeEdgeChain ( )
protected
var PhysicsShapeEdgeChain ( )
protected
local PhysicsShapeEdgeChain ( )
protected
virtual ~PhysicsShapeEdgeChain ( )
protectedvirtual
var ~PhysicsShapeEdgeChain ( )
protectedvirtual
local ~PhysicsShapeEdgeChain ( )
protectedvirtual

Member Function Documentation

static PhysicsShapeEdgeChain*
create
( const Vec2 points,
int  count,
const PhysicsMaterial material = PHYSICSSHAPE_MATERIAL_DEFAULT,
float  border = 1 
)
static
var create ( var  points,
var  count,
var  material = PHYSICSSHAPE_MATERIAL_DEFAULT,
var  border = 1 
)
static
local create ( local  points,
local  count,
local  material = PHYSICSSHAPE_MATERIAL_DEFAULT,
local  border = 1 
)
static
virtual Vec2 getCenter ( )
overridevirtual

Get center of this shape.

Reimplemented from PhysicsShape.

var getCenter ( )
overridevirtual

Get center of this shape.

Reimplemented from PhysicsShape.

local getCenter ( )
overridevirtual

Get center of this shape.

Reimplemented from PhysicsShape.

void getPoints ( Vec2 outPoints) const
var getPoints ( var  outPoints)
local getPoints ( local  outPoints)
int getPointsCount ( ) const
var getPointsCount ( )
local getPointsCount ( )
bool init ( const Vec2 points,
int  count,
const PhysicsMaterial material = PHYSICSSHAPE_MATERIAL_DEFAULT,
float  border = 1 
)
protected
var init ( var  points,
var  count,
var  material = PHYSICSSHAPE_MATERIAL_DEFAULT,
var  border = 1 
)
protected
local init ( local  points,
local  count,
local  material = PHYSICSSHAPE_MATERIAL_DEFAULT,
local  border = 1 
)
protected

Friends And Related Function Documentation

friend class PhysicsBody
friend
var PhysicsBody
friend
local PhysicsBody
friend

Member Data Documentation

Vec2 _center
protected
var _center
protected
local _center
protected

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