newton.Contacts#
- class newton.Contacts(rigid_contact_max, soft_contact_max, requires_grad=False, device=None)[source]#
Bases:
object
Stores contact information for rigid and soft body collisions, to be consumed by a solver.
This class manages buffers for contact data such as positions, normals, thicknesses, and shape indices for both rigid-rigid and soft-rigid contacts. The buffers are allocated on the specified device and can optionally require gradients for differentiable simulation.
Note
This class is a temporary solution and its interface may change in the future.
- __init__(rigid_contact_max, soft_contact_max, requires_grad=False, device=None)#
- clear()#
Clear all contact data, resetting counts and filling indices with -1.
- property device#
Returns the device on which the contact buffers are allocated.