Struct Sphere

Source
pub struct Sphere<S: BaseFloat> {
    pub center: Point3<S>,
    pub radius: S,
}
Expand description

Bounding sphere.

Fields§

§center: Point3<S>

Center point of the sphere in world space

§radius: S

Sphere radius

Trait Implementations§

Source§

impl<S> Bound for Sphere<S>
where S: BaseFloat,

Source§

type Point = Point3<S>

Point type for the bounding volume (for dimensionality)
Source§

fn min_extent(&self) -> Point3<S>

Minimum extents of the bounding volume
Source§

fn max_extent(&self) -> Point3<S>

Maximum extents of the bounding volume
Source§

fn with_margin(&self, add: Vector3<S>) -> Self

Create a new bounding volume extended by the given amount
Source§

fn transform_volume<T>(&self, transform: &T) -> Self
where T: Transform<Self::Point>,

Apply an arbitrary transform to the bounding volume
Source§

fn empty() -> Self

Create empty volume
Source§

impl<S: Clone + BaseFloat> Clone for Sphere<S>

Source§

fn clone(&self) -> Sphere<S>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<S> ComputeBound<Sphere<S>> for Capsule<S>
where S: BaseFloat,

Source§

fn compute_bound(&self) -> Sphere<S>

Compute the bounding volume
Source§

impl<S> ComputeBound<Sphere<S>> for ConvexPolyhedron<S>
where S: BaseFloat,

Source§

fn compute_bound(&self) -> Sphere<S>

Compute the bounding volume
Source§

impl<S> ComputeBound<Sphere<S>> for Cube<S>
where S: BaseFloat,

Source§

fn compute_bound(&self) -> Sphere<S>

Compute the bounding volume
Source§

impl<S> ComputeBound<Sphere<S>> for Cuboid<S>
where S: BaseFloat,

Source§

fn compute_bound(&self) -> Sphere<S>

Compute the bounding volume
Source§

impl<S> ComputeBound<Sphere<S>> for Cylinder<S>
where S: BaseFloat,

Source§

fn compute_bound(&self) -> Sphere<S>

Compute the bounding volume
Source§

impl<S> ComputeBound<Sphere<S>> for Primitive3<S>
where S: BaseFloat,

Source§

fn compute_bound(&self) -> Sphere<S>

Compute the bounding volume
Source§

impl<S> ComputeBound<Sphere<S>> for Quad<S>
where S: BaseFloat,

Source§

fn compute_bound(&self) -> Sphere<S>

Compute the bounding volume
Source§

impl<S> ComputeBound<Sphere<S>> for Sphere<S>
where S: BaseFloat,

Source§

fn compute_bound(&self) -> Sphere<S>

Compute the bounding volume
Source§

impl<S: BaseFloat> Contains<Aabb3<S>> for Sphere<S>

Source§

fn contains(&self, aabb: &Aabb3<S>) -> bool

Containment test
Source§

impl<S: BaseFloat> Contains<Line<S, Vector3<S>, Point3<S>>> for Sphere<S>

Source§

fn contains(&self, line: &Line3<S>) -> bool

Containment test
Source§

impl<S: BaseFloat> Contains<Point3<S>> for Sphere<S>

Source§

fn contains(&self, p: &Point3<S>) -> bool

Containment test
Source§

impl<S: BaseFloat> Contains<Sphere<S>> for Aabb3<S>

Source§

fn contains(&self, sphere: &Sphere<S>) -> bool

Containment test
Source§

impl<S: BaseFloat> Contains<Sphere<S>> for Sphere<S>

Source§

fn contains(&self, other: &Sphere<S>) -> bool

Containment test
Source§

impl<S: BaseFloat> Continuous<Ray<S, Point3<S>, Vector3<S>>> for Sphere<S>

Source§

type Result = Point3<S>

Result returned by the intersection test
Source§

fn intersection(&self, r: &Ray3<S>) -> Option<Point3<S>>

Intersection test
Source§

impl<S: Debug + BaseFloat> Debug for Sphere<S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<S: BaseFloat> Discrete<Ray<S, Point3<S>, Vector3<S>>> for Sphere<S>

Source§

fn intersects(&self, r: &Ray3<S>) -> bool

Intersection test
Source§

impl<S: BaseFloat> Discrete<Sphere<S>> for Sphere<S>

Source§

fn intersects(&self, s2: &Sphere<S>) -> bool

Intersection test
Source§

impl<S: PartialEq + BaseFloat> PartialEq for Sphere<S>

Source§

fn eq(&self, other: &Sphere<S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<S: BaseFloat> PlaneBound<S> for Sphere<S>

Source§

fn relate_plane(&self, plane: Plane<S>) -> Relation

Classify the spatial relation with a plane.
Source§

fn relate_clip_space(&self, projection: Matrix4<S>) -> Relation

Classify the relation with a projection matrix.
Source§

impl<S: BaseFloat> SurfaceArea for Sphere<S>

Source§

type Scalar = S

Result type returned from surface area computation
Source§

fn surface_area(&self) -> S

Compute surface area
Source§

impl<S: BaseFloat> Union<Aabb3<S>> for Sphere<S>

Source§

type Output = Sphere<S>

Union shape created
Source§

fn union(&self, aabb: &Aabb3<S>) -> Sphere<S>

Build the union shape of self and the given shape.
Source§

impl<S: BaseFloat> Union<Sphere<S>> for Aabb3<S>

Source§

type Output = Aabb3<S>

Union shape created
Source§

fn union(&self, sphere: &Sphere<S>) -> Aabb3<S>

Build the union shape of self and the given shape.
Source§

impl<S: BaseFloat> Union for Sphere<S>

Source§

type Output = Sphere<S>

Union shape created
Source§

fn union(&self, other: &Sphere<S>) -> Sphere<S>

Build the union shape of self and the given shape.
Source§

impl<S: Copy + BaseFloat> Copy for Sphere<S>

Source§

impl<S: BaseFloat> StructuralPartialEq for Sphere<S>

Auto Trait Implementations§

§

impl<S> Freeze for Sphere<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for Sphere<S>
where S: RefUnwindSafe,

§

impl<S> Send for Sphere<S>
where S: Send,

§

impl<S> Sync for Sphere<S>
where S: Sync,

§

impl<S> Unpin for Sphere<S>
where S: Unpin,

§

impl<S> UnwindSafe for Sphere<S>
where S: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.