PhysicsBoxCollider Class

Extends PhysicsCollider

Module: cc Parent Module: cc

Index

Properties
  • offset Vec2 Position offset
  • size Size Box size
  • density Number The density.
  • sensor Boolean A sensor collider collects contact information but never generates a collision response
  • friction Number The friction coefficient, usually in the range [0,1].
  • restitution Number The restitution (elasticity) usually in the range [0,1].
  • body RigidBody Physics collider will find the rigidbody component on the node and set to this property.
Methods
  • apply Apply current changes to collider, this will regenerate inner box2d fixtures.
  • getAABB Get the world aabb of the collider

Details

Properties

offset

Position offset

meta description
Type Vec2
Defined in https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/collider/CCBoxCollider.js:40
size

Box size

meta description
Type Size
Defined in https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/collider/CCBoxCollider.js:57
density

The density.

meta description
Type Number
Defined in https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/physics/collider/CCPhysicsCollider.js:52
sensor

A sensor collider collects contact information but never generates a collision response

meta description
Type Boolean
Defined in https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/physics/collider/CCPhysicsCollider.js:70
friction

The friction coefficient, usually in the range [0,1].

meta description
Type Number
Defined in https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/physics/collider/CCPhysicsCollider.js:88
restitution

The restitution (elasticity) usually in the range [0,1].

meta description
Type Number
Defined in https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/physics/collider/CCPhysicsCollider.js:106
body

Physics collider will find the rigidbody component on the node and set to this property.

meta description
Type RigidBody
Defined in https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/physics/collider/CCPhysicsCollider.js:124

Methods

apply

Apply current changes to collider, this will regenerate inner box2d fixtures.

meta description
Defined in https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/physics/collider/CCPhysicsCollider.js:256
getAABB

Get the world aabb of the collider

meta description
Defined in https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/physics/collider/CCPhysicsCollider.js:268

results matching ""

    No results matching ""