PhysicsBoxCollider Class
Extends PhysicsCollider, Collider.Box(mixin)
Index
Properties
offsetVec2Position offsetsizeSizeBox sizedensityNumberThe density.sensorBooleanA sensor collider collects contact information but never generates a collision responsefrictionNumberThe friction coefficient, usually in the range [0,1].restitutionNumberThe restitution (elasticity) usually in the range [0,1].bodyRigidBodyPhysics collider will find the rigidbody component on the node and set to this property.
Methods
applyApply current changes to collider, this will regenerate inner box2d fixtures.getAABBGet the world aabb of the collider
Details
Properties
offset
Position offset
| meta | description |
|---|---|
| Type | Vec2 |
| Defined in | cocos2d/core/collider/CCBoxCollider.js:41 |
size
Box size
| meta | description |
|---|---|
| Type | Size |
| Defined in | cocos2d/core/collider/CCBoxCollider.js:58 |
density
The density.
| meta | description |
|---|---|
| Type | Number |
| Defined in | cocos2d/core/physics/collider/CCPhysicsCollider.js:53 |
sensor
A sensor collider collects contact information but never generates a collision response
| meta | description |
|---|---|
| Type | Boolean |
| Defined in | cocos2d/core/physics/collider/CCPhysicsCollider.js:71 |
friction
The friction coefficient, usually in the range [0,1].
| meta | description |
|---|---|
| Type | Number |
| Defined in | cocos2d/core/physics/collider/CCPhysicsCollider.js:89 |
restitution
The restitution (elasticity) usually in the range [0,1].
| meta | description |
|---|---|
| Type | Number |
| Defined in | cocos2d/core/physics/collider/CCPhysicsCollider.js:107 |
body
Physics collider will find the rigidbody component on the node and set to this property.
| meta | description |
|---|---|
| Type | RigidBody |
| Defined in | cocos2d/core/physics/collider/CCPhysicsCollider.js:125 |
Methods
apply
Apply current changes to collider, this will regenerate inner box2d fixtures.
| meta | description |
|---|---|
| Defined in | cocos2d/core/physics/collider/CCPhysicsCollider.js:257 |
getAABB
Get the world aabb of the collider
| meta | description |
|---|---|
| Defined in | cocos2d/core/physics/collider/CCPhysicsCollider.js:269 |