CCPhysicsCollisionPair Class Reference
| Inherits from | NSObject |
| Declared in | CCPhysicsNode.h |
Overview
Contains information about two colliding physics objects. See CCPhysicsCollisionDelegate for more information.
Notes
- There is only one CCPhysicsCollisionPair object per CCPhysicsNode and it’s reused so don’t store a reference to it.
- You must copy any information you use from this struct if you want to use it later.
Tasks
-
contactsproperty -
frictionproperty -
restitutionproperty -
surfaceVelocityproperty -
totalKineticEnergyproperty -
totalImpulseproperty -
userDataproperty -
– shapeA:shapeB: -
– ignore
Properties
contacts
The contact information from the two colliding bodies.
@property (nonatomic, readonly) CCContactSet contactsDeclared In
CCPhysicsNode.hfriction
The friction coefficient for this pair of colliding shapes. The default value is pair.bodyA.friction*pair.bodyB.friction. Can be overriden in a CCCollisionPairDelegate pre-solve method to change the collision.
@property (nonatomic, assign) CGFloat frictionDeclared In
CCPhysicsNode.hrestitution
The restitution coefficient for this pair of colliding shapes. The default value is “pair.bodyA.elasticity*pair.bodyB.elasticity”. Can be overriden in a CCCollisionPairDelegate pre-solve method to change the collision.
@property (nonatomic, assign) CGFloat restitutionDeclared In
CCPhysicsNode.hsurfaceVelocity
The relative surface velocities of the two colliding shapes. See CCPhysicsBody.surfaceVelocity for more information. The default value is the surface velocity of the first body subtracted from the second, then clamped to the collision tangent. Can be overriden in a CCCollisionPairDelegate pre-solve method to change the collision.
@property (nonatomic, assign) CGPoint surfaceVelocityDeclared In
CCPhysicsNode.htotalImpulse
The total impulse applied by this collision to the colliding shapes.
@property (nonatomic, readonly) CGPoint totalImpulseDeclared In
CCPhysicsNode.htotalKineticEnergy
The amount of kinetic energy dissipated by the last collision of the two shapes. This is roughly equivalent to the idea of damage.
@property (nonatomic, readonly) CGFloat totalKineticEnergyDiscussion
Note: By definition, fully elastic collisions do not lose any energy or cause any permanent damage.
Declared In
CCPhysicsNode.huserData
A persistent object reference associated with these two colliding objects. If you want to store some information about a collision from time step to time step, store it here. @todo Possible to add a default to release it automatically?
@property (nonatomic, assign) id userDataDeclared In
CCPhysicsNode.h