1#![forbid(unsafe_code)]
2#![cfg_attr(
3 any(docsrs, docsrs_dep),
4 expect(
5 internal_features,
6 reason = "rustdoc_internals is needed for fake_variadic"
7 )
8)]
9#![cfg_attr(any(docsrs, docsrs_dep), feature(rustdoc_internals))]
10#![cfg_attr(docsrs, feature(doc_cfg))]
11#![doc(
12 html_logo_url = "https://bevy.org/assets/icon.png",
13 html_favicon_url = "https://bevy.org/assets/icon.png"
14)]
15#![no_std]
16
17#[cfg(feature = "std")]
22extern crate std;
23
24#[cfg(feature = "alloc")]
25extern crate alloc;
26
27mod dim2;
28pub use dim2::*;
29mod dim3;
30pub use dim3::*;
31mod half_space;
32pub use half_space::*;
33mod view_frustum;
34pub use view_frustum::*;
35mod inset;
36pub use inset::*;
37mod ray;
38pub use ray::{Ray2d, Ray3d};
39mod bounding;
40pub use bounding::*;
41
42#[cfg(feature = "rand")]
43pub mod sampling;
44#[cfg(feature = "rand")]
45pub use sampling::ShapeSample;
46
47#[cfg(feature = "alloc")]
48mod polygon;
49#[cfg(feature = "alloc")]
50pub use polygon::*;
51
52pub trait Primitive2d {}
54
55pub trait Primitive3d {}
57
58impl Primitive2d for bevy_math::Dir2 {}
59impl Primitive3d for bevy_math::Dir3 {}
60impl Primitive3d for bevy_math::Dir3A {}
61
62#[derive(Clone, Copy, Debug, PartialEq, Eq)]
64#[doc(alias = "Orientation")]
65pub enum WindingOrder {
66 Clockwise,
68 #[doc(alias = "AntiClockwise")]
70 CounterClockwise,
71 #[doc(alias("Degenerate", "Collinear"))]
74 Invalid,
75}
76
77pub trait Measured2d {
79 fn perimeter(&self) -> f32;
81
82 fn area(&self) -> f32;
84}
85
86pub trait Measured3d {
88 fn area(&self) -> f32;
90
91 fn volume(&self) -> f32;
93}
94
95pub mod prelude {
99 #[doc(hidden)]
101 pub use crate::{Measured2d, Measured3d, Primitive2d, Primitive3d, WindingOrder};
102
103 #[doc(hidden)]
104 pub use crate::bounding::*;
105
106 #[doc(hidden)]
107 pub use crate::dim2::*;
108
109 #[doc(hidden)]
110 pub use crate::dim3::*;
111
112 #[doc(hidden)]
113 pub use crate::half_space::*;
114
115 #[doc(hidden)]
116 pub use crate::inset::*;
117
118 #[doc(hidden)]
119 pub use crate::ray::{Ray2d, Ray3d};
120
121 #[doc(hidden)]
122 pub use crate::view_frustum::*;
123
124 #[doc(hidden)]
125 #[cfg(feature = "rand")]
126 pub use crate::sampling::ShapeSample;
127
128 #[doc(hidden)]
129 #[cfg(feature = "alloc")]
130 pub use crate::polygon::*;
131}