newton.geometry.collide_sphere_cylinder#
- newton.geometry.collide_sphere_cylinder(sphere_pos, sphere_radius, cylinder_pos, cylinder_axis, cylinder_radius, cylinder_half_height)[source]#
Core contact geometry calculation for sphere-cylinder collision.
- Parameters:
sphere_pos (vec3f) – Center position of the sphere
sphere_radius (float) – Radius of the sphere
cylinder_pos (vec3f) – Center position of the cylinder
cylinder_axis (vec3f) – Axis direction of the cylinder
cylinder_radius (float) – Radius of the cylinder
cylinder_half_height (float) – Half height of the cylinder
- Returns:
dist: Distance between surfaces (negative if overlapping) pos: Contact position (midpoint between closest surface points) normal: Contact normal vector (from sphere toward cylinder)
- Return type:
Tuple containing