Cocos2d-x  v3.12
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
PhysicsShapeEdgeChain Class Reference

A chain shape. More...

Inherits PhysicsShape.

Public Member Functions

virtual Vec2 getCenter () override
 Get this chain's center position. More...
 
void getPoints (Vec2 *outPoints) const
 Get this chain's points array. More...
 
int getPointsCount () const
 Get this chain's points array count. More...
 
- Public Member Functions inherited from PhysicsShape
PhysicsBodygetBody () const
 Get the body that this shape attaches. More...
 
Type getType () const
 Return this shape's type. More...
 
float getArea () const
 Return this shape's area. More...
 
float getMoment () const
 Get this shape's moment. More...
 
void setMoment (float moment)
 Set this shape's moment. More...
 
void setTag (int tag)
 Set this shape's tag. More...
 
int getTag () const
 Get this shape's tag. More...
 
float getMass () const
 Get the mass of this shape. More...
 
void setMass (float mass)
 Set this shape's mass. More...
 
float getDensity () const
 Get this shape's density. More...
 
void setDensity (float density)
 Set this shape's density. More...
 
float getRestitution () const
 Get this shape's restitution. More...
 
void setRestitution (float restitution)
 Set this shape's restitution. More...
 
float getFriction () const
 Get this shape's friction. More...
 
void setFriction (float friction)
 Set this shape's friction. More...
 
const PhysicsMaterial & getMaterial () const
 Get this shape's PhysicsMaterial object. More...
 
local getMaterial ()
 Get this shape's PhysicsMaterial object. More...
 
void setMaterial (const PhysicsMaterial &material)
 Set this shape's material. More...
 
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 this shape's position offset. More...
 
bool containsPoint (const Vec2 &point) const
 Test point is inside this shape or not. More...
 
void setCategoryBitmask (int bitmask)
 Set a mask that defines which categories this physics shape belongs to. More...
 
int getCategoryBitmask () const
 Get a mask that defines which categories this physics shape belongs to. More...
 
void setContactTestBitmask (int bitmask)
 A mask that defines which categories of bodies cause intersection notifications with this physics shape. More...
 
int getContactTestBitmask () const
 Get a mask that defines which categories of bodies cause intersection notifications with this physics shape. More...
 
void setCollisionBitmask (int bitmask)
 A mask that defines which categories of physics bodies can collide with this physics shape. More...
 
int getCollisionBitmask () const
 Get a mask that defines which categories of physics bodies can collide with this physics shape. More...
 
void setGroup (int group)
 Set the group of shape. More...
 
int getGroup ()
 Get the group of shape. More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
local 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...
 
local getReferenceCount ()
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor.
 

Static Public Member Functions

static PhysicsShapeEdgeChaincreate (const Vec2 *points, int count, const PhysicsMaterial &material=PHYSICSSHAPE_MATERIAL_DEFAULT, float border=1)
 Creates a PhysicsShapeEdgeChain with specified value. More...
 
var create ( var points, var count, var PHYSICSSHAPE_MATERIAL_DEFAULT, var 1)
 Creates a PhysicsShapeEdgeChain with specified value. More...
 
local create ( local points, local count, local PHYSICSSHAPE_MATERIAL_DEFAULT, local 1)
 Creates a PhysicsShapeEdgeChain with specified value. More...
 
- 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...
 
var recenterPoints ( var points, var count, var 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...
 

Additional Inherited Members

- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
local _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
local _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
local _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 
local _rooted
 When true, it means that the object was already rooted.
 
bool _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 
local _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 

Detailed Description

A chain shape.

Member Function Documentation

static PhysicsShapeEdgeChain*
create
( const Vec2 points,
int  count,
const PhysicsMaterial &  material = PHYSICSSHAPE_MATERIAL_DEFAULT,
float  border = 1 
)
static

Creates a PhysicsShapeEdgeChain with specified value.

A Vec2 object pointer, it contains an array of points. An interger number, contains the count of the points array. A PhysicsMaterial object, the default value is PHYSICSSHAPE_MATERIAL_DEFAULT. It's a edge's border width. An autoreleased PhysicsShapeEdgeChain object pointer.

var create ( var  points,
var  count,
var  material = PHYSICSSHAPE_MATERIAL_DEFAULT,
var  border = 1 
)
static

Creates a PhysicsShapeEdgeChain with specified value.

A Vec2 object pointer, it contains an array of points. An interger number, contains the count of the points array. A PhysicsMaterial object, the default value is PHYSICSSHAPE_MATERIAL_DEFAULT. It's a edge's border width. An autoreleased PhysicsShapeEdgeChain object pointer.

local create ( local  points,
local  count,
local  material = PHYSICSSHAPE_MATERIAL_DEFAULT,
local  border = 1 
)
static

Creates a PhysicsShapeEdgeChain with specified value.

A Vec2 object pointer, it contains an array of points. An interger number, contains the count of the points array. A PhysicsMaterial object, the default value is PHYSICSSHAPE_MATERIAL_DEFAULT. It's a edge's border width. An autoreleased PhysicsShapeEdgeChain object pointer.

virtual Vec2 getCenter ( )
overridevirtual

Get this chain's center position.

A Vec2 object.

Reimplemented from PhysicsShape.

var getCenter ( )
overridevirtual

Get this chain's center position.

A Vec2 object.

Reimplemented from PhysicsShape.

local getCenter ( )
overridevirtual

Get this chain's center position.

A Vec2 object.

Reimplemented from PhysicsShape.

void getPoints ( Vec2 outPoints) const

Get this chain's points array.

A Vec2 array pointer.

var getPoints ( var  outPoints)

Get this chain's points array.

A Vec2 array pointer.

local getPoints ( local  outPoints)

Get this chain's points array.

A Vec2 array pointer.

int getPointsCount ( ) const

Get this chain's points array count.

An interger number.

var getPointsCount ( )

Get this chain's points array count.

An interger number.

local getPointsCount ( )

Get this chain's points array count.

An interger number.


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