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,
impl<S> Bound for Sphere<S>where
S: BaseFloat,
Source§fn min_extent(&self) -> Point3<S>
fn min_extent(&self) -> Point3<S>
Minimum extents of the bounding volume
Source§fn max_extent(&self) -> Point3<S>
fn max_extent(&self) -> Point3<S>
Maximum extents of the bounding volume
Source§fn with_margin(&self, add: Vector3<S>) -> Self
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
fn transform_volume<T>(&self, transform: &T) -> Self
Apply an arbitrary transform to the bounding volume
Source§impl<S> ComputeBound<Sphere<S>> for Capsule<S>where
S: BaseFloat,
impl<S> ComputeBound<Sphere<S>> for Capsule<S>where
S: BaseFloat,
Source§fn compute_bound(&self) -> Sphere<S>
fn compute_bound(&self) -> Sphere<S>
Compute the bounding volume
Source§impl<S> ComputeBound<Sphere<S>> for ConvexPolyhedron<S>where
S: BaseFloat,
impl<S> ComputeBound<Sphere<S>> for ConvexPolyhedron<S>where
S: BaseFloat,
Source§fn compute_bound(&self) -> Sphere<S>
fn compute_bound(&self) -> Sphere<S>
Compute the bounding volume
Source§impl<S> ComputeBound<Sphere<S>> for Cube<S>where
S: BaseFloat,
impl<S> ComputeBound<Sphere<S>> for Cube<S>where
S: BaseFloat,
Source§fn compute_bound(&self) -> Sphere<S>
fn compute_bound(&self) -> Sphere<S>
Compute the bounding volume
Source§impl<S> ComputeBound<Sphere<S>> for Cuboid<S>where
S: BaseFloat,
impl<S> ComputeBound<Sphere<S>> for Cuboid<S>where
S: BaseFloat,
Source§fn compute_bound(&self) -> Sphere<S>
fn compute_bound(&self) -> Sphere<S>
Compute the bounding volume
Source§impl<S> ComputeBound<Sphere<S>> for Cylinder<S>where
S: BaseFloat,
impl<S> ComputeBound<Sphere<S>> for Cylinder<S>where
S: BaseFloat,
Source§fn compute_bound(&self) -> Sphere<S>
fn compute_bound(&self) -> Sphere<S>
Compute the bounding volume
Source§impl<S> ComputeBound<Sphere<S>> for Primitive3<S>where
S: BaseFloat,
impl<S> ComputeBound<Sphere<S>> for Primitive3<S>where
S: BaseFloat,
Source§fn compute_bound(&self) -> Sphere<S>
fn compute_bound(&self) -> Sphere<S>
Compute the bounding volume
Source§impl<S> ComputeBound<Sphere<S>> for Quad<S>where
S: BaseFloat,
impl<S> ComputeBound<Sphere<S>> for Quad<S>where
S: BaseFloat,
Source§fn compute_bound(&self) -> Sphere<S>
fn compute_bound(&self) -> Sphere<S>
Compute the bounding volume
Source§impl<S> ComputeBound<Sphere<S>> for Sphere<S>where
S: BaseFloat,
impl<S> ComputeBound<Sphere<S>> for Sphere<S>where
S: BaseFloat,
Source§fn compute_bound(&self) -> Sphere<S>
fn compute_bound(&self) -> Sphere<S>
Compute the bounding volume
Source§impl<S: BaseFloat> Discrete<Ray<S, Point3<S>, Vector3<S>>> for Sphere<S>
impl<S: BaseFloat> Discrete<Ray<S, Point3<S>, Vector3<S>>> for Sphere<S>
Source§fn intersects(&self, r: &Ray3<S>) -> bool
fn intersects(&self, r: &Ray3<S>) -> bool
Intersection test
Source§impl<S: BaseFloat> Discrete<Sphere<S>> for Sphere<S>
impl<S: BaseFloat> Discrete<Sphere<S>> for Sphere<S>
Source§fn intersects(&self, s2: &Sphere<S>) -> bool
fn intersects(&self, s2: &Sphere<S>) -> bool
Intersection test
Source§impl<S: BaseFloat> PlaneBound<S> for Sphere<S>
impl<S: BaseFloat> PlaneBound<S> for Sphere<S>
Source§fn relate_plane(&self, plane: Plane<S>) -> Relation
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
fn relate_clip_space(&self, projection: Matrix4<S>) -> Relation
Classify the relation with a projection matrix.
Source§impl<S: BaseFloat> SurfaceArea for Sphere<S>
impl<S: BaseFloat> SurfaceArea for Sphere<S>
impl<S: Copy + BaseFloat> Copy for Sphere<S>
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> 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