Skip to content

Wind & Gravity

Wind and gravity can be modelled as affecting the acceleration of a thing with Forces.accelerationForce

For wind, we might make it push something to the right, with its power being dampened (ie. reduced) with greater mass of a thing:

const windForce = Forces.accelerationForce({
x: 0.00001,
y: 0
}, `dampen`
);

Gravity won’t affect the x value, but rather y, and in this case the force is multiplied with the mass (heavier will fall faster):

const gravityForce = Forces.accelerationForce({
x: 0,
y: 0.0001
}, `multiply`
);