PDG engine v0.9.5
 All Classes Namespaces Functions Variables Groups Pages
Public Member Functions | List of all members
CpArbiter Class Reference

arbitrates collisions between sprites using Chipmunk Physics (Chipmunk Physics Only) More...

Public Member Functions

number getCount ()
 number of contacts tracked by this arbiter
 
number getDepth (int i)
 get the depth of penetration for a particular contact point
 
Vector getNormal ()
 get collision normal
 
Point getPointA (int i)
 get the location of a particular contact point
 
Point getPointB (int i)
 get the location of a particular contact point
 
boolean isFirstContact ()
 is this this first moment of contact in a collision?
 

Detailed Description

arbitrates collisions between sprites using Chipmunk Physics (Chipmunk Physics Only)

Note
API Stability: 2 - Unstable. The API is in the process of settling, but has not yet had sufficient real-world testing to be considered stable. Backwards-compatibility will be maintained if reasonable.
See Also
http://files.slembcke.net/chipmunk/release/ChipmunkLatest-Docs/#cpArbiter

Member Function Documentation

getCount ( )

number of contacts tracked by this arbiter

A collision can involve multiple contact points between objects. This tells you how many different contact points are involved in this collision.

Returns
number of contact points
getDepth ( int  i)

get the depth of penetration for a particular contact point

Parameters
iindex into contact points
Returns
how far the contact point is inside the other object
getNormal ( )

get collision normal

Get the normal vector (magnitude of 1.0) that expresses the relative x and y direction of the collision.

Returns
the collision normal vector for the collision
getPointA ( int  i)

get the location of a particular contact point

Parameters
iindex into contact points
Returns
the location of the contact
getPointB ( int  i)

get the location of a particular contact point

Parameters
iindex into contact points
Returns
the location of the contact
isFirstContact ( )

is this this first moment of contact in a collision?

Returns
true if this is the first moment of contact between the objects, false if part of an ongoing collison

User Comments