pub struct BoundingBox {
pub center: Point,
pub x_axis: Vector,
pub y_axis: Vector,
pub z_axis: Vector,
pub half_size: Vector,
pub guid: String,
pub name: String,
pub xform: Xform,
}
Fields§
§center: Point
§x_axis: Vector
§y_axis: Vector
§z_axis: Vector
§half_size: Vector
§guid: String
§name: String
§xform: Xform
Implementations§
Source§impl BoundingBox
impl BoundingBox
pub fn new( center: Point, x_axis: Vector, y_axis: Vector, z_axis: Vector, half_size: Vector, ) -> Self
pub fn from_plane(plane: &Plane, dx: f32, dy: f32, dz: f32) -> Self
pub fn from_point(point: Point, inflate: f32) -> Self
pub fn from_points(points: &[Point], inflate: f32) -> Self
pub fn from_line(line: &Line, inflate: f32) -> Self
pub fn from_polyline(polyline: &Polyline, inflate: f32) -> Self
pub fn point_at(&self, x: f32, y: f32, z: f32) -> Point
pub fn corners(&self) -> [Point; 8]
pub fn two_rectangles(&self) -> [Point; 10]
pub fn inflate(&mut self, amount: f32)
fn separating_plane_exists( relative_position: &Vector, axis: &Vector, box1: &BoundingBox, box2: &BoundingBox, ) -> bool
pub fn collides_with(&self, other: &BoundingBox) -> bool
pub fn jsondump(&self) -> Result<String, Box<dyn Error>>
pub fn jsonload(json_data: &str) -> Result<Self, Box<dyn Error>>
pub fn to_json(&self, filepath: &str) -> Result<(), Box<dyn Error>>
pub fn from_json(filepath: &str) -> Result<Self, Box<dyn Error>>
Trait Implementations§
Source§impl Clone for BoundingBox
impl Clone for BoundingBox
Source§fn clone(&self) -> BoundingBox
fn clone(&self) -> BoundingBox
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BoundingBox
impl Debug for BoundingBox
Source§impl Default for BoundingBox
impl Default for BoundingBox
Source§impl<'de> Deserialize<'de> for BoundingBox
impl<'de> Deserialize<'de> for BoundingBox
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for BoundingBox
impl RefUnwindSafe for BoundingBox
impl Send for BoundingBox
impl Sync for BoundingBox
impl Unpin for BoundingBox
impl UnwindSafe for BoundingBox
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more