├── src └── lib.rs ├── assets ├── scripts │ ├── true.rhai │ └── false.rhai ├── models │ ├── cube │ │ ├── cube.bin │ │ └── cube.gltf │ ├── character │ │ ├── rig.txt │ │ ├── X_Bot │ │ │ ├── Character.fbx │ │ │ ├── Character.glb │ │ │ ├── Goalkeeper_Idle.fbx │ │ │ ├── Goalkeeper_Idle.glb │ │ │ ├── Martelo_Do_Chau.fbx │ │ │ └── Martelo_Do_Chau.glb │ │ └── Y_Bot │ │ │ ├── Character.fbx │ │ │ ├── Character.glb │ │ │ ├── Goalkeeper_Idle.fbx │ │ │ └── Goalkeeper_Idle.glb │ ├── sphere │ │ ├── sphere.bin │ │ └── sphere.gltf │ ├── monkey │ │ └── Monkey.gltf │ ├── metric_box │ │ ├── metric_box_1x1.bin │ │ ├── metric_box_1x1.blend │ │ ├── metric_box_1x1.gltf │ │ └── albedo_metric_box_1x1.png │ └── metric_plane │ │ ├── metric_plane_8x8.bin │ │ ├── metric_plane_8x8.blend │ │ ├── metric_plane_8x8.gltf │ │ └── albedo_metric_plane_8x8.png ├── videos │ ├── mov_bbb.mp4 │ ├── robot.gif │ ├── robot.webp │ └── video.html ├── fonts │ ├── DejaVuSans.ttf │ ├── FiraSans-Bold.ttf │ ├── UbuntuMono-R.ttf │ ├── FiraMono-Medium.ttf │ └── JetBrainsMono-ExtraLight.ttf ├── textures │ ├── circle_alpha.png │ └── metric_512x512.png ├── bht │ ├── d │ │ ├── repeater.bht.ron │ │ ├── subtree_gate.bht.ron │ │ ├── delay.bht.ron │ │ ├── timeout.bht.ron │ │ ├── gate_true.bht.ron │ │ ├── defaults.bht.ron │ │ ├── gate_blackboard.bht.ron │ │ ├── zero_timers.bht.ron │ │ ├── repeat_repeater.bht.ron │ │ ├── all.bht.ron │ │ ├── sequence.bht.ron │ │ └── any_subtree.bht.ron │ └── u │ │ ├── bt_second_created.bht.ron │ │ └── bt_first_created.bht.ron ├── web │ ├── styles.css │ └── sound.js └── shaders │ ├── video_material.wgsl │ ├── lines.wgsl │ ├── pointcloud.wgsl │ └── voxels.wgsl ├── crates ├── simula_video │ ├── src │ │ ├── video.js │ │ ├── material.rs │ │ ├── rt.rs │ │ ├── gif.rs │ │ ├── webp.rs │ │ └── lib.rs │ └── Cargo.toml ├── simula_action │ ├── tests │ │ └── action.rs │ ├── simula_action_macro │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ ├── Cargo.toml │ └── src │ │ └── axis.rs ├── simula_surrealdb │ ├── src │ │ ├── server.rs │ │ └── lib.rs │ ├── test.srqlnb │ └── Cargo.toml ├── simula_cad │ ├── src │ │ ├── lib.rs │ │ └── shapes │ │ │ ├── mod.rs │ │ │ └── star.rs │ └── Cargo.toml ├── simula_octree │ ├── src │ │ └── lib.rs │ └── Cargo.toml ├── simula_camera │ ├── lib.rs │ └── Cargo.toml ├── simula_sdf │ ├── src │ │ └── lib.rs │ └── Cargo.toml ├── simula_behavior │ ├── src │ │ ├── actions │ │ │ ├── mod.rs │ │ │ └── wait.rs │ │ ├── composites │ │ │ ├── mod.rs │ │ │ ├── all.rs │ │ │ ├── any.rs │ │ │ ├── selector.rs │ │ │ └── sequencer.rs │ │ ├── decorators │ │ │ ├── mod.rs │ │ │ ├── identity.rs │ │ │ ├── inverter.rs │ │ │ ├── succeeder.rs │ │ │ ├── subtree.rs │ │ │ └── delay.rs │ │ ├── inspector │ │ │ └── behavior.rs │ │ ├── test.rs │ │ └── protocol.rs │ ├── simula_behavior_macro │ │ └── Cargo.toml │ ├── Cargo.toml │ └── tests │ │ ├── succeeder.rs │ │ ├── all.rs │ │ ├── any.rs │ │ ├── inverter.rs │ │ └── identity.rs ├── simula_core │ ├── src │ │ ├── lib.rs │ │ ├── signal │ │ │ ├── mod.rs │ │ │ └── controller.rs │ │ ├── prng.rs │ │ └── map_range.rs │ └── Cargo.toml ├── simula_viz │ ├── src │ │ ├── lib.rs │ │ ├── ease.rs │ │ ├── force_graph.rs │ │ ├── axes.rs │ │ ├── spline.rs │ │ ├── signal.rs │ │ └── grid.rs │ └── Cargo.toml ├── simula_inspector │ ├── Cargo.toml │ └── src │ │ ├── world.rs │ │ └── lib.rs ├── egui_node_graph │ ├── src │ │ ├── error.rs │ │ ├── utils.rs │ │ ├── id_type.rs │ │ ├── lib.rs │ │ ├── index_impls.rs │ │ ├── ui_state.rs │ │ ├── color_hex_utils.rs │ │ └── graph.rs │ └── Cargo.toml └── simula_script │ ├── Cargo.toml │ └── src │ ├── lib.rs │ └── asset.rs ├── tools ├── empty │ ├── assets │ ├── Cargo.toml │ ├── index.html │ └── src │ │ └── main.rs ├── sandbox │ ├── assets │ ├── Trunk.toml │ ├── Cargo.toml │ └── index.html ├── sdf_csg │ ├── assets │ └── Cargo.toml ├── splines │ ├── assets │ └── Cargo.toml ├── surreal │ ├── assets │ ├── Trunk.toml │ ├── Cargo.toml │ ├── index.html │ └── src │ │ └── main.rs ├── scripting │ ├── assets │ ├── Trunk.toml │ ├── Cargo.toml │ ├── index.html │ └── src │ │ └── derived_behavior.rs ├── video_player │ ├── assets │ └── Cargo.toml └── character_physics │ ├── assets │ └── Cargo.toml ├── .gitignore ├── .cargo └── config.toml ├── Cargo.toml ├── docs ├── p2p.png ├── behaviors.gif ├── splash.png ├── splash_old.png ├── Simula__main.gif ├── control_signals.png ├── easings_functions.png ├── signal_generators.png └── force_graph_function.png ├── run.sh ├── rustfmt.toml ├── export.sh ├── .gitattributes ├── LICENSE └── README.md /src/lib.rs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /assets/scripts/true.rhai: -------------------------------------------------------------------------------- 1 | true -------------------------------------------------------------------------------- /assets/scripts/false.rhai: -------------------------------------------------------------------------------- 1 | false -------------------------------------------------------------------------------- /crates/simula_video/src/video.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tools/empty/assets: -------------------------------------------------------------------------------- 1 | ../../assets -------------------------------------------------------------------------------- /tools/sandbox/assets: -------------------------------------------------------------------------------- 1 | ../../assets -------------------------------------------------------------------------------- /tools/sdf_csg/assets: -------------------------------------------------------------------------------- 1 | ../../assets -------------------------------------------------------------------------------- /tools/splines/assets: -------------------------------------------------------------------------------- 1 | ../../assets -------------------------------------------------------------------------------- /tools/surreal/assets: -------------------------------------------------------------------------------- 1 | ../../assets -------------------------------------------------------------------------------- /tools/scripting/assets: -------------------------------------------------------------------------------- 1 | ../../assets -------------------------------------------------------------------------------- /tools/video_player/assets: -------------------------------------------------------------------------------- 1 | ../../assets -------------------------------------------------------------------------------- /crates/simula_action/tests/action.rs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /crates/simula_surrealdb/src/server.rs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tools/character_physics/assets: -------------------------------------------------------------------------------- 1 | ../../assets -------------------------------------------------------------------------------- /crates/simula_cad/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod shapes; 2 | -------------------------------------------------------------------------------- /crates/simula_octree/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod plen; 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | .DS_Store 3 | /.vscode 4 | dist/ 5 | -------------------------------------------------------------------------------- /crates/simula_camera/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod flycam; 2 | pub mod orbitcam; 3 | -------------------------------------------------------------------------------- /crates/simula_sdf/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod ndshape; 2 | pub mod surface; 3 | -------------------------------------------------------------------------------- /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [target.wasm32-unknown-unknown] 2 | runner = "wasm-server-runner" 3 | -------------------------------------------------------------------------------- /crates/simula_surrealdb/test.srqlnb: -------------------------------------------------------------------------------- 1 | [{"kind":2,"language":"surrealql","value":"SELECT * FROM person;"}] -------------------------------------------------------------------------------- /crates/simula_behavior/src/actions/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod debug; 2 | pub mod wait; 3 | 4 | pub use debug::Debug; 5 | pub use wait::Wait; 6 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "simula" 3 | version = "0.6.0" 4 | edition = "2021" 5 | 6 | [workspace] 7 | members = ["crates/*", "tools/*"] 8 | -------------------------------------------------------------------------------- /docs/p2p.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:93ecb859458984f6ab5743302a1bd7024110ce09225217cde3e79a223cb37dc2 3 | size 921247 4 | -------------------------------------------------------------------------------- /docs/behaviors.gif: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fb5000ff5cbc1ce117dfc3ed307e24ec6809b97cc9520c81b0ea24d46373b10b 3 | size 1182934 4 | -------------------------------------------------------------------------------- /docs/splash.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:03f3add0c8e69e8c8db539c3a43b7ac8e5c416d343d39e6c86bb4b4211857862 3 | size 1424383 4 | -------------------------------------------------------------------------------- /docs/splash_old.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:963ff2a946e3f4d7fd6d010016bf1c5e3b47dee6177a2a8afc0fa8217ba57746 3 | size 719294 4 | -------------------------------------------------------------------------------- /assets/models/cube/cube.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:60f0cc476d265c1fff27ac1e8bbcd6faa1f0fc05b55506503ed2277be9a14952 3 | size 840 4 | -------------------------------------------------------------------------------- /assets/videos/mov_bbb.mp4: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3bb938fb70049e3e45f533b37ccae995ae96516e04c2f35b0c1142e47b2a39c1 3 | size 788493 4 | -------------------------------------------------------------------------------- /assets/videos/robot.gif: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c25294c0814d183fe57d7d155d995b85b555970adf6bad2c3e39112bfb7c09b5 3 | size 1625622 4 | -------------------------------------------------------------------------------- /assets/videos/robot.webp: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a27120bb3cb5e53425b4a684862e516ba3caf71f81f28c05366a3f80e2473c18 3 | size 529496 4 | -------------------------------------------------------------------------------- /assets/videos/video.html: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3d07c2949a66d211bd36265ba18f4465f9ecb872416674f9c76ae023ab8ab2c4 3 | size 200 4 | -------------------------------------------------------------------------------- /docs/Simula__main.gif: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cc03acf5d03e1a8a1c088b298a0d993eca2c12f149827d778c6d87b1dfc19584 3 | size 5071669 4 | -------------------------------------------------------------------------------- /docs/control_signals.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9e66dd0506167b42b997185afc9224d0b44e94c31ca2b2def50bb3b741237d56 3 | size 37772 4 | -------------------------------------------------------------------------------- /docs/easings_functions.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1a7d42405705d5358678c28ca56043236f8140bb3e11fc279a910f9341311ba4 3 | size 72643 4 | -------------------------------------------------------------------------------- /docs/signal_generators.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:12f079d79e28b9e0e8a2cf5905b7a8011e5fb88626495387b141ca691c412814 3 | size 79450 4 | -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export LD_LIBRARY_PATH=${LIBTORCH}/lib:$LD_LIBRARY_PATH 4 | export RUST_BACKTRACE=1 5 | 6 | cargo run --release --bin simula 7 | -------------------------------------------------------------------------------- /assets/fonts/DejaVuSans.ttf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7da195a74c55bef988d0d48f9508bd5d849425c1770dba5d7bfc6ce9ed848954 3 | size 757076 4 | -------------------------------------------------------------------------------- /assets/fonts/FiraSans-Bold.ttf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:12b632bf96ea4e760691f345ef7743c549ca387a018681e11094fcf6146244f1 3 | size 438028 4 | -------------------------------------------------------------------------------- /assets/fonts/UbuntuMono-R.ttf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b35dd9d2131d5d83a9b87fe9ad22c6288fa3d17688d43302c14da29812417d63 3 | size 205748 4 | -------------------------------------------------------------------------------- /assets/models/character/rig.txt: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5b882aaaf3f43ad67b05c889e7c5a04adf27c2c145d5a66d26919949fb0fbfad 3 | size 2029 4 | -------------------------------------------------------------------------------- /assets/models/cube/cube.gltf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c0accae58581306ca98348c0ed9efbe82597426c198a95dc292407fa038083bf 3 | size 2667 4 | -------------------------------------------------------------------------------- /assets/models/sphere/sphere.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cabd9d79e35a8da522994d906c616c95109f8cfc807d0229c919b1854d9f2d9e 3 | size 92384 4 | -------------------------------------------------------------------------------- /assets/models/sphere/sphere.gltf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d5cd88cf7bcde3fc38824870a9f9321affbbceefcc7784e61ae27f13191ecd8f 3 | size 2152 4 | -------------------------------------------------------------------------------- /assets/textures/circle_alpha.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:39fa28cec616bfeeb0d04c0652ef8df3fa494c2871846362539f986706a7568a 3 | size 5079 4 | -------------------------------------------------------------------------------- /docs/force_graph_function.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:60b54645e4092b3d5d781a369a857bcbe46b381cab4df1b23103ec3eeaeb9097 3 | size 81108 4 | -------------------------------------------------------------------------------- /assets/fonts/FiraMono-Medium.ttf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5f9173ce3d05fadef74c7eed06570d54e4f75bd0cd9860726fb2987a7f848292 3 | size 173516 4 | -------------------------------------------------------------------------------- /assets/models/monkey/Monkey.gltf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f590d064ea1d9c257e4d48fe01247a187b7858ad9529d00c5346730924843efc 3 | size 120168 4 | -------------------------------------------------------------------------------- /assets/textures/metric_512x512.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a994c73e964bc554c8c816c2b941a48161226427c394524fdce57f1cedccea6b 3 | size 75749 4 | -------------------------------------------------------------------------------- /assets/fonts/JetBrainsMono-ExtraLight.ttf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8391e7ec13e8ba758c1838f56bccd973228ccf4dc74aa5bffe9525b9147b12f8 3 | size 274144 4 | -------------------------------------------------------------------------------- /assets/models/character/X_Bot/Character.fbx: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0f521e8b4c780b7ce40b5f83715e060f24a7fd89896887165b4c5d23df901175 3 | size 1750032 4 | -------------------------------------------------------------------------------- /assets/models/character/X_Bot/Character.glb: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8a56f7385469cf10d2d58dab10b79f207d7d95df95adc3baab98bcdf6462386c 3 | size 1924348 4 | -------------------------------------------------------------------------------- /assets/models/character/Y_Bot/Character.fbx: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:926b4155cb6e9925f32ffb42dbaa2e90916aac5a51f0faa2ee636981f2e4201f 3 | size 1982368 4 | -------------------------------------------------------------------------------- /assets/models/character/Y_Bot/Character.glb: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5994be1f82f41f39fd013f3e155479c80fcad2fae89f3c43a736d9f2bb401dfd 3 | size 2348840 4 | -------------------------------------------------------------------------------- /assets/models/metric_box/metric_box_1x1.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7ec123e9c63263e8d0231c4e2ac8196bee66f11619ba7c38ed5c10c0fe65f2ff 3 | size 1224 4 | -------------------------------------------------------------------------------- /assets/models/metric_box/metric_box_1x1.blend: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:60e09e0e23507d74e84b39afe83bfcd69f7bebb5bf736171003abef19f379f88 3 | size 631252 4 | -------------------------------------------------------------------------------- /assets/models/metric_box/metric_box_1x1.gltf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:43b51f1b41eea8cbefc33a706ef84bbb8e6cb44d2ada30e504e08f01ad98086a 3 | size 3298 4 | -------------------------------------------------------------------------------- /assets/models/metric_plane/metric_plane_8x8.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:953f906047136715450102f46193020a4a8556065e8863e098a6c18a7557f22a 3 | size 204 4 | -------------------------------------------------------------------------------- /crates/simula_cad/src/shapes/mod.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::*; 2 | 3 | mod star; 4 | 5 | pub use star::*; 6 | 7 | pub trait ShapeMesh { 8 | fn to_mesh(&self) -> Mesh; 9 | } 10 | -------------------------------------------------------------------------------- /assets/models/character/X_Bot/Goalkeeper_Idle.fbx: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9d10ce165146be3fedc975cb5c6905fb48b96f6148b9a0dc1d5c212d19f811bb 3 | size 672464 4 | -------------------------------------------------------------------------------- /assets/models/character/X_Bot/Goalkeeper_Idle.glb: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:86b8e14487e2e8ab81f4e34b2d1b53fc600fe8bd15996c4710624b6aafe723f9 3 | size 149120 4 | -------------------------------------------------------------------------------- /assets/models/character/X_Bot/Martelo_Do_Chau.fbx: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ff50379a363fca983df2fed009b103ff10d8eebef0c43cf96faa6cf8393fe87a 3 | size 607088 4 | -------------------------------------------------------------------------------- /assets/models/character/X_Bot/Martelo_Do_Chau.glb: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:78a4d2530675c93e2e8e38962bfd40c4f873c863a7232982426d911a39989f7b 3 | size 108352 4 | -------------------------------------------------------------------------------- /assets/models/character/Y_Bot/Goalkeeper_Idle.fbx: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8fe5d9aa8f0b2df0ac89f359e412a7cf0129323e398fb3fe8c0b931fdfa8a2c3 3 | size 671184 4 | -------------------------------------------------------------------------------- /assets/models/character/Y_Bot/Goalkeeper_Idle.glb: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d911cbf8531241cc9f8e8d52b68f8532b66b0b09f61bff2d7b3bdb772aa4387c 3 | size 149256 4 | -------------------------------------------------------------------------------- /assets/models/metric_box/albedo_metric_box_1x1.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:dd7f655bdfa59419367b985c68a1caaaa54139c530f23f83ef334f8a75b2ca80 3 | size 4163 4 | -------------------------------------------------------------------------------- /assets/models/metric_plane/metric_plane_8x8.blend: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:66f4bc0ed3761052bb80500fb29d99a0927fea249664763cf439133d34609fb3 3 | size 637720 4 | -------------------------------------------------------------------------------- /assets/models/metric_plane/metric_plane_8x8.gltf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d9676f08080e6d3e15d45fb7f29e3b76cd8086889d1f95a86aab9a37aa484bf6 3 | size 3384 4 | -------------------------------------------------------------------------------- /assets/models/metric_plane/albedo_metric_plane_8x8.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3e02b4a4d0a909b5037b8f48eb234a9a339a97508be700ca869bada64703135c 3 | size 381462 4 | -------------------------------------------------------------------------------- /crates/simula_action/simula_action_macro/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "simula_action_macro" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [lib] 7 | proc-macro = true 8 | 9 | [dependencies] 10 | syn = "1.0" 11 | quote = "1.0" 12 | -------------------------------------------------------------------------------- /crates/simula_behavior/src/composites/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod all; 2 | pub mod any; 3 | pub mod selector; 4 | pub mod sequencer; 5 | 6 | pub use all::All; 7 | pub use any::Any; 8 | pub use selector::Selector; 9 | pub use sequencer::Sequencer; 10 | -------------------------------------------------------------------------------- /crates/simula_core/src/lib.rs: -------------------------------------------------------------------------------- 1 | #[macro_use] 2 | extern crate enum_display_derive; 3 | 4 | pub mod ease; 5 | pub mod epath; 6 | pub mod force_graph; 7 | pub mod map_range; 8 | pub mod prng; 9 | pub mod ray; 10 | pub mod signal; 11 | pub mod spline; 12 | -------------------------------------------------------------------------------- /crates/simula_octree/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "simula_octree" 3 | version = "0.1.0" 4 | edition = "2021" 5 | authors = ["Alex Rozgo "] 6 | 7 | [dependencies] 8 | bevy = { version = "0.10" } 9 | 10 | [dev-dependencies] 11 | -------------------------------------------------------------------------------- /crates/simula_viz/src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod axes; 2 | pub mod ease; 3 | pub mod follow_ui; 4 | pub mod force_graph; 5 | pub mod grid; 6 | pub mod lines; 7 | pub mod lookat; 8 | pub mod pointcloud; 9 | pub mod rod; 10 | pub mod signal; 11 | pub mod spline; 12 | pub mod voxel; 13 | -------------------------------------------------------------------------------- /crates/simula_behavior/simula_behavior_macro/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "simula_behavior_macro" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [lib] 7 | proc-macro = true 8 | 9 | [dependencies] 10 | syn = { version = "1.0", features = ["full"] } 11 | quote = "1.0" 12 | -------------------------------------------------------------------------------- /crates/simula_inspector/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "simula_inspector" 3 | version = "0.1.0" 4 | edition = "2021" 5 | authors = ["Alex Rozgo "] 6 | 7 | [dependencies] 8 | bevy = { version = "0.10" } 9 | bevy-inspector-egui = "0.18" 10 | 11 | [dev-dependencies] 12 | -------------------------------------------------------------------------------- /crates/simula_sdf/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "simula_sdf" 3 | version = "0.1.0" 4 | edition = "2021" 5 | authors = ["Duncan ", "Alex Rozgo "] 6 | 7 | [dependencies] 8 | bevy = { version = "0.10" } 9 | static_assertions = "1.1" 10 | 11 | [dev-dependencies] 12 | -------------------------------------------------------------------------------- /crates/simula_camera/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "simula_camera" 3 | version = "0.1.0" 4 | edition = "2021" 5 | authors = ["Alex Rozgo "] 6 | 7 | [dependencies] 8 | bevy = { version = "0.10" } 9 | simula_action = { path = "../../crates/simula_action" } 10 | 11 | [lib] 12 | path = "lib.rs" 13 | -------------------------------------------------------------------------------- /crates/simula_viz/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "simula_viz" 3 | version = "0.1.0" 4 | edition = "2021" 5 | authors = ["Alex Rozgo "] 6 | 7 | [dependencies] 8 | bevy = { version = "0.10" } 9 | bytemuck = "1.13" 10 | simula_core = { path = "../../crates/simula_core" } 11 | 12 | [lib] 13 | path = "src/lib.rs" -------------------------------------------------------------------------------- /crates/egui_node_graph/src/error.rs: -------------------------------------------------------------------------------- 1 | use super::*; 2 | 3 | #[derive(Debug, thiserror::Error)] 4 | pub enum EguiGraphError { 5 | #[error("Node {0:?} has no parameter named {1}")] 6 | NoParameterNamed(NodeId, String), 7 | 8 | #[error("Parameter {0:?} was not found in the graph.")] 9 | InvalidParameterId(AnyParameterId), 10 | } 11 | -------------------------------------------------------------------------------- /crates/simula_cad/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "simula_cad" 3 | version = "0.1.0" 4 | edition = "2021" 5 | authors = ["Alex Rozgo "] 6 | 7 | [dependencies] 8 | bevy = { version = "0.10" } 9 | 10 | fj = "0.46" 11 | fj-math = "0.46" 12 | fj-operations = "0.46" 13 | fj-interop = "0.46" 14 | 15 | [dev-dependencies] 16 | -------------------------------------------------------------------------------- /crates/simula_script/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "simula_script" 3 | version = "0.1.0" 4 | edition = "2021" 5 | authors = ["Alex Rozgo "] 6 | 7 | [dependencies] 8 | bevy = { version = "0.10" } 9 | 10 | rhai = { version = "0.15", features = ["sync"]} 11 | serde = { version = "1.0", features = ["derive"] } 12 | 13 | [dev-dependencies] 14 | -------------------------------------------------------------------------------- /tools/sandbox/Trunk.toml: -------------------------------------------------------------------------------- 1 | # An example Trunk.toml with all possible fields along with their defaults. 2 | 3 | [build] 4 | # The index HTML file to drive the bundling process. 5 | target = "index.html" 6 | # Build in release mode. 7 | release = true 8 | # The output dir for all final assets. 9 | dist = "dist" 10 | # The public URL from which assets are to be served. 11 | public_url = "/" 12 | -------------------------------------------------------------------------------- /tools/surreal/Trunk.toml: -------------------------------------------------------------------------------- 1 | # An example Trunk.toml with all possible fields along with their defaults. 2 | 3 | [build] 4 | # The index HTML file to drive the bundling process. 5 | target = "index.html" 6 | # Build in release mode. 7 | release = true 8 | # The output dir for all final assets. 9 | dist = "dist" 10 | # The public URL from which assets are to be served. 11 | public_url = "/" 12 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | use_field_init_shorthand = true 2 | newline_style = "Unix" 3 | 4 | # The following lines may be uncommented on nightly Rust. 5 | # Once these features have stabilized, they should be added to the always-enabled options above. 6 | # unstable_features = true 7 | # imports_granularity = "Crate" 8 | # wrap_comments = true 9 | # comment_width = 100 10 | # normalize_comments = true 11 | -------------------------------------------------------------------------------- /tools/scripting/Trunk.toml: -------------------------------------------------------------------------------- 1 | # An example Trunk.toml with all possible fields along with their defaults. 2 | 3 | [build] 4 | # The index HTML file to drive the bundling process. 5 | target = "index.html" 6 | # Build in release mode. 7 | release = true 8 | # The output dir for all final assets. 9 | dist = "dist" 10 | # The public URL from which assets are to be served. 11 | public_url = "/" 12 | -------------------------------------------------------------------------------- /crates/simula_core/src/signal/mod.rs: -------------------------------------------------------------------------------- 1 | use bevy::prelude::*; 2 | 3 | pub mod controller; 4 | pub mod generator; 5 | 6 | pub use controller::SignalController; 7 | pub use generator::{SignalFunction, SignalGenerator}; 8 | 9 | pub struct SignalPlugin; 10 | 11 | impl Plugin for SignalPlugin { 12 | fn build(&self, app: &mut App) { 13 | app.register_type::(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /crates/simula_behavior/src/decorators/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod delay; 2 | pub mod guard; 3 | pub mod identity; 4 | pub mod inverter; 5 | pub mod repeater; 6 | pub mod subtree; 7 | pub mod succeeder; 8 | pub mod timeout; 9 | 10 | pub use delay::Delay; 11 | pub use guard::Guard; 12 | pub use identity::Identity; 13 | pub use inverter::Inverter; 14 | pub use repeater::Repeater; 15 | pub use subtree::Subtree; 16 | pub use succeeder::Succeeder; 17 | pub use timeout::Timeout; 18 | -------------------------------------------------------------------------------- /assets/bht/d/repeater.bht.ron: -------------------------------------------------------------------------------- 1 | ("Do a few times", Repeater(( 2 | repeat: Times(10), 3 | )), [ 4 | ("Say hi", Debug(( 5 | message: ( 6 | prop: Value("Hello, from DebugMessage0!"), 7 | ), 8 | fail: ( 9 | prop: Value(false), 10 | ), 11 | duration: ( 12 | prop: Value(0.0), 13 | ), 14 | )), [], ( 15 | pos: (400.0, 0.0), 16 | )), 17 | ], ( 18 | pos: (200.0, 0.0), 19 | )) -------------------------------------------------------------------------------- /tools/empty/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "empty" 3 | version = "0.1.0" 4 | edition = "2021" 5 | authors = ["Alex Rozgo "] 6 | 7 | [dependencies] 8 | bevy = { version = "0.10" } 9 | 10 | simula_core = { path = "../../crates/simula_core" } 11 | simula_camera = { path = "../../crates/simula_camera" } 12 | simula_viz = { path = "../../crates/simula_viz" } 13 | simula_action = { path = "../../crates/simula_action" } 14 | simula_inspector = { path = "../../crates/simula_inspector" } 15 | 16 | -------------------------------------------------------------------------------- /assets/bht/d/subtree_gate.bht.ron: -------------------------------------------------------------------------------- 1 | ("Loop forever", Repeater(( 2 | repeat: Forever, 3 | )), [ 4 | ("Delay", Delay(( 5 | duration: ( 6 | prop: Value(5.0), 7 | ), 8 | )), [ 9 | ("Subtree with gate", Subtree(( 10 | asset: "bht/d/gate_blackboard.bht.ron", 11 | unload: true, 12 | )), [], ( 13 | pos: (600.0, 0.0), 14 | )), 15 | ], ( 16 | pos: (400.0, 0.0), 17 | )), 18 | ], ( 19 | pos: (200.0, 0.0), 20 | )) -------------------------------------------------------------------------------- /crates/simula_action/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "simula_action" 3 | version = "0.1.0" 4 | edition = "2021" 5 | authors = ["Alex Rozgo "] 6 | 7 | [dependencies] 8 | bevy = { version = "0.10", features = ["serialize"] } 9 | bevy_egui = "0.20" 10 | simula_core = { path = "../../crates/simula_core" } 11 | serde = { version = "1.0", features = ["derive"] } 12 | ron = "0.8" 13 | simula_action_macro = { path = "../../crates/simula_action/simula_action_macro" } 14 | 15 | [dev-dependencies] 16 | 17 | -------------------------------------------------------------------------------- /assets/web/styles.css: -------------------------------------------------------------------------------- 1 | body, html { 2 | height: 100%; 3 | } 4 | 5 | body { 6 | background: repeating-linear-gradient( 7 | 135deg, 8 | black 0, 9 | black 2px, 10 | white 2px, 11 | white 20px 12 | ); 13 | margin: 0; 14 | } 15 | 16 | .game-container { 17 | width: 100%; 18 | height: 100%; 19 | display: flex; 20 | justify-content: center; 21 | align-items: center; 22 | } 23 | 24 | #bevy { 25 | background-color: white; 26 | width: 800px; 27 | height: 600px; 28 | } 29 | -------------------------------------------------------------------------------- /crates/egui_node_graph/src/utils.rs: -------------------------------------------------------------------------------- 1 | pub trait ColorUtils { 2 | /// Multiplies the color rgb values by `factor`, keeping alpha untouched. 3 | fn lighten(&self, factor: f32) -> Self; 4 | } 5 | 6 | impl ColorUtils for egui::Color32 { 7 | fn lighten(&self, factor: f32) -> Self { 8 | egui::Color32::from_rgba_premultiplied( 9 | (self.r() as f32 * factor) as u8, 10 | (self.g() as f32 * factor) as u8, 11 | (self.b() as f32 * factor) as u8, 12 | self.a(), 13 | ) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tools/character_physics/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "character_physics" 3 | version = "0.1.0" 4 | edition = "2021" 5 | authors = ["Alex Rozgo "] 6 | 7 | [dependencies] 8 | bevy = { version = "0.10" } 9 | bevy-inspector-egui = "0.18" 10 | bevy_rapier3d = "0.21.0" 11 | 12 | simula_core = { path = "../../crates/simula_core" } 13 | simula_camera = { path = "../../crates/simula_camera" } 14 | simula_viz = { path = "../../crates/simula_viz" } 15 | simula_action = { path = "../../crates/simula_action" } 16 | 17 | rand = "0.8.5" 18 | regex = "1.7" 19 | -------------------------------------------------------------------------------- /tools/splines/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "splines" 3 | version = "0.1.0" 4 | edition = "2021" 5 | authors = ["Alex Rozgo "] 6 | 7 | [dependencies] 8 | bevy = { version = "0.10" } 9 | bevy-inspector-egui = "0.18" 10 | 11 | simula_core = { path = "../../crates/simula_core" } 12 | simula_camera = { path = "../../crates/simula_camera" } 13 | simula_viz = { path = "../../crates/simula_viz" } 14 | simula_action = { path = "../../crates/simula_action" } 15 | 16 | rand = "0.8.5" 17 | enum-iterator = "1.4" 18 | enum-display-derive = "0.1.1" 19 | 20 | -------------------------------------------------------------------------------- /crates/simula_core/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "simula_core" 3 | version = "0.1.0" 4 | edition = "2021" 5 | authors = ["Alex Rozgo "] 6 | 7 | [dependencies] 8 | bevy = { version = "0.10" } 9 | serde = { version = "1.0", features = ["derive"] } 10 | num-traits = "0.2" 11 | enum-iterator = "1.4" 12 | enum-display-derive = "0.1.1" 13 | oorandom = "11.1.3" 14 | rand = "0.8.4" 15 | petgraph = "0.6" 16 | clap = { version = "=4.3.4", features = ["derive"] } 17 | 18 | [dev-dependencies] 19 | bevy = { version = "0.10", default-features = true } 20 | ron = "0.8" 21 | -------------------------------------------------------------------------------- /tools/sdf_csg/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sdf_csg" 3 | version = "0.1.0" 4 | edition = "2021" 5 | authors = ["Alex Rozgo "] 6 | 7 | [dependencies] 8 | bevy = { version = "0.10" } 9 | bevy-inspector-egui = "0.18" 10 | 11 | simula_core = { path = "../../crates/simula_core" } 12 | simula_camera = { path = "../../crates/simula_camera" } 13 | simula_viz = { path = "../../crates/simula_viz" } 14 | simula_action = { path = "../../crates/simula_action" } 15 | simula_sdf = { path = "../../crates/simula_sdf" } 16 | 17 | rand = "0.8.5" 18 | enum-iterator = "1.4" 19 | enum-display-derive = "0.1.1" 20 | 21 | -------------------------------------------------------------------------------- /assets/bht/d/delay.bht.ron: -------------------------------------------------------------------------------- 1 | ("Loop forever", Repeater(( 2 | repeat: Forever, 3 | )), [ 4 | ("Delay", Delay(( 5 | duration: ( 6 | prop: Value(5.0), 7 | ), 8 | )), [ 9 | ("Do a thing", Debug(( 10 | message: ( 11 | prop: Value("I\'m doing a great thing!"), 12 | ), 13 | fail: ( 14 | prop: Value(false), 15 | ), 16 | duration: ( 17 | prop: Value(0.0), 18 | ), 19 | )), [], ( 20 | pos: (600.0, 0.0), 21 | )), 22 | ], ( 23 | pos: (400.0, 0.0), 24 | )), 25 | ], ( 26 | pos: (200.0, 0.0), 27 | )) -------------------------------------------------------------------------------- /tools/surreal/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "surreal" 3 | version = "0.1.0" 4 | edition = "2021" 5 | authors = ["Alex Rozgo "] 6 | 7 | [dependencies] 8 | bevy = { version = "0.10" } 9 | bevy-inspector-egui = "0.18" 10 | 11 | simula_core = { path = "../../crates/simula_core" } 12 | simula_camera = { path = "../../crates/simula_camera" } 13 | simula_viz = { path = "../../crates/simula_viz" } 14 | simula_action = { path = "../../crates/simula_action" } 15 | simula_inspector = { path = "../../crates/simula_inspector" } 16 | simula_surrealdb = { path = "../../crates/simula_surrealdb" } 17 | 18 | rand = "0.8.5" 19 | enum-iterator = "1.4" 20 | enum-display-derive = "0.1.1" 21 | -------------------------------------------------------------------------------- /crates/simula_surrealdb/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "simula_surrealdb" 3 | version = "0.1.0" 4 | edition = "2021" 5 | authors = ["Alex Rozgo "] 6 | 7 | [dependencies] 8 | bevy = { version = "0.10" } 9 | # surrealdb = "1.0.0-beta.9+20230402" 10 | surrealdb = { git = "https://github.com/surrealdb/surrealdb.git", rev = "8c6c5a5e37efb9207e3667c4e2766d5a2b43b468" } 11 | # surrealdb = { path = "../../../surrealdb/lib", package = "surrealdb" } 12 | crossbeam-channel = "0.5" 13 | serde = { version = "1.0", features = ["derive"] } 14 | lazy_static = "1.4" 15 | 16 | [target.'cfg(not(target_arch = "wasm32"))'.dependencies] 17 | tokio = { version = "1.0", features = ["full"] } 18 | 19 | [dev-dependencies] 20 | -------------------------------------------------------------------------------- /tools/empty/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | Simula 9 | 10 | 22 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /crates/egui_node_graph/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "egui_node_graph" 3 | description = "A helper library to create interactive node graphs using egui" 4 | homepage = "https://github.com/setzer22/egui_node_graph" 5 | repository = "https://github.com/setzer22/egui_node_graph" 6 | license = "MIT" 7 | version = "0.4.0" 8 | keywords = ["ui", "egui", "graph", "node"] 9 | authors = ["setzer22"] 10 | edition = "2021" 11 | 12 | [features] 13 | persistence = ["serde", "slotmap/serde", "smallvec/serde", "egui/persistence"] 14 | 15 | [dependencies] 16 | egui = { version = "0.21.0" } 17 | slotmap = { version = "1.0" } 18 | smallvec = { version = "1.10.0" } 19 | serde = { version = "1.0", optional = true, features = ["derive"] } 20 | thiserror = "1.0" 21 | -------------------------------------------------------------------------------- /export.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Tool is located at https://github.com/Simbotic/FBX2glTF 4 | 5 | FBX2glTF --binary --input assets/models/character/X_Bot/Character.fbx --output assets/models/character/X_Bot/Character.glb 6 | FBX2glTF --binary --input assets/models/character/X_Bot/Goalkeeper_Idle.fbx --output assets/models/character/X_Bot/Goalkeeper_Idle.glb 7 | FBX2glTF --binary --input assets/models/character/X_Bot/Martelo_Do_Chau.fbx --output assets/models/character/X_Bot/Martelo_Do_Chau.glb 8 | FBX2glTF --binary --input assets/models/character/Y_Bot/Character.fbx --output assets/models/character/Y_Bot/Character.glb 9 | FBX2glTF --binary --input assets/models/character/Y_Bot/Goalkeeper_Idle.fbx --output assets/models/character/Y_Bot/Goalkeeper_Idle.glb 10 | -------------------------------------------------------------------------------- /assets/bht/u/bt_second_created.bht.ron: -------------------------------------------------------------------------------- 1 | ("❓ Selector", Selector(( 2 | random: false, 3 | )), [ 4 | ("⌛ Delay", Delay(( 5 | duration: ( 6 | prop: Value(0.0), 7 | ), 8 | )), [ 9 | ("👁 Debug", Debug(( 10 | message: ( 11 | prop: Value("pepe"), 12 | ), 13 | fail: ( 14 | prop: Value(false), 15 | ), 16 | duration: ( 17 | prop: Value(0.0), 18 | ), 19 | )), [], ( 20 | pos: (600.0, 0.0), 21 | )), 22 | ], ( 23 | pos: (400.0, 0.0), 24 | )), 25 | ("~ Inverter", Inverter(()), [], ( 26 | pos: (400.0, 200.0), 27 | )), 28 | ], ( 29 | pos: (200.0, 0.0), 30 | )) -------------------------------------------------------------------------------- /assets/shaders/video_material.wgsl: -------------------------------------------------------------------------------- 1 | struct VideoMaterial { 2 | color: vec4, 3 | alpha_scaler: f32, 4 | }; 5 | 6 | @group(1) @binding(0) 7 | var material: VideoMaterial; 8 | @group(1) @binding(1) 9 | var base_color_texture: texture_2d; 10 | @group(1) @binding(2) 11 | var base_color_sampler: sampler; 12 | 13 | @fragment 14 | fn fragment( 15 | #import bevy_pbr::mesh_vertex_output 16 | ) -> @location(0) vec4 { 17 | let x_flipped_uv = vec2(1.0 - uv.x, uv.y); 18 | let tex_color = textureSample(base_color_texture, base_color_sampler, x_flipped_uv); 19 | let color = material.color.rgb * tex_color.rgb; 20 | let alpha = material.color.a * tex_color.a * material.alpha_scaler; 21 | return vec4(color.rgb, alpha); 22 | } 23 | -------------------------------------------------------------------------------- /crates/simula_core/src/prng.rs: -------------------------------------------------------------------------------- 1 | use oorandom::Rand32; 2 | 3 | #[derive(Debug, Clone)] 4 | pub struct Prng { 5 | rng: Rand32, 6 | } 7 | 8 | impl Prng { 9 | pub fn new(seed: u64) -> Self { 10 | Prng { 11 | rng: Rand32::new(seed), 12 | } 13 | } 14 | 15 | pub fn rand_u32(&mut self) -> u32 { 16 | self.rng.rand_u32() 17 | } 18 | 19 | pub fn rand_float(&mut self) -> f32 { 20 | self.rng.rand_float() 21 | } 22 | 23 | pub fn rand_float_range(&mut self, a: f32, b: f32) -> f32 { 24 | self.rng.rand_float() * (b - a) + a 25 | } 26 | } 27 | 28 | impl Default for Prng { 29 | fn default() -> Self { 30 | Prng { 31 | rng: Rand32::new(rand::random()), 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /assets/bht/d/timeout.bht.ron: -------------------------------------------------------------------------------- 1 | ("⇉ Any", Any(()), [ 2 | ("🕓 Timeout", Timeout(( 3 | duration: ( 4 | prop: Value(5.0), 5 | ), 6 | )), [ 7 | ("⌛ Wait", Wait(( 8 | duration: ( 9 | prop: Value(10.0), 10 | ), 11 | fail: ( 12 | prop: Value(false), 13 | ), 14 | )), [], ( 15 | pos: (600.0, 0.0), 16 | )), 17 | ], ( 18 | pos: (400.0, 0.0), 19 | )), 20 | ("⌛ Wait", Wait(( 21 | duration: ( 22 | prop: Value(10.0), 23 | ), 24 | fail: ( 25 | prop: Value(false), 26 | ), 27 | )), [], ( 28 | pos: (400.0, 200.0), 29 | )), 30 | ], ( 31 | pos: (200.0, 0.0), 32 | )) -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | assets/adroid-res/** filter=lfs diff=lfs merge=lfs -text 2 | assets/branding/** filter=lfs diff=lfs merge=lfs -text 3 | assets/fonts/** filter=lfs diff=lfs merge=lfs -text 4 | assets/models/** filter=lfs diff=lfs merge=lfs -text 5 | assets/sounds/** filter=lfs diff=lfs merge=lfs -text 6 | assets/textures/** filter=lfs diff=lfs merge=lfs -text 7 | assets/videos/** filter=lfs diff=lfs merge=lfs -text 8 | 9 | *.glb filter=lfs diff=lfs merge=lfs -text 10 | *.bin filter=lfs diff=lfs merge=lfs -text 11 | *.jpg filter=lfs diff=lfs merge=lfs -text 12 | *.png filter=lfs diff=lfs merge=lfs -text 13 | *.kra filter=lfs diff=lfs merge=lfs -text 14 | *.gif filter=lfs diff=lfs merge=lfs -text 15 | *.mp4 filter=lfs diff=lfs merge=lfs -text 16 | *.webp filter=lfs diff=lfs merge=lfs -text 17 | *.blend filter=lfs diff=lfs merge=lfs -text 18 | -------------------------------------------------------------------------------- /tools/scripting/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "scripting" 3 | version = "0.1.0" 4 | edition = "2021" 5 | authors = ["Alex Rozgo "] 6 | 7 | [dependencies] 8 | bevy = { version = "0.10" } 9 | bevy-inspector-egui = "0.18" 10 | 11 | simula_core = { path = "../../crates/simula_core" } 12 | simula_camera = { path = "../../crates/simula_camera" } 13 | simula_viz = { path = "../../crates/simula_viz" } 14 | simula_action = { path = "../../crates/simula_action" } 15 | simula_script = { path = "../../crates/simula_script" } 16 | simula_inspector = { path = "../../crates/simula_inspector" } 17 | simula_behavior = { path = "../../crates/simula_behavior" } 18 | simula_behavior_macro = { path = "../../crates/simula_behavior/simula_behavior_macro" } 19 | 20 | serde = { version = "1.0", features = ["derive"] } 21 | crossbeam-channel = "0.5.0" -------------------------------------------------------------------------------- /tools/sandbox/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "sandbox" 3 | version = "0.1.0" 4 | edition = "2021" 5 | authors = ["Alex Rozgo "] 6 | 7 | [features] 8 | default = ["gif"] 9 | gif = ["simula_video/gif"] 10 | webp = ["simula_video/webp"] 11 | gst = ["simula_video/gst"] 12 | 13 | [dependencies] 14 | bevy = { version = "0.10" } 15 | bevy_mod_debugdump = "0.7" 16 | 17 | simula_core = { path = "../../crates/simula_core" } 18 | simula_camera = { path = "../../crates/simula_camera" } 19 | simula_viz = { path = "../../crates/simula_viz" } 20 | simula_action = { path = "../../crates/simula_action" } 21 | simula_video = { path = "../../crates/simula_video" } 22 | simula_inspector = { path = "../../crates/simula_inspector" } 23 | simula_cad = { path = "../../crates/simula_cad" } 24 | 25 | rand = "0.8.5" 26 | enum-iterator = "1.4" 27 | enum-display-derive = "0.1.1" 28 | -------------------------------------------------------------------------------- /crates/simula_behavior/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "simula_behavior" 3 | version = "0.1.0" 4 | edition = "2021" 5 | authors = ["Alex Rozgo "] 6 | 7 | [dependencies] 8 | bevy = { version = "0.10" } 9 | bevy-inspector-egui = "0.18" 10 | 11 | egui_node_graph = { path = "../../crates/egui_node_graph" } 12 | 13 | simula_core = { path = "../../crates/simula_core" } 14 | simula_script = { path = "../../crates/simula_script" } 15 | simula_inspector = { path = "../../crates/simula_inspector" } 16 | 17 | simula_behavior_macro = { path = "../../crates/simula_behavior/simula_behavior_macro" } 18 | 19 | rand = "0.8.5" 20 | serde = { version = "1.0", features = ["derive"] } 21 | ron = "0.8" 22 | # serde_yaml = "0.9" 23 | pretty-type-name = "1.0" 24 | anyhow = "1.0" 25 | strum = { version = "0.24", features = ["derive"] } 26 | crossbeam-channel = "0.5.0" 27 | 28 | [dev-dependencies] 29 | -------------------------------------------------------------------------------- /tools/video_player/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "video_player" 3 | version = "0.1.0" 4 | edition = "2021" 5 | authors = ["Alex Rozgo "] 6 | 7 | [features] 8 | default = ["gif", "video"] 9 | gif = ["simula_video/gif"] 10 | webp = ["simula_video/webp"] 11 | gst = ["simula_video/gst"] 12 | video = ["simula_video/video"] 13 | 14 | [dependencies] 15 | bevy = { version = "0.10" } 16 | bevy_egui = "0.20" 17 | bevy-inspector-egui = "0.18" 18 | bevy_mod_debugdump = "0.7" 19 | wgpu-types = "0.15.1" 20 | 21 | simula_core = { path = "../../crates/simula_core" } 22 | simula_camera = { path = "../../crates/simula_camera" } 23 | simula_viz = { path = "../../crates/simula_viz" } 24 | simula_action = { path = "../../crates/simula_action" } 25 | simula_video = { path = "../../crates/simula_video" } 26 | 27 | rand = "0.8.5" 28 | enum-iterator = "1.4" 29 | enum-display-derive = "0.1.1" 30 | url = "2.3" 31 | -------------------------------------------------------------------------------- /tools/sandbox/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | Simula - Sandbox 9 | 10 | 28 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /tools/surreal/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | Simula - SurrealDB 9 | 10 | 28 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /tools/scripting/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | Simula - Scripting 9 | 10 | 28 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /assets/shaders/lines.wgsl: -------------------------------------------------------------------------------- 1 | #import bevy_pbr::mesh_view_bindings 2 | #import bevy_pbr::mesh_types 3 | 4 | // struct LinesMaterial; 5 | // [[group(1), binding(0)]] 6 | // var material: LinesMaterial; 7 | 8 | @group(2) @binding(0) 9 | var mesh: Mesh; 10 | 11 | struct Vertex { 12 | @location(0) position: vec3, 13 | @location(1) color: vec4, 14 | }; 15 | 16 | struct VertexOutput { 17 | @builtin(position) clip_position: vec4, 18 | @location(0) color: vec4, 19 | }; 20 | 21 | @vertex 22 | fn vertex(vertex: Vertex) -> VertexOutput { 23 | var out: VertexOutput; 24 | let world_position = mesh.model * vec4(vertex.position, 1.0); 25 | out.clip_position = view.view_proj * world_position; 26 | 27 | let color = vertex.color; 28 | out.color = color; 29 | 30 | return out; 31 | } 32 | 33 | @fragment 34 | fn fragment(in: VertexOutput) -> @location(0) vec4 { 35 | return vec4(in.color.rgb, 1.0); 36 | } 37 | -------------------------------------------------------------------------------- /assets/bht/d/gate_true.bht.ron: -------------------------------------------------------------------------------- 1 | ("Loop Guard", Repeater(( 2 | repeat: Forever, 3 | )), [ 4 | ("Delay", Delay(( 5 | duration: ( 6 | prop: Value(5.0), 7 | ), 8 | )), [ 9 | ("Can do?", Guard(( 10 | condition: ( 11 | prop: Eval( 12 | eval: "2 + 2 == 4", 13 | ), 14 | ), 15 | )), [ 16 | ("Do a thing", Debug(( 17 | message: ( 18 | prop: Value("I\'m doing a thing"), 19 | ), 20 | fail: ( 21 | prop: Value(false), 22 | ), 23 | duration: ( 24 | prop: Value(0.0), 25 | ), 26 | )), [], ( 27 | pos: (800.0, 0.0), 28 | )), 29 | ], ( 30 | pos: (600.0, 0.0), 31 | )), 32 | ], ( 33 | pos: (400.0, 0.0), 34 | )), 35 | ], ( 36 | pos: (200.0, 0.0), 37 | )) -------------------------------------------------------------------------------- /assets/bht/d/defaults.bht.ron: -------------------------------------------------------------------------------- 1 | ("Simple sequence", Sequencer(( 2 | random: false, 3 | )), [ 4 | ("Dont fail", Debug(( 5 | message: ( 6 | prop: Value(""), 7 | ), 8 | fail: ( 9 | prop: Value(false), 10 | ), 11 | duration: ( 12 | prop: Value(0.0), 13 | ), 14 | )), [], ( 15 | pos: (400.0, 0.0), 16 | )), 17 | ("Take some time", Wait(( 18 | duration: ( 19 | prop: Value(1.5), 20 | ), 21 | fail: ( 22 | prop: Value(false), 23 | ), 24 | )), [], ( 25 | pos: (400.0, 200.0), 26 | )), 27 | ("Say Hello", Debug(( 28 | message: ( 29 | prop: Value("Hello World"), 30 | ), 31 | fail: ( 32 | prop: Value(false), 33 | ), 34 | duration: ( 35 | prop: Value(0.0), 36 | ), 37 | )), [], ( 38 | pos: (400.0, 400.0), 39 | )), 40 | ], ( 41 | pos: (200.0, 0.0), 42 | )) -------------------------------------------------------------------------------- /assets/shaders/pointcloud.wgsl: -------------------------------------------------------------------------------- 1 | #import bevy_pbr::mesh_view_bindings 2 | #import bevy_pbr::mesh_types 3 | 4 | 5 | @group(1) @binding(0) 6 | var mesh: Mesh; 7 | 8 | struct Vertex { 9 | @location(0) position: vec3, 10 | @location(1) normal: vec3, 11 | @location(2) uv: vec2, 12 | 13 | @location(3) i_pos_scale: vec4, 14 | @location(4) i_color: vec4, 15 | }; 16 | 17 | struct VertexOutput { 18 | @builtin(position) clip_position: vec4, 19 | @location(0) color: vec4, 20 | }; 21 | 22 | @vertex 23 | fn vertex(vertex: Vertex) -> VertexOutput { 24 | let position = vertex.position * vertex.i_pos_scale.w + vertex.i_pos_scale.xyz; 25 | let world_position = mesh.model * vec4(position, 1.0); 26 | 27 | var out: VertexOutput; 28 | out.clip_position = view.view_proj * world_position; 29 | out.color = vertex.i_color; 30 | return out; 31 | } 32 | 33 | @fragment 34 | fn fragment(in: VertexOutput) -> @location(0) vec4 { 35 | return in.color; 36 | } 37 | -------------------------------------------------------------------------------- /crates/simula_video/src/material.rs: -------------------------------------------------------------------------------- 1 | use bevy::{ 2 | prelude::*, 3 | reflect::TypeUuid, 4 | render::render_resource::{AsBindGroup, ShaderRef}, 5 | }; 6 | 7 | impl Material for VideoMaterial { 8 | fn fragment_shader() -> ShaderRef { 9 | "shaders/video_material.wgsl".into() 10 | } 11 | 12 | fn alpha_mode(&self) -> AlphaMode { 13 | self.alpha_mode 14 | } 15 | } 16 | 17 | #[derive(AsBindGroup, TypeUuid, Debug, Clone)] 18 | #[uuid = "afbf5e64-6f79-11ed-9551-02a179e5df2a"] 19 | pub struct VideoMaterial { 20 | #[uniform(0)] 21 | pub color: Color, 22 | #[uniform(0)] 23 | pub alpha_scaler: f32, 24 | #[texture(1)] 25 | #[sampler(2)] 26 | pub video_texture: Option>, 27 | pub alpha_mode: AlphaMode, 28 | } 29 | 30 | impl Default for VideoMaterial { 31 | fn default() -> Self { 32 | Self { 33 | color: Color::WHITE, 34 | alpha_scaler: 0.0, 35 | video_texture: None, 36 | alpha_mode: AlphaMode::Opaque, 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /crates/simula_behavior/tests/succeeder.rs: -------------------------------------------------------------------------------- 1 | use simula_behavior::{test::*, BehaviorTrace}; 2 | 3 | #[test] 4 | fn succeeder_success() { 5 | let behavior = r#" 6 | ( 7 | "Just succeed", 8 | Succeeder(()), 9 | [ 10 | ( 11 | "Do a few things", 12 | Sequencer(()), 13 | [ 14 | ("Do an action", Debug((message:"Hello, from DebugMessage0!", fail:true))), 15 | ("Do another action", Debug((message:"Hello, from DebugMessage1!"))), 16 | ] 17 | ), 18 | ], 19 | ) 20 | "#; 21 | let trace = trace_behavior(behavior); 22 | println!("{:#?}", trace); 23 | let expected_trace = BehaviorTrace::from_list(&[ 24 | "[1] STARTED Just succeed", 25 | "[2] STARTED Do a few things", 26 | "[3] STARTED Do an action", 27 | "[3] FAILURE Do an action", 28 | "[2] FAILURE Do a few things", 29 | "[1] SUCCESS Just succeed", 30 | ]); 31 | assert_eq!(&trace, &expected_trace); 32 | } 33 | -------------------------------------------------------------------------------- /assets/bht/d/gate_blackboard.bht.ron: -------------------------------------------------------------------------------- 1 | ("Loop guard", Repeater(( 2 | repeat: Forever, 3 | )), [ 4 | ("Delay", Delay(( 5 | duration: ( 6 | prop: Value(5.0), 7 | ), 8 | )), [ 9 | ("Can do?", Guard(( 10 | condition: ( 11 | prop: Eval( 12 | eval: "print(blackboard.state); blackboard.state = blackboard.state + 1; blackboard.state < 3", 13 | ), 14 | ), 15 | )), [ 16 | ("Do a thing", Debug(( 17 | message: ( 18 | prop: Value("I\'m doing a thing"), 19 | ), 20 | fail: ( 21 | prop: Value(false), 22 | ), 23 | duration: ( 24 | prop: Value(0.0), 25 | ), 26 | )), [], ( 27 | pos: (800.0, 0.0), 28 | )), 29 | ], ( 30 | pos: (600.0, 0.0), 31 | )), 32 | ], ( 33 | pos: (400.0, 0.0), 34 | )), 35 | ], ( 36 | pos: (200.0, 0.0), 37 | )) -------------------------------------------------------------------------------- /crates/simula_script/src/lib.rs: -------------------------------------------------------------------------------- 1 | use asset::ScriptLoader; 2 | pub use asset::{Script, ScriptContext}; 3 | use bevy::prelude::*; 4 | pub use rhai as script; 5 | 6 | mod asset; 7 | 8 | pub struct ScriptPlugin; 9 | 10 | impl Plugin for ScriptPlugin { 11 | fn build(&self, app: &mut App) { 12 | app.add_asset::