summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/spatial.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/spatial.c b/src/spatial.c
index 06c9a22..4d52738 100644
--- a/src/spatial.c
+++ b/src/spatial.c
@@ -68,6 +68,21 @@ static void rotate(xas_spatial_coord rotation,
point->z = Yz;
}
+static void move(xas_spatial_coord *point,
+ xas_spatial_coord heading,
+ float speed,
+ float interval) {
+ float distance = speed * interval;
+
+ xas_spatial_coord normal = { 0.0f, 0.0f, distance };
+
+ rotate(heading, &normal);
+
+ point->x += normal.x;
+ point->y += normal.y;
+ point->z += normal.z;
+}
+
static int within_cone(xas_spatial_coord point,
xas_spatial_cone cone) {
xas_spatial_coord apex_to_point_vect,