aboutsummaryrefslogtreecommitdiff
path: root/physics.c
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2021-08-01 11:56:12 +0000
committerrodri <rgl@antares-labs.eu>2021-08-01 11:56:12 +0000
commit7ed124593ebda443fc4d0f1439d1fd8dc602ce72 (patch)
tree9790ce5c3436e4b493ca912d26c6baa1bb8b826b /physics.c
parentb57dba67153279a84a16bba40ae007c8ae710056 (diff)
downloadmusw-7ed124593ebda443fc4d0f1439d1fd8dc602ce72.tar.gz
musw-7ed124593ebda443fc4d0f1439d1fd8dc602ce72.tar.bz2
musw-7ed124593ebda443fc4d0f1439d1fd8dc602ce72.zip
began building a universe for every party.
get rid of the notes file. i already keep them on paper. adapted the client to use an rframe for drawing. implemented some VModel methods for testing. FPS2MS → HZ2MS. it makes more sense and is shorter.
Diffstat (limited to 'physics.c')
-rw-r--r--physics.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/physics.c b/physics.c
index 945ff8c..a1edf54 100644
--- a/physics.c
+++ b/physics.c
@@ -18,6 +18,25 @@ accel(GameState *s, double)
return Vec2(0, -k*s->p.y - b*s->v.y);
}
+/*
+ * XXX: remember to take thrust into account, based on user input.
+ */
+static Point2
+accelship(Universe *u, Ship *s, double)
+{
+ double g, d;
+
+ d = vec2len(subpt2(u->star.p, s->p));
+ g = G*u->star.mass/(d*d);
+ return mulpt2(normvec2(subpt2(u->star.p, s->p)), g);
+}
+
+static Point2
+accelbullet(Universe *, Bullet *, double)
+{
+ return Vec2(0,0);
+}
+
static Derivative
eval(GameState *s0, double t, double Δt, Derivative *d)
{