Chipmunk2D Pro API Reference  7.0.1
 All Classes Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
Public Attributes | List of all members
cpCollisionHandler Struct Reference

Struct that holds function callback pointers to configure custom collision handling. More...

#include <cpSpace.h>

Public Attributes

const cpCollisionType typeA
 Collision type identifier of the first shape that this handler recognizes. More...
 
const cpCollisionType typeB
 Collision type identifier of the second shape that this handler recognizes. More...
 
cpCollisionBeginFunc beginFunc
 This function is called when two shapes with types that match this collision handler begin colliding.
 
cpCollisionPreSolveFunc preSolveFunc
 This function is called each step when two shapes with types that match this collision handler are colliding. More...
 
cpCollisionPostSolveFunc postSolveFunc
 This function is called each step when two shapes with types that match this collision handler are colliding. More...
 
cpCollisionSeparateFunc separateFunc
 This function is called when two shapes with types that match this collision handler stop colliding.
 
cpDataPointer userData
 This is a user definable context pointer that is passed to all of the collision handler functions.
 

Detailed Description

Struct that holds function callback pointers to configure custom collision handling.

Collision handlers have a pair of types; when a collision occurs between two shapes that have these types, the collision handler functions are triggered.

Member Data Documentation

cpCollisionPostSolveFunc cpCollisionHandler::postSolveFunc

This function is called each step when two shapes with types that match this collision handler are colliding.

It's called after the collision solver runs so that you can read back information about the collision to trigger events in your game.

cpCollisionPreSolveFunc cpCollisionHandler::preSolveFunc

This function is called each step when two shapes with types that match this collision handler are colliding.

It's called before the collision solver runs so that you can affect a collision's outcome.

const cpCollisionType cpCollisionHandler::typeA

Collision type identifier of the first shape that this handler recognizes.

In the collision handler callback, the shape with this type will be the first argument. Read only.

const cpCollisionType cpCollisionHandler::typeB

Collision type identifier of the second shape that this handler recognizes.

In the collision handler callback, the shape with this type will be the second argument. Read only.


The documentation for this struct was generated from the following file: