Skip to content

Commit

Permalink
add ellipse and circle shape
Browse files Browse the repository at this point in the history
  • Loading branch information
kayhhh committed Sep 10, 2024
1 parent de46c36 commit 101d4ab
Show file tree
Hide file tree
Showing 20 changed files with 6,403 additions and 751 deletions.
564 changes: 499 additions & 65 deletions wasm/example-unavi-layout/src/bindings.rs

Large diffs are not rendered by default.

518 changes: 476 additions & 42 deletions wasm/example-unavi-scene/src/bindings.rs

Large diffs are not rendered by default.

518 changes: 476 additions & 42 deletions wasm/example-unavi-shapes/src/bindings.rs

Large diffs are not rendered by default.

20 changes: 19 additions & 1 deletion wasm/example-unavi-shapes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use bindings::{
exports::wired::script::types::{Guest, GuestScript},
unavi::{
scene::api::{Root, Scene},
shapes::api::{Cuboid, Cylinder, Rectangle, Sphere},
shapes::api::{Circle, Cuboid, Cylinder, Ellipse, Rectangle, Sphere},
},
wired::{
math::types::{Quat, Transform, Vec2, Vec3},
Expand Down Expand Up @@ -69,6 +69,24 @@ impl GuestScript for Script {
scene.add_node(&rectangle);
}

{
let translation = Vec3::new(-3.0, 0.0, 0.0);
spawn_axis(translation);

let circle = Circle::new(0.5).to_physics_node();
circle.set_transform(Transform::from_translation(translation));
scene.add_node(&circle);
}

{
let translation = Vec3::new(-4.5, 0.0, 0.0);
spawn_axis(translation);

let ellipse = Ellipse::new(Vec2::new(0.5, 0.75)).to_node();
ellipse.set_transform(Transform::from_translation(translation));
scene.add_node(&ellipse);
}

Root::add_scene(&scene);

Script
Expand Down
Loading

0 comments on commit 101d4ab

Please sign in to comment.