newton.geometry.collide_sphere_box#

newton.geometry.collide_sphere_box(sphere_pos, sphere_radius, box_pos, box_rot, box_size)[source]#

Core contact geometry calculation for sphere-box collision.

Parameters:
  • sphere_pos (vec3f) – Center position of the sphere

  • sphere_radius (float) – Radius of the sphere

  • box_pos (vec3f) – Center position of the box

  • box_rot (mat33f) – Rotation matrix of the box

  • box_size (vec3f) – Half-extents of the box along each axis

Returns:

dist: Distance between surfaces (negative if overlapping) pos: Contact position (midpoint between closest surface points) normal: Contact normal vector (from sphere toward box)

Return type:

Tuple containing