Particle Modifications
In this chapter, we will attach particles to springs to create a point mass system. A point mass system contains a number of points that have mass, but not volume. A particle fits this description perfectly. However, as it is, the Particle
class does not expose all the functions that we need to achieve this. In order to develop the point mass system, we need to make a few modifications to the Particle class we developed in Chapter 14, Constraint Solving.
Getting ready
In this section, we will make several modifications to the public API of the Particle
class. We will introduce setter functions for the mass and friction of particles. We will also introduce getter functions for the velocity and inverse mass of particles. Finally, we will implement a function to add an impulse to particles.
How to do it…
Follow the given steps to prepare the particle class to be used with springs:
- Declare the new methods that we will be adding to the
Particle
class inParticle.h
:void...