Cocos Creator API

1.5.x

Cocos Creator is the game engine for the future.

PhysicsContact

Module: cc
Parent 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.

Properties

colliderA Collider

colliderB Collider

disabled Boolean

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.

disabledOnce Boolean

Disabled contact for current time step or sub-step.

There are no properties that match your current filter settings. You can change your filter settings in the index section on this page. index

Methods

getWorldManifold ( ) WorldManifold

Get the world manifold.

returns:

getManifold ( ) Manifold

Get the manifold.

returns:

type: Manifold

getImpulse ( ) PhysicsImpulse

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

returns:

isTouching ( ) Boolean

Is this contact touching?

returns:

type: Boolean

setTangentSpeed
(
  • tangentSpeed
)

Set the desired tangent speed for a conveyor belt behavior.

name type description
tangentSpeed Number

getTangentSpeed ( ) Number

Get the desired tangent speed.

returns:

type: Number

setFriction
(
  • friction
)

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

name type description
friction Number

getFriction ( ) Number

Get the friction.

returns:

type: Number

resetFriction ( )

Reset the friction mixture to the default value.

setRestitution
(
  • restitution
)

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

name type description
restitution Number

getRestitution ( ) Number

Get the restitution.

returns:

type: Number

resetRestitution ( )

Reset the restitution mixture to the default value.

There are no methods that match your current filter settings. You can change your filter settings in the index section on this page. index