Compare commits
2 commits
9acfacc104
...
f4c25352b4
Author | SHA1 | Date | |
---|---|---|---|
yuni | f4c25352b4 | ||
yuni | 1f11957429 |
|
@ -25,7 +25,7 @@ Source code: https://codeberg.org/outfly/outfly
|
||||||
- Accurate, clickable star chart. Can you spot the constellations?
|
- Accurate, clickable star chart. Can you spot the constellations?
|
||||||
- Cross platform, [free & open source](https://codeberg.org/outfly/outfly) forever!
|
- Cross platform, [free & open source](https://codeberg.org/outfly/outfly) forever!
|
||||||
- Written in [Rust](https://www.rust-lang.org) with the [Bevy game engine](https://bevyengine.org)
|
- Written in [Rust](https://www.rust-lang.org) with the [Bevy game engine](https://bevyengine.org)
|
||||||
- Status: It works and is enjoyable. Still much untapped potential though.
|
- Status: It works and is enjoyable. [Still much untapped potential though.](https://codeberg.org/outfly/outfly/wiki)
|
||||||
|
|
||||||
# Tutorial
|
# Tutorial
|
||||||
|
|
||||||
|
|
BIN
assets/models/fueltank.glb
Normal file
BIN
assets/models/fueltank.glb
Normal file
Binary file not shown.
BIN
src/blender/fueltank.blend
Normal file
BIN
src/blender/fueltank.blend
Normal file
Binary file not shown.
Binary file not shown.
47
src/cmd.rs
47
src/cmd.rs
|
@ -723,16 +723,17 @@ fn spawn_scenes(
|
||||||
|
|
||||||
let scene_defs = include!("data/scenes.in");
|
let scene_defs = include!("data/scenes.in");
|
||||||
for (name, template, pos, rot) in scene_defs {
|
for (name, template, pos, rot) in scene_defs {
|
||||||
|
let pos = DVec3::new(
|
||||||
|
root_state.pos[0] + pos[0],
|
||||||
|
root_state.pos[1] - pos[2],
|
||||||
|
root_state.pos[2] + pos[1],
|
||||||
|
);
|
||||||
if Some(name.to_string()) == root_state.name {
|
if Some(name.to_string()) == root_state.name {
|
||||||
match template {
|
match template {
|
||||||
"cruiser" => {
|
"cruiser" => {
|
||||||
let mut state = ParserState::default();
|
let mut state = ParserState::default();
|
||||||
state.class = DefClass::Actor;
|
state.class = DefClass::Actor;
|
||||||
state.pos = DVec3::new(
|
state.pos = pos;
|
||||||
root_state.pos[0] + pos[0],
|
|
||||||
root_state.pos[1] - pos[2],
|
|
||||||
root_state.pos[2] + pos[1],
|
|
||||||
);
|
|
||||||
state.model = Some("cruiser".to_string());
|
state.model = Some("cruiser".to_string());
|
||||||
|
|
||||||
state.rotation = Quat::from_euler(EulerRot::XYZ, rot[0], rot[1], rot[2]);
|
state.rotation = Quat::from_euler(EulerRot::XYZ, rot[0], rot[1], rot[2]);
|
||||||
|
@ -778,11 +779,7 @@ fn spawn_scenes(
|
||||||
"shippingcontainer" => {
|
"shippingcontainer" => {
|
||||||
let mut state = ParserState::default();
|
let mut state = ParserState::default();
|
||||||
state.class = DefClass::Actor;
|
state.class = DefClass::Actor;
|
||||||
state.pos = DVec3::new(
|
state.pos = pos;
|
||||||
root_state.pos[0] + pos[0],
|
|
||||||
root_state.pos[1] - pos[2],
|
|
||||||
root_state.pos[2] + pos[1],
|
|
||||||
);
|
|
||||||
state.model = Some("shippingcontainer".to_string());
|
state.model = Some("shippingcontainer".to_string());
|
||||||
|
|
||||||
state.rotation = Quat::from_euler(EulerRot::XYZ, rot[0], rot[1], rot[2]);
|
state.rotation = Quat::from_euler(EulerRot::XYZ, rot[0], rot[1], rot[2]);
|
||||||
|
@ -808,6 +805,36 @@ fn spawn_scenes(
|
||||||
// command: pointofinterest yes
|
// command: pointofinterest yes
|
||||||
ew_spawn.send(SpawnEvent(state));
|
ew_spawn.send(SpawnEvent(state));
|
||||||
}
|
}
|
||||||
|
"fueltank" => {
|
||||||
|
let mut state = ParserState::default();
|
||||||
|
state.class = DefClass::Actor;
|
||||||
|
state.pos = pos;
|
||||||
|
state.model = Some("fueltank".to_string());
|
||||||
|
|
||||||
|
state.rotation = Quat::from_euler(EulerRot::XYZ, rot[0], rot[1], rot[2]);
|
||||||
|
|
||||||
|
// command: relativeto ?
|
||||||
|
state.relative_to = root_state.relative_to.clone();
|
||||||
|
|
||||||
|
// command: name "Fuel Tank"
|
||||||
|
state.name = Some("Fuel Tank".to_string());
|
||||||
|
|
||||||
|
// command: scale 8
|
||||||
|
state.model_scale = 8.0;
|
||||||
|
|
||||||
|
// command: angularmomentum 0 0 0
|
||||||
|
state.angular_momentum = DVec3::ZERO;
|
||||||
|
|
||||||
|
// command: collider mesh
|
||||||
|
state.collider_is_one_mesh_of_scene = true;
|
||||||
|
state.collider_is_mesh = true;
|
||||||
|
|
||||||
|
// command: density 2000
|
||||||
|
state.density = 2000.0;
|
||||||
|
|
||||||
|
// command: pointofinterest yes
|
||||||
|
ew_spawn.send(SpawnEvent(state));
|
||||||
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
// DO NOT MODIFY MANUALLY, CHANGES WILL BE OVERWRITTEN!
|
// DO NOT MODIFY MANUALLY, CHANGES WILL BE OVERWRITTEN!
|
||||||
[
|
[
|
||||||
("test", "cruiser", [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]),
|
("test", "cruiser", [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]),
|
||||||
|
("workshop", "fueltank", [21.132, -24.376015, 0.0], [1.1160387, -1.308411, -0.9967722]),
|
||||||
("workshop", "shippingcontainer", [0.0, 0.0, 0.0], [-0.026294278, 0.000376441, 0.014312184]),
|
("workshop", "shippingcontainer", [0.0, 0.0, 0.0], [-0.026294278, 0.000376441, 0.014312184]),
|
||||||
("workshop", "shippingcontainer", [0.0, 12.0, 0.0], [-0.053937975, -0.013098141, 0.0]),
|
("workshop", "shippingcontainer", [0.0, 12.0, 0.0], [-0.053937975, -0.013098141, 0.0]),
|
||||||
("workshop", "shippingcontainer", [0.0, -12.0, 0.0], [0.061487854, 0.08236491, -0.051188234]),
|
("workshop", "shippingcontainer", [0.0, -12.0, 0.0], [0.061487854, 0.08236491, -0.051188234]),
|
||||||
|
|
|
@ -44,6 +44,7 @@ pub fn asset_name_to_path(name: &str) -> &'static str {
|
||||||
"MeteorAceGT" => "models/MeteorAceGT.glb#Scene0",
|
"MeteorAceGT" => "models/MeteorAceGT.glb#Scene0",
|
||||||
"cruiser" => "models/cruiser.glb#Scene0",
|
"cruiser" => "models/cruiser.glb#Scene0",
|
||||||
"shippingcontainer" => "models/shippingcontainer.glb#Scene0",
|
"shippingcontainer" => "models/shippingcontainer.glb#Scene0",
|
||||||
|
"fueltank" => "models/fueltank.glb#Scene0",
|
||||||
"satellite" => "models/satellite.gltf#Scene0",
|
"satellite" => "models/satellite.gltf#Scene0",
|
||||||
"pizzeria" => "models/pizzeria3.gltf#Scene0",
|
"pizzeria" => "models/pizzeria3.gltf#Scene0",
|
||||||
"pizzasign" => "models/pizzasign.glb#Scene0",
|
"pizzasign" => "models/pizzasign.glb#Scene0",
|
||||||
|
|
Loading…
Reference in a new issue