Cyclone Cyclone: cyclone::World Class Reference

cyclone::World Class Reference

The world represents an independent simulation of physics. More...

#include <world.h>

Collaboration diagram for cyclone::World:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 World (unsigned maxContacts, unsigned iterations=0)
 Creates a new simulator that can handle up to the given number of contacts per frame.
 ~World ()
unsigned generateContacts ()
 Calls each of the registered contact generators to report their contacts.
void runPhysics (real duration)
 Processes all the physics for the world.WorldRunPhysics.
void startFrame ()
 Initialises the world for a simulation frame.WorldStartFrame.

Classes

struct  BodyRegistration
 Holds a single rigid body in a linked list of bodies.
struct  ContactGenRegistration
 Holds one contact generators in a linked list.

Detailed Description

The world represents an independent simulation of physics.

It keeps track of a set of rigid bodies, and provides the means to update them all.


Constructor & Destructor Documentation

cyclone::World::World unsigned  maxContacts,
unsigned  iterations = 0
 

Creates a new simulator that can handle up to the given number of contacts per frame.

You can also optionally give a number of contact-resolution iterations to use. If you don't give a number of iterations, then four times the number of detected contacts will be used for each frame.

cyclone::World::~World  ) 
 


Member Function Documentation

unsigned cyclone::World::generateContacts  ) 
 

Calls each of the registered contact generators to report their contacts.

Returns the number of generated contacts.

void cyclone::World::runPhysics real  duration  ) 
 

Processes all the physics for the world.WorldRunPhysics.

void cyclone::World::startFrame  ) 
 

Initialises the world for a simulation frame.WorldStartFrame.

This clears the force and torque accumulators for bodies in the world. After calling this, the bodies can have their forces and torques for this frame added.


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