summaryrefslogtreecommitdiffstats
path: root/src/solar_system/ship.rs
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2026-05-06 12:01:42 -0400
committerJon Santmyer <jon@jonsantmyer.com>2026-05-06 12:01:42 -0400
commit9788d9037ad7199701b1710c28559cb96bce5aec (patch)
treec490b40b1f0057c98c2b4bb3c2593f915313d14f /src/solar_system/ship.rs
parentd67fca88b17120566a93004c99dadeef0a61964b (diff)
downloadsystemic4x-9788d9037ad7199701b1710c28559cb96bce5aec.tar.gz
systemic4x-9788d9037ad7199701b1710c28559cb96bce5aec.tar.bz2
systemic4x-9788d9037ad7199701b1710c28559cb96bce5aec.zip
regenerate orbit lines based on system tick interval
Diffstat (limited to 'src/solar_system/ship.rs')
-rw-r--r--src/solar_system/ship.rs34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/solar_system/ship.rs b/src/solar_system/ship.rs
index eb4cdf3..57c0184 100644
--- a/src/solar_system/ship.rs
+++ b/src/solar_system/ship.rs
@@ -1,4 +1,36 @@
+use crate::solar_system::{Kilograms, Kilometers, SolarSystem, body::BodyId, orbit::StaticOrbit};
+
+pub type ShipId = usize;
+
pub struct Ship
{
-
+ name: String,
+ mass: Kilograms,
+
+ position: cgmath::Vector3<Kilometers>,
+ velocity: cgmath::Vector3<f32>,
+ acceleration: cgmath::Vector3<f32>,
+
+ baked_orbit: Option<StaticOrbit>
+}
+
+impl Ship
+{
+ pub fn new(
+ name: String,
+ mass: Kilograms,
+ system: &SolarSystem,
+ orbiting: BodyId,
+ orbit_sma: Kilometers)
+ -> Self
+ {
+ Self {
+ name,
+ mass,
+ position: cgmath::vec3(0.0, 0.0, 0.0),
+ velocity: cgmath::vec3(0.0, 0.0, 0.0),
+ acceleration: cgmath::vec3(0.0, 0.0, 0.0),
+ baked_orbit: None
+ }
+ }
}