Chipmunk2D Pro API Reference  6.1.5
 All Classes Functions Variables Typedefs Properties Groups Pages
Public Attributes | List of all members
cpBody Struct Reference

Chipmunk's rigid body struct. More...

#include <cpBody.h>

Public Attributes

cpBodyVelocityFunc velocity_func
 Function that is called to integrate the body's velocity. (Defaults to cpBodyUpdateVelocity)
 
cpBodyPositionFunc position_func
 Function that is called to integrate the body's position. (Defaults to cpBodyUpdatePosition)
 
cpFloat m
 Mass of the body. More...
 
cpFloat m_inv
 Mass inverse.
 
cpFloat i
 Moment of inertia of the body. More...
 
cpFloat i_inv
 Moment of inertia inverse.
 
cpVect p
 Position of the rigid body's center of gravity.
 
cpVect v
 Velocity of the rigid body's center of gravity.
 
cpVect f
 Force acting on the rigid body's center of gravity.
 
cpFloat a
 Rotation of the body around it's center of gravity in radians. More...
 
cpFloat w
 Angular velocity of the body around it's center of gravity in radians/second.
 
cpFloat t
 Torque applied to the body around it's center of gravity.
 
cpVect rot
 Cached unit length vector representing the angle of the body. More...
 
cpDataPointer data
 User definable data pointer. More...
 
cpFloat v_limit
 Maximum velocity allowed when updating the velocity.
 
cpFloat w_limit
 Maximum rotational rate (in radians/second) allowed when updating the angular velocity.
 

Detailed Description

Chipmunk's rigid body struct.

Member Data Documentation

cpFloat cpBody::a

Rotation of the body around it's center of gravity in radians.

Must agree with cpBody.rot! Use cpBodySetAngle() when changing the angle for this reason.

cpDataPointer cpBody::data

User definable data pointer.

Generally this points to your the game object class so you can access it when given a cpBody reference in a callback.

cpFloat cpBody::i

Moment of inertia of the body.

Must agree with cpBody.i_inv! Use cpBodySetMoment() when changing the moment for this reason.

cpFloat cpBody::m

Mass of the body.

Must agree with cpBody.m_inv! Use cpBodySetMass() when changing the mass for this reason.

cpVect cpBody::rot

Cached unit length vector representing the angle of the body.

Used for fast rotations using cpvrotate().


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