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 more