forked from StudioInfinity/dyna3
App: use general test assembly from inversive-display
This moves us toward dropping the separate display prototype.
This commit is contained in:
parent
28b1ecb8e9
commit
4f8f36053f
2 changed files with 67 additions and 12 deletions
|
@ -1,6 +1,7 @@
|
|||
mod add_remove;
|
||||
mod assembly;
|
||||
mod display;
|
||||
mod engine;
|
||||
mod outline;
|
||||
|
||||
use nalgebra::DVector;
|
||||
|
@ -34,36 +35,63 @@ fn main() {
|
|||
let assemb = &state.assembly;
|
||||
let _ = assemb.try_insert_element(
|
||||
Element {
|
||||
id: String::from("wing_a"),
|
||||
label: String::from("Wing A"),
|
||||
id: String::from("gemini_a"),
|
||||
label: String::from("Castor"),
|
||||
color: [1.00_f32, 0.25_f32, 0.00_f32],
|
||||
rep: DVector::<f64>::from_column_slice(&[0.5, 0.5, 0.0, 0.5, -0.25]),
|
||||
rep: engine::sphere(0.5, 0.5, 0.0, 1.0),
|
||||
constraints: BTreeSet::default()
|
||||
}
|
||||
);
|
||||
let _ = assemb.try_insert_element(
|
||||
Element {
|
||||
id: String::from("wing_b"),
|
||||
label: String::from("Wing B"),
|
||||
id: String::from("gemini_b"),
|
||||
label: String::from("Pollux"),
|
||||
color: [0.00_f32, 0.25_f32, 1.00_f32],
|
||||
rep: DVector::<f64>::from_column_slice(&[-0.5, -0.5, 0.0, 0.5, -0.25]),
|
||||
rep: engine::sphere(-0.5, -0.5, 0.0, 1.0),
|
||||
constraints: BTreeSet::default()
|
||||
}
|
||||
);
|
||||
let _ = assemb.try_insert_element(
|
||||
Element {
|
||||
id: String::from("central"),
|
||||
label: String::from("Central"),
|
||||
color: [0.75_f32, 0.75_f32, 0.75_f32],
|
||||
rep: DVector::<f64>::from_column_slice(&[0.0, 0.0, 0.0, 0.4, -0.625]),
|
||||
id: String::from("ursa_major"),
|
||||
label: String::from("Ursa major"),
|
||||
color: [0.25_f32, 0.00_f32, 1.00_f32],
|
||||
rep: engine::sphere(-0.5, 0.5, 0.0, 0.75),
|
||||
constraints: BTreeSet::default()
|
||||
}
|
||||
);
|
||||
let _ = assemb.try_insert_element(
|
||||
Element {
|
||||
id: String::from("ursa_minor"),
|
||||
label: String::from("Ursa minor"),
|
||||
color: [0.25_f32, 1.00_f32, 0.00_f32],
|
||||
rep: engine::sphere(0.5, -0.5, 0.0, 0.5),
|
||||
constraints: BTreeSet::default()
|
||||
}
|
||||
);
|
||||
let _ = assemb.try_insert_element(
|
||||
Element {
|
||||
id: String::from("moon_deimos"),
|
||||
label: String::from("Deimos"),
|
||||
color: [0.75_f32, 0.75_f32, 0.00_f32],
|
||||
rep: engine::sphere(0.0, 0.15, 1.0, 0.25),
|
||||
constraints: BTreeSet::default()
|
||||
}
|
||||
);
|
||||
let _ = assemb.try_insert_element(
|
||||
Element {
|
||||
id: String::from("moon_phobos"),
|
||||
label: String::from("Phobos"),
|
||||
color: [0.00_f32, 0.75_f32, 0.50_f32],
|
||||
rep: engine::sphere(0.0, -0.15, -1.0, 0.25),
|
||||
constraints: BTreeSet::default()
|
||||
}
|
||||
);
|
||||
assemb.insert_constraint(
|
||||
Constraint {
|
||||
args: (
|
||||
assemb.elements_by_id.with(|elts_by_id| elts_by_id["wing_a"]),
|
||||
assemb.elements_by_id.with(|elts_by_id| elts_by_id["wing_b"])
|
||||
assemb.elements_by_id.with(|elts_by_id| elts_by_id["gemini_a"]),
|
||||
assemb.elements_by_id.with(|elts_by_id| elts_by_id["gemini_b"])
|
||||
),
|
||||
rep: 0.5
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue