PhysicsContact 类型

模块: cc

物理接触会在开始和结束碰撞之间生成,并作为参数传入到碰撞回调函数中。 注意:传入的物理接触会被系统进行重用,所以不要在使用中缓存里面的任何信息。

索引

属性(properties)
  • colliderA Collider
  • colliderB Collider
  • disabled Boolean 如果 disabled 被设置为 true,那么直到接触结束此接触都将被忽略。 如果只是希望在当前时间步或子步中忽略此接触,请使用 disabledOnce 。
  • disabledOnce Boolean 在当前时间步或子步中忽略此接触。
方法

Details

属性(properties)

colliderA
meta description
类型 Collider
定义于 https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/physics/CCPhysicsContact.js:453
colliderB
meta description
类型 Collider
定义于 https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/physics/CCPhysicsContact.js:456
disabled

如果 disabled 被设置为 true,那么直到接触结束此接触都将被忽略。 如果只是希望在当前时间步或子步中忽略此接触,请使用 disabledOnce 。

meta description
类型 Boolean
定义于 https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/physics/CCPhysicsContact.js:459
disabledOnce

在当前时间步或子步中忽略此接触。

meta description
类型 Boolean
定义于 https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/physics/CCPhysicsContact.js:468

方法

getWorldManifold

获取世界坐标系下的碰撞信息。

meta description
返回 WorldManifold
定义于 https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/physics/CCPhysicsContact.js:213
getManifold

获取世界坐标系下的碰撞信息。

meta description
返回 Manifold
定义于 https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/physics/CCPhysicsContact.js:273
getImpulse

获取冲量信息 注意:这个信息只有在 onPostSolve 回调中才能获取到

meta description
返回 PhysicsImpulse
定义于 https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/physics/CCPhysicsContact.js:337
isTouching

返回碰撞体是否已经接触到。

meta description
返回 Boolean
定义于 https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/physics/CCPhysicsContact.js:479
setTangentSpeed

为传送带设置期望的切线速度

meta description
定义于 https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/physics/CCPhysicsContact.js:491
参数列表
getTangentSpeed

获取切线速度

meta description
返回 Number
定义于 https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/physics/CCPhysicsContact.js:502
setFriction

覆盖默认的摩擦力系数。你可以在 onPreSolve 回调中调用此函数。

meta description
定义于 https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/physics/CCPhysicsContact.js:515
参数列表
getFriction

获取当前摩擦力系数

meta description
返回 Number
定义于 https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/physics/CCPhysicsContact.js:526
resetFriction

重置摩擦力系数到默认值

meta description
定义于 https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/physics/CCPhysicsContact.js:537
setRestitution

覆盖默认的恢复系数。你可以在 onPreSolve 回调中调用此函数。

meta description
定义于 https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/physics/CCPhysicsContact.js:547
参数列表
getRestitution

获取当前恢复系数

meta description
返回 Number
定义于 https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/physics/CCPhysicsContact.js:558
resetRestitution

重置恢复系数到默认值

meta description
定义于 https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/physics/CCPhysicsContact.js:569

results matching ""

    No results matching ""