newton.geometry.collide_sphere_capsule#
- newton.geometry.collide_sphere_capsule(sphere_pos, sphere_radius, capsule_pos, capsule_axis, capsule_radius, capsule_half_length)[source]#
Core contact geometry calculation for sphere-capsule collision.
- Parameters:
sphere_pos (vec3f) – Center position of the sphere
sphere_radius (float) – Radius of the sphere
capsule_pos (vec3f) – Center position of the capsule
capsule_axis (vec3f) – Axis direction of the capsule
capsule_radius (float) – Radius of the capsule
capsule_half_length (float) – Half length of the capsule
- Returns:
dist: Distance between surfaces (negative if overlapping) pos: Contact position (midpoint between closest surface points) normal: Contact normal vector (from sphere toward capsule)
- Return type:
Tuple containing