Fix orbit orientation; remove prints.

This commit is contained in:
yukirij 2024-06-18 17:47:17 -07:00
parent 5273e55c0b
commit bd162a410d
3 changed files with 3 additions and 5 deletions

View File

@ -27,7 +27,7 @@ fn main()
)
.append(
StarSystem::singular(3, 1.),
Orbit::with(DQuat::from_axis_angle(-DVec3::Z, f64::to_radians(30.)), 50., 0.1, 15., 0.),
Orbit::with(DQuat::from_axis_angle(-DVec3::X, f64::to_radians(30.)), 50., 0.1, 15., 0.),
);
let mut mesh = ico.to_mesh().scale(systems[0]);

View File

@ -82,7 +82,6 @@ impl StarSystem {
pub fn append(mut self, mut system:Self, orbit:Orbit) -> Self
{
let id = self.nodes.len();
println!("append at {}", id);
for node in &mut system.nodes {
for child in &mut node.children {
@ -105,7 +104,6 @@ impl StarSystem {
while let Some(params) = stack.pop() {
let (id, position) = params;
println!("resolving {} at {}", id, position);
match &self.nodes[id].data {
NodeData::Single(eid) => {

View File

@ -84,9 +84,9 @@ impl Orbit {
let radius = semimajor_axis * (1. - (self.eccentricity * eccentric_anomaly.cos()));
self.orientation * DVec3::new(
radius * theta.cos(),
radius * theta.sin(),
0.,
-radius * theta.sin(),
-radius * theta.cos(),
)
}
}