Enum ColliderShape3D
#[repr(C)]pub enum ColliderShape3D {
Sphere {
radius: f32,
},
Capsule {
radius: f32,
half_height: f32,
},
Cuboid {
half_extents: [f32; 3],
},
Cylinder {
radius: f32,
half_height: f32,
},
ConvexHull {
points: [[f32; 3]; 16],
point_count: u8,
},
SdfAnalytical {
primitive: SdfPrimitive,
},
}Expand description
Unified 3D collider shape supporting analytical primitives, convex hulls, and analytical SDFs.
Variants§
Sphere
Sphere of given radius.
Capsule
Vertical Y-axis capsule with hemisphere radius and cylinder half_height.
Cuboid
Oriented box with local half_extents [hx, hy, hz].
Cylinder
Vertical Y-axis cylinder with radius and half_height.
ConvexHull
Convex hull point cloud in local coordinates (point_count <= 16).
SdfAnalytical
First-class analytical SDF collider (HolographicNodeGpu / PROC1).
Fields
primitive: SdfPrimitiveImplementations§
§impl ColliderShape3D
impl ColliderShape3D
pub fn support_point_local(&self, dir_local: [f32; 3]) -> [f32; 3]
pub fn support_point_local(&self, dir_local: [f32; 3]) -> [f32; 3]
Evaluates the farthest point on the shape along dir_local in local coordinates.
pub fn support_point_world(
&self,
motor: &Motor,
dir_world: [f32; 3],
) -> [f32; 3]
pub fn support_point_world( &self, motor: &Motor, dir_world: [f32; 3], ) -> [f32; 3]
Evaluates the support point in world coordinates using the shape’s PGA Motor.
pub fn local_aabb(&self) -> Aabb3D
pub fn local_aabb(&self) -> Aabb3D
Computes the local-space Aabb3D of this collider shape.
pub fn world_aabb(&self, motor: &Motor) -> Aabb3D
pub fn world_aabb(&self, motor: &Motor) -> Aabb3D
Computes a world-space Aabb3D enclosing the transformed shape.
pub fn volume(&self) -> f32
pub fn volume(&self) -> f32
Approximate volume ($m^3$) of the collider in local space (used for mass & Archimedes buoyancy).
pub fn estimate_inv_inertia_local(&self, mass_kg: f32) -> [f32; 3]
pub fn estimate_inv_inertia_local(&self, mass_kg: f32) -> [f32; 3]
Estimates the principal local inverse inertia diagonal $[I_{xx}^{-1}, I_{yy}^{-1}, I_{zz}^{-1}]$
for a given mass_kg.
Trait Implementations§
§impl Clone for ColliderShape3D
impl Clone for ColliderShape3D
§fn clone(&self) -> ColliderShape3D
fn clone(&self) -> ColliderShape3D
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ColliderShape3D
§impl Debug for ColliderShape3D
impl Debug for ColliderShape3D
§impl Default for ColliderShape3D
impl Default for ColliderShape3D
§fn default() -> ColliderShape3D
fn default() -> ColliderShape3D
§impl PartialEq for ColliderShape3D
impl PartialEq for ColliderShape3D
impl StructuralPartialEq for ColliderShape3D
Auto Trait Implementations§
impl Freeze for ColliderShape3D
impl RefUnwindSafe for ColliderShape3D
impl Send for ColliderShape3D
impl Sync for ColliderShape3D
impl Unpin for ColliderShape3D
impl UnsafeUnpin for ColliderShape3D
impl UnwindSafe for ColliderShape3D
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more