A shape for body.
More...
#include <CCPhysicsShape.h>
A shape for body.
You do not create PhysicsWorld objects directly, instead, you can view PhysicsBody to see how to create it.
Enumerator |
---|
UNKNOWN |
|
CIRCLE |
|
BOX |
|
POLYGEN |
|
EDGESEGMENT |
|
EDGEBOX |
|
EDGEPOLYGEN |
|
EDGECHAIN |
|
Enumerator |
---|
UNKNOWN |
|
CIRCLE |
|
BOX |
|
POLYGEN |
|
EDGESEGMENT |
|
EDGEBOX |
|
EDGEPOLYGEN |
|
EDGECHAIN |
|
Enumerator |
---|
UNKNOWN |
|
CIRCLE |
|
BOX |
|
POLYGEN |
|
EDGESEGMENT |
|
EDGEBOX |
|
EDGEPOLYGEN |
|
EDGECHAIN |
|
virtual float calculateArea |
( |
| ) |
|
|
inlineprotectedvirtual |
virtual float
calculateDefaultMoment |
( |
| ) |
|
|
inlinevirtual |
var calculateDefaultMoment |
( |
| ) |
|
|
inlinevirtual |
local calculateDefaultMoment |
( |
| ) |
|
|
inlinevirtual |
bool containsPoint |
( |
const Vec2 & |
point | ) |
const |
Test point is in shape or not.
var containsPoint |
( |
var |
point | ) |
|
Test point is in shape or not.
local containsPoint |
( |
local |
point | ) |
|
Test point is in shape or not.
return the area of this shape
return the area of this shape
return the area of this shape
Get the body that this shape attaches.
int getCategoryBitmask |
( |
| ) |
const |
|
inline |
var getCategoryBitmask |
( |
| ) |
|
|
inline |
local getCategoryBitmask |
( |
| ) |
|
|
inline |
virtual Vec2 getCenter |
( |
| ) |
|
|
inlinevirtual |
int getCollisionBitmask |
( |
| ) |
const |
|
inline |
var getCollisionBitmask |
( |
| ) |
|
|
inline |
local getCollisionBitmask |
( |
| ) |
|
|
inline |
int getContactTestBitmask |
( |
| ) |
const |
|
inline |
var getContactTestBitmask |
( |
| ) |
|
|
inline |
local getContactTestBitmask |
( |
| ) |
|
|
inline |
float getDensity |
( |
| ) |
const |
|
inline |
float getFriction |
( |
| ) |
const |
|
inline |
float getMoment |
( |
| ) |
const |
|
inline |
virtual Vec2 getOffset |
( |
| ) |
|
|
inlinevirtual |
static Vec2 getPolyonCenter |
( |
const Vec2 * |
points, |
|
|
int |
count |
|
) |
| |
|
static |
get center of the polyon points
var getPolyonCenter |
( |
var |
points, |
|
|
var |
count |
|
) |
| |
|
static |
get center of the polyon points
local getPolyonCenter |
( |
local |
points, |
|
|
local |
count |
|
) |
| |
|
static |
get center of the polyon points
float getRestitution |
( |
| ) |
const |
|
inline |
Return the type of this shape.
Return the type of this shape.
Return the type of this shape.
move the points to the center
var recenterPoints |
( |
var |
points, |
|
|
var |
count, |
|
|
var |
center = Vec2::ZERO |
|
) |
| |
|
static |
move the points to the center
local recenterPoints |
( |
local |
points, |
|
|
local |
count, |
|
|
local |
center = Vec2::ZERO |
|
) |
| |
|
static |
move the points to the center
local setBody |
( |
local |
body | ) |
|
|
protected |
void setCategoryBitmask |
( |
int |
bitmask | ) |
|
|
inline |
A mask that defines which categories this physics body belongs to.
Every physics body in a scene can be assigned to up to 32 different categories, each corresponding to a bit in the bit mask. You define the mask values used in your game. In conjunction with the collisionBitMask and contactTestBitMask properties, you define which physics bodies interact with each other and when your game is notified of these interactions. The default value is 0xFFFFFFFF (all bits set).
var setCategoryBitmask |
( |
var |
bitmask | ) |
|
|
inline |
A mask that defines which categories this physics body belongs to.
Every physics body in a scene can be assigned to up to 32 different categories, each corresponding to a bit in the bit mask. You define the mask values used in your game. In conjunction with the collisionBitMask and contactTestBitMask properties, you define which physics bodies interact with each other and when your game is notified of these interactions. The default value is 0xFFFFFFFF (all bits set).
local setCategoryBitmask |
( |
local |
bitmask | ) |
|
|
inline |
A mask that defines which categories this physics body belongs to.
Every physics body in a scene can be assigned to up to 32 different categories, each corresponding to a bit in the bit mask. You define the mask values used in your game. In conjunction with the collisionBitMask and contactTestBitMask properties, you define which physics bodies interact with each other and when your game is notified of these interactions. The default value is 0xFFFFFFFF (all bits set).
void setCollisionBitmask |
( |
int |
bitmask | ) |
|
|
inline |
A mask that defines which categories of physics bodies can collide with this physics body.
When two physics bodies contact each other, a collision may occur. This body’s collision mask is compared to the other body’s category mask by performing a logical AND operation. If the result is a non-zero value, then this body is affected by the collision. Each body independently chooses whether it wants to be affected by the other body. For example, you might use this to avoid collision calculations that would make negligible changes to a body’s velocity. The default value is 0xFFFFFFFF (all bits set).
var setCollisionBitmask |
( |
var |
bitmask | ) |
|
|
inline |
A mask that defines which categories of physics bodies can collide with this physics body.
When two physics bodies contact each other, a collision may occur. This body’s collision mask is compared to the other body’s category mask by performing a logical AND operation. If the result is a non-zero value, then this body is affected by the collision. Each body independently chooses whether it wants to be affected by the other body. For example, you might use this to avoid collision calculations that would make negligible changes to a body’s velocity. The default value is 0xFFFFFFFF (all bits set).
local setCollisionBitmask |
( |
local |
bitmask | ) |
|
|
inline |
A mask that defines which categories of physics bodies can collide with this physics body.
When two physics bodies contact each other, a collision may occur. This body’s collision mask is compared to the other body’s category mask by performing a logical AND operation. If the result is a non-zero value, then this body is affected by the collision. Each body independently chooses whether it wants to be affected by the other body. For example, you might use this to avoid collision calculations that would make negligible changes to a body’s velocity. The default value is 0xFFFFFFFF (all bits set).
void setContactTestBitmask |
( |
int |
bitmask | ) |
|
|
inline |
A mask that defines which categories of bodies cause intersection notifications with this physics body.
When two bodies share the same space, each body’s category mask is tested against the other body’s contact mask by performing a logical AND operation. If either comparison results in a non-zero value, an PhysicsContact object is created and passed to the physics world’s delegate. For best performance, only set bits in the contacts mask for interactions you are interested in. The default value is 0x00000000 (all bits cleared).
var setContactTestBitmask |
( |
var |
bitmask | ) |
|
|
inline |
A mask that defines which categories of bodies cause intersection notifications with this physics body.
When two bodies share the same space, each body’s category mask is tested against the other body’s contact mask by performing a logical AND operation. If either comparison results in a non-zero value, an PhysicsContact object is created and passed to the physics world’s delegate. For best performance, only set bits in the contacts mask for interactions you are interested in. The default value is 0x00000000 (all bits cleared).
local setContactTestBitmask |
( |
local |
bitmask | ) |
|
|
inline |
A mask that defines which categories of bodies cause intersection notifications with this physics body.
When two bodies share the same space, each body’s category mask is tested against the other body’s contact mask by performing a logical AND operation. If either comparison results in a non-zero value, an PhysicsContact object is created and passed to the physics world’s delegate. For best performance, only set bits in the contacts mask for interactions you are interested in. The default value is 0x00000000 (all bits cleared).
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 | ) |
|
Set mass, it will change the body's mass this shape attaches.
Set mass, it will change the body's mass this shape attaches.
local setMass |
( |
local |
mass | ) |
|
Set mass, it will change the body's mass this shape attaches.
var setMaterial |
( |
var |
material | ) |
|
local setMaterial |
( |
local |
material | ) |
|
void setMoment |
( |
float |
moment | ) |
|
Set moment, it will change the body's moment this shape attaches.
var setMoment |
( |
var |
moment | ) |
|
Set moment, it will change the body's moment this shape attaches.
local setMoment |
( |
local |
moment | ) |
|
Set moment, it will change the body's moment this shape attaches.
void setRestitution |
( |
float |
restitution | ) |
|
var setRestitution |
( |
var |
restitution | ) |
|
local setRestitution |
( |
local |
restitution | ) |
|
local setTag |
( |
local |
tag | ) |
|
|
inline |
local _contactTestBitmask |
|
protected |
The documentation for this class was generated from the following file: