pub struct Sphere {
pub center: Vector3,
pub radius: f64,
}Expand description
Port of three.js/src/math/Sphere.js’s Sphere class: an analytical 3D
sphere defined by a center and radius, mainly used as a bounding sphere.
Fields§
§center: Vector3The center of the sphere.
radius: f64The radius of the sphere.
Implementations§
Source§impl Sphere
impl Sphere
Sourcepub fn set_from_points(
&mut self,
points: &[Vector3],
optional_center: Option<&Vector3>,
) -> &mut Self
pub fn set_from_points( &mut self, points: &[Vector3], optional_center: Option<&Vector3>, ) -> &mut Self
Sphere.setFromPoints().
Sourcepub fn make_empty(&mut self) -> &mut Self
pub fn make_empty(&mut self) -> &mut Self
Sphere.makeEmpty().
Sourcepub fn contains_point(&self, point: &Vector3) -> bool
pub fn contains_point(&self, point: &Vector3) -> bool
Sphere.containsPoint().
Sourcepub fn distance_to_point(&self, point: &Vector3) -> f64
pub fn distance_to_point(&self, point: &Vector3) -> f64
Sphere.distanceToPoint().
Sourcepub fn intersects_sphere(&self, sphere: &Self) -> bool
pub fn intersects_sphere(&self, sphere: &Self) -> bool
Sphere.intersectsSphere().
Sourcepub fn intersects_box(&self, box_: &Box3) -> bool
pub fn intersects_box(&self, box_: &Box3) -> bool
Sphere.intersectsBox().
Sourcepub fn intersects_plane(&self, plane: &Plane) -> bool
pub fn intersects_plane(&self, plane: &Plane) -> bool
Sphere.intersectsPlane().
Sourcepub fn clamp_point(&self, point: &Vector3) -> Vector3
pub fn clamp_point(&self, point: &Vector3) -> Vector3
Sphere.clampPoint().
Sourcepub fn get_bounding_box(&self) -> Box3
pub fn get_bounding_box(&self) -> Box3
Sphere.getBoundingBox().
Sourcepub fn apply_matrix4(&mut self, matrix: &Matrix4) -> &mut Self
pub fn apply_matrix4(&mut self, matrix: &Matrix4) -> &mut Self
Sphere.applyMatrix4().
Sourcepub fn expand_by_point(&mut self, point: &Vector3) -> &mut Self
pub fn expand_by_point(&mut self, point: &Vector3) -> &mut Self
Sphere.expandByPoint().
Trait Implementations§
impl Copy for Sphere
impl StructuralPartialEq for Sphere
Auto Trait Implementations§
impl Freeze for Sphere
impl RefUnwindSafe for Sphere
impl Send for Sphere
impl Sync for Sphere
impl Unpin for Sphere
impl UnsafeUnpin for Sphere
impl UnwindSafe for Sphere
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