Skip to content

Commit f87cc5c

Browse files
committed
Add geometric primitives
1 parent b17f8a4 commit f87cc5c

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

crates/bevy_geometry/Cargo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[package]
2+
name = "bevy_geometry"
3+
version = "0.1.0"
4+
authors = ["Aevyrie Roessler <aevyrie@gmail.com>"]
5+
edition = "2018"
6+
7+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8+
9+
[dependencies]
10+
bevy_math = { path = "../bevy_math", version = "0.4.0" }

crates/bevy_geometry/src/lib.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
use bevy_math::{Quat, Vec3};
2+
3+
pub trait Primitive3d {}
4+
5+
pub struct Sphere {
6+
pub origin: Vec3,
7+
pub radius: f32,
8+
}
9+
10+
pub struct Box {
11+
pub maximums: Vec3,
12+
pub minimums: Vec3,
13+
pub orientation: Quat,
14+
}
15+
16+
pub struct AxisAlignedBox {
17+
pub maximums: Vec3,
18+
pub minimums: Vec3,
19+
}
20+
21+
pub struct Plane {
22+
pub point: Vec3,
23+
pub normal: Vec3,
24+
}

0 commit comments

Comments
 (0)