
58 Chapter 3 The Laws of Motion
Excerpt from file include/cyclone/precision.h
/** Defines the precision of the power operator. */
#define real_pow powf
Excerpt from file src/particle.cpp
#include <assert.h>
#include <cyclone/particle.h>
using namespace cyclone;
void Particle::integrate(real duration)
{
// We don’t integrate things with infinite mass.
if (inverseMass <= 0.0f) return;
assert(duration > 0.0);
// Update linear position.
position.addScaledVector(velocity, duration);
// Work out the acceleration from the force.
// (We’ll add to this vector when we come to generate forces.)
Vector3 resultingAcc = acceleration;
// Update linear velocity from the acceleration. ...