Chipmunk++
 All Classes Functions Variables Pages
Public Member Functions
cp::Body Class Reference

Rigid body. More...

#include <body.hpp>

List of all members.

Public Member Functions

 Body (Float mass, Float inertia)
 Body (cpBody *)
 operator cpBody * () const
Vect getPos () const
void setPos (Vect)
Vect getVel () const
 Linear velocity of the center of gravity of the body.
void setVel (Vect velocity)
Float getVelLimit () const
void setVelLimit (Float limit)
DataPointer getUserData () const
void setUserData (DataPointer)

Detailed Description

Rigid body.

A rigid body holds the physical properties of an object. (mass, position, rotation, velocity, etc.) It does not have a shape until you attach one or more collision shapes to it. If you’ve done physics with particles before, rigid bodies differ in that they are able to rotate. Rigid bodies generally tend to have a 1:1 correlation to sprites in a game. You should structure your game so that you use the position and rotation of the rigid body for drawing your sprite.


Member Function Documentation

Float cp::Body::getVelLimit ( ) const

Velocity limit of the body. Defaults to INFINITY unless you set it specifically. Can be used to limit falling speeds, etc.


The documentation for this class was generated from the following files: