Commit ad267c05 authored by Mei-Ling M. Laures's avatar Mei-Ling M. Laures
Browse files

Change force creator references to force applier. Expand on difference between...

Change force creator references to force applier. Expand on difference between create_force function and force_applier_t.
parent a3efc42a
No related merge requests found
Pipeline #34350 failed with stage
Showing with 15 additions and 9 deletions
+15 -9
......@@ -4,9 +4,11 @@
#include "scene.h"
/**
* Adds a force creator to a scene that applies gravity between two bodies.
* The force creator will be called each tick
* to compute the Newtonian gravitational force between the bodies.
* Calling this function will add a specialized force applier to a scene.
* The force applier will apply gravity between two bodies in each tick.
*
* The force applier will compute the Newtonian gravitational force between the
* bodies.
* See https://en.wikipedia.org/wiki/Newton%27s_law_of_universal_gravitation#Vector_form.
* The force should not be applied when the bodies are very close,
* because its magnitude blows up as the distance between the bodies goes to 0.
......@@ -19,9 +21,11 @@
void create_newtonian_gravity(scene_t *scene, double G, body_t *body1, body_t *body2);
/**
* Adds a force creator to a scene that acts like a spring between two bodies.
* The force creator will be called each tick
* to compute the Hooke's-Law spring force between the bodies.
* Calling this function will add a specialized force applier to a scene.
* The force applier will apply the spring force between two bodies in each tick.
*
* The force applier will compute the Hooke's-Law spring force between the
* bodies.
* See https://en.wikipedia.org/wiki/Hooke%27s_law.
*
* @param scene the scene containing the bodies
......@@ -32,9 +36,11 @@ void create_newtonian_gravity(scene_t *scene, double G, body_t *body1, body_t *b
void create_spring(scene_t *scene, double k, body_t *body1, body_t *body2);
/**
* Adds a force creator to a scene that applies a drag force on a body.
* The force creator will be called each tick
* to compute the drag force on the body proportional to its velocity.
* Calling this function will add a specialized force applier to a scene.
* The force applier will apply a drag force to a body in each tick.
*
* The force applier will compute the drag force on the body proportional to
* its velocity.
* The force points opposite the body's velocity.
*
* @param scene the scene containing the bodies
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment