PhysicsContact Class

Module: cc

PhysicsContact will be generated during begin and end collision as a parameter of the collision callback. Note that contacts will be reused for speed up cpu time, so do not cache anything in the contact.

Index

Properties
  • colliderA Collider One of the collider that collided
  • colliderB Collider One of the collider that collided
  • disabled Boolean If set disabled to true, the contact will be ignored until contact end.
  • disabledOnce Boolean Disabled contact for current time step or sub-step.
Methods

Details

Properties

colliderA

One of the collider that collided

meta description
Type Collider
Defined in cocos2d/core/physics/CCPhysicsContact.js:423
colliderB

One of the collider that collided

meta description
Type Collider
Defined in cocos2d/core/physics/CCPhysicsContact.js:430
disabled

If set disabled to true, the contact will be ignored until contact end. If you just want to disabled contact for current time step or sub-step, please use disabledOnce.

meta description
Type Boolean
Defined in cocos2d/core/physics/CCPhysicsContact.js:437
disabledOnce

Disabled contact for current time step or sub-step.

meta description
Type Boolean
Defined in cocos2d/core/physics/CCPhysicsContact.js:446

Methods

getWorldManifold

Get the world manifold.

meta description
Returns WorldManifold
Defined in cocos2d/core/physics/CCPhysicsContact.js:236
getManifold

Get the manifold.

meta description
Returns Manifold
Defined in cocos2d/core/physics/CCPhysicsContact.js:276
getImpulse

Get the impulses. Note: PhysicsImpulse can only used in onPostSolve callback.

meta description
Returns PhysicsImpulse
Defined in cocos2d/core/physics/CCPhysicsContact.js:318
isTouching

Is this contact touching?

meta description
Returns Boolean
Defined in cocos2d/core/physics/CCPhysicsContact.js:457
setTangentSpeed

Set the desired tangent speed for a conveyor belt behavior.

meta description
Defined in cocos2d/core/physics/CCPhysicsContact.js:469
Parameters
getTangentSpeed

Get the desired tangent speed.

meta description
Returns Number
Defined in cocos2d/core/physics/CCPhysicsContact.js:480
setFriction

Override the default friction mixture. You can call this in onPreSolve callback.

meta description
Defined in cocos2d/core/physics/CCPhysicsContact.js:493
Parameters
getFriction

Get the friction.

meta description
Returns Number
Defined in cocos2d/core/physics/CCPhysicsContact.js:504
resetFriction

Reset the friction mixture to the default value.

meta description
Defined in cocos2d/core/physics/CCPhysicsContact.js:515
setRestitution

Override the default restitution mixture. You can call this in onPreSolve callback.

meta description
Defined in cocos2d/core/physics/CCPhysicsContact.js:525
Parameters
getRestitution

Get the restitution.

meta description
Returns Number
Defined in cocos2d/core/physics/CCPhysicsContact.js:536
resetRestitution

Reset the restitution mixture to the default value.

meta description
Defined in cocos2d/core/physics/CCPhysicsContact.js:547

results matching ""

    No results matching ""