Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add geometric primitives #1621

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions crates/bevy_geometry/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "bevy_geometry"
version = "0.1.0"
authors = ["Aevyrie Roessler <[email protected]>"]
aevyrie marked this conversation as resolved.
Show resolved Hide resolved
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
bevy_math = { path = "../bevy_math", version = "0.4.0" }
24 changes: 24 additions & 0 deletions crates/bevy_geometry/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
use bevy_math::{Quat, Vec3};

pub trait Primitive3d {}

pub struct Sphere {
pub origin: Vec3,
pub radius: f32,
}

pub struct Box {
pub maximums: Vec3,
pub minimums: Vec3,
pub orientation: Quat,
}

pub struct AxisAlignedBox {
pub maximums: Vec3,
pub minimums: Vec3,
}

pub struct Plane {
pub point: Vec3,
pub normal: Vec3,
}