[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.7.1 Physical World

There is a convenient header file that includes all the other headers you will probably need.

 
#include "csphyzik/phyziks.h"

The main object used to represent the physics engine is `ctWorld'.

 
ctWorld phyz_world;

Any bodies you want to be dynamically simulated need to be added to a `ctWorld'.

 
phyz_world.add_rigidbody(a_rigid_body_pointerd);

You can add forces that will affect all bodies the system by adding an environmental force:

 
phyz_world.add_enviro_force(gravity_force_pointer);

When you want to evolve the system simply do this:

 
phyz_world.evolve(time_start, time_end);

Now the rigid body we added should have been moved by the gravity force.



This document was generated using texi2html