You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -492,7 +492,7 @@ The primary algorithm for convex shape pairs. Uses support mapping functions to
492
492
493
493
**Multi-contact Generation**
494
494
495
-
For shape pairs, multiple contact points are generated for stable stacking and resting contacts. The collision pipeline estimates buffer sizes based on the model; you can override with ``rigid_contact_max`` when creating the pipeline via :meth:`CollisionPipeline.from_model`.
495
+
For shape pairs, multiple contact points are generated for stable stacking and resting contacts. The collision pipeline estimates buffer sizes based on the model; you can override this value with ``rigid_contact_max`` when instantiating the pipeline.
496
496
497
497
.. _Mesh Collisions:
498
498
@@ -562,7 +562,7 @@ For hydroelastic and SDF-based contacts, use :class:`~newton.SDFHydroelasticConf
562
562
moment_matching=False, # Match friction moments (experimental)
The :meth:`Model.collide` method accepts the following parameters:
833
+
:meth:`~newton.Model.contacts` creates a :class:`~newton.Contacts` buffer using a default
834
+
:class:`~newton.CollisionPipeline` (EXPLICIT broad phase, cached on first call).
835
+
:meth:`~newton.Model.collide` populates it:
824
836
825
-
.. list-table::
826
-
:header-rows: 1
827
-
:widths: 30 70
837
+
.. code-block:: python
828
838
829
-
* - Parameter
830
-
- Description
831
-
* - ``state``
832
-
- Current simulation state (required).
833
-
* - ``collision_pipeline``
834
-
- Optional :class:`~newton.CollisionPipeline`. If None, creates/reuses a default pipeline (EXPLICIT broad phase). For options like ``rigid_contact_max``, ``soft_contact_margin``, ``requires_grad``, create the pipeline via :meth:`CollisionPipeline.from_model` and pass it here.
839
+
contacts = model.contacts()
840
+
model.collide(state, contacts)
841
+
842
+
The contacts buffer can be reused across steps — ``collide`` clears it each time.
843
+
844
+
For control over broad phase mode, contact limits, or hydroelastic configuration, create a
845
+
:class:`~newton.CollisionPipeline` directly:
846
+
847
+
.. code-block:: python
848
+
849
+
from newton import CollisionPipeline, BroadPhaseMode
850
+
851
+
pipeline = CollisionPipeline(
852
+
model,
853
+
broad_phase_mode=BroadPhaseMode.SAP,
854
+
rigid_contact_max=50000,
855
+
)
856
+
contacts = pipeline.contacts()
857
+
pipeline.collide(state, contacts)
835
858
836
859
.. _Hydroelastic Contacts:
837
860
@@ -988,7 +1011,7 @@ Performance
988
1011
- Use positive collision groups to reduce candidate pairs
989
1012
- Use world indices for parallel simulations (essential for RL with many environments)
990
1013
- Contact reduction is enabled by default for mesh-heavy scenes
991
-
- Pass ``rigid_contact_max`` to :meth:`CollisionPipeline.from_model` to limit memory in complex scenes
1014
+
- Pass ``rigid_contact_max`` to :class:`~newton.CollisionPipeline` to limit memory in complex scenes
992
1015
993
1016
See Also
994
1017
--------
@@ -1008,12 +1031,14 @@ See Also
1008
1031
1009
1032
**API Reference:**
1010
1033
1034
+
- :meth:`~newton.Model.contacts` - Create a contacts buffer (default pipeline)
1035
+
- :meth:`~newton.Model.collide` - Run collision detection (default pipeline)
1011
1036
- :class:`~newton.CollisionPipeline` - Collision pipeline with configurable broad phase
1037
+
- :meth:`~newton.CollisionPipeline.contacts` - Allocate a contacts buffer for a custom pipeline
0 commit comments