Skip to content

Commit

Permalink
replace DefaultContactManager with CollisionResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
fredroy committed Sep 30, 2024
1 parent fe2d9d2 commit c65af39
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def createScene(rootNode):
"Sofa.Component.Collision.Detection.Algorithm",
# Needed to use components BVHNarrowPhase, BruteForceBroadPhase, DefaultPipeline
"Sofa.Component.Collision.Detection.Intersection", # Needed to use components LocalMinDistance
"Sofa.Component.Collision.Response.Contact", # Needed to use components DefaultContactManager
"Sofa.Component.Collision.Response.Contact", # Needed to use components CollisionResponse
"Sofa.Component.Constraint.Lagrangian.Correction",
# Needed to use components LinearSolverConstraintCorrection
"Sofa.Component.Constraint.Lagrangian.Solver", # Needed to use components GenericConstraintSolver
Expand All @@ -40,7 +40,7 @@ def createScene(rootNode):
rootNode.addObject('DefaultPipeline')
rootNode.addObject('BruteForceBroadPhase', name="N2")
rootNode.addObject('BVHNarrowPhase')
rootNode.addObject('DefaultContactManager', response="FrictionContactConstraint", responseParams="mu=0")
rootNode.addObject('CollisionResponse', response="FrictionContactConstraint", responseParams="mu=0")
rootNode.addObject('LocalMinDistance', name="Proximity", alarmDistance=1, contactDistance=0.1)

rootNode.addObject('BackgroundSetting', color=[0, 0.168627, 0.211765, 1])
Expand Down
4 changes: 2 additions & 2 deletions examples/tutorials/CircularRobot/circularrobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def createScene(rootNode):
"Sofa.Component.Collision.Geometry",
# Needed to use components LineCollisionModel, PointCollisionModel, TriangleCollisionModel
"Sofa.Component.Collision.Response.Contact",
# Needed to use components DefaultContactManager
# Needed to use components CollisionResponse
"Sofa.Component.Constraint.Lagrangian.Correction",
# Needed to use components GenericConstraintCorrection, UncoupledConstraintCorrection
"Sofa.Component.Constraint.Lagrangian.Solver",
Expand Down Expand Up @@ -166,7 +166,7 @@ def createScene(rootNode):
rootNode.addObject('DefaultPipeline')
rootNode.addObject('BruteForceBroadPhase')
rootNode.addObject('BVHNarrowPhase')
rootNode.addObject('DefaultContactManager', response="FrictionContactConstraint", responseParams="mu=0.8")
rootNode.addObject('CollisionResponse', response="FrictionContactConstraint", responseParams="mu=0.8")
rootNode.addObject('LocalMinDistance', alarmDistance=5, contactDistance=1, angleCone=0.0)

Floor(rootNode)
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorials/PneunetGripper/pneunetgripper-tuto.html
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ <h2 id="appendix">Appendix</h2>
<a class="sourceLine" id="cb18-27" title="27"> rootNode.addObject(<span class="st">&#39;GenericConstraintSolver&#39;</span>, tolerance<span class="op">=</span><span class="fl">1e-12</span>, maxIterations<span class="op">=</span><span class="dv">10000</span>)</a>
<a class="sourceLine" id="cb18-28" title="28"> rootNode.addObject(<span class="st">&#39;DefaultPipeline&#39;</span>)</a>
<a class="sourceLine" id="cb18-29" title="29"> rootNode.addObject(<span class="st">&#39;BruteForceDetection&#39;</span>)</a>
<a class="sourceLine" id="cb18-30" title="30"> rootNode.addObject(<span class="st">&#39;DefaultContactManager&#39;</span>, response<span class="op">=</span><span class="st">&#39;FrictionContact&#39;</span>, responseParams<span class="op">=</span><span class="st">&#39;mu=0.6&#39;</span>)</a>
<a class="sourceLine" id="cb18-30" title="30"> rootNode.addObject(<span class="st">&#39;CollisionResponse&#39;</span>, response<span class="op">=</span><span class="st">&#39;FrictionContact&#39;</span>, responseParams<span class="op">=</span><span class="st">&#39;mu=0.6&#39;</span>)</a>
<a class="sourceLine" id="cb18-31" title="31"> rootNode.addObject(<span class="st">&#39;LocalMinDistance&#39;</span>, name<span class="op">=</span><span class="st">&#39;Proximity&#39;</span>, alarmDistance<span class="op">=</span><span class="dv">5</span>, contactDistance<span class="op">=</span><span class="dv">1</span>, angleCone<span class="op">=</span><span class="fl">0.0</span>)</a>
<a class="sourceLine" id="cb18-32" title="32"></a>
<a class="sourceLine" id="cb18-33" title="33"> rootNode.addObject(<span class="st">&#39;BackgroundSetting&#39;</span>, color<span class="op">=</span>[<span class="dv">0</span>, <span class="fl">0.168627</span>, <span class="fl">0.211765</span>])</a>
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorials/PneunetGripper/pneunetgripper-tuto.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def createScene(rootNode):
rootNode.addObject('GenericConstraintSolver', tolerance=1e-12, maxIterations=10000)
rootNode.addObject('DefaultPipeline')
rootNode.addObject('BruteForceDetection')
rootNode.addObject('DefaultContactManager', response='FrictionContactConstraint', responseParams='mu=0.6')
rootNode.addObject('CollisionResponse', response='FrictionContactConstraint', responseParams='mu=0.6')
rootNode.addObject('LocalMinDistance', name='Proximity', alarmDistance=5, contactDistance=1, angleCone=0.0)

rootNode.addObject('BackgroundSetting', color=[0, 0.168627, 0.211765])
Expand Down
4 changes: 2 additions & 2 deletions examples/tutorials/SoftArmGripper/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def addHeader(node):
"Sofa.Component.Collision.Detection.Algorithm",
# Needed to use components BVHNarrowPhase, BruteForceBroadPhase, DefaultPipeline
"Sofa.Component.Collision.Detection.Intersection", # Needed to use components LocalMinDistance
"Sofa.Component.Collision.Response.Contact", # Needed to use components DefaultContactManager
"Sofa.Component.Collision.Response.Contact", # Needed to use components CollisionResponse
"Sofa.Component.Constraint.Lagrangian.Correction", # Needed to use components GenericConstraintCorrection
"Sofa.Component.Constraint.Lagrangian.Solver", # Needed to use components GenericConstraintSolver
"Sofa.Component.IO.Mesh", # Needed to use components MeshOBJLoader
Expand Down Expand Up @@ -40,6 +40,6 @@ def addHeader(node):
node.addObject('DefaultPipeline')
node.addObject('BruteForceBroadPhase')
node.addObject('BVHNarrowPhase')
node.addObject('DefaultContactManager', response="FrictionContactConstraint")
node.addObject('CollisionResponse', response="FrictionContactConstraint")
node.addObject('LocalMinDistance', alarmDistance=5, contactDistance=1)
node.addObject('BackgroundSetting', color=[0, 0, 0, 1])

0 comments on commit c65af39

Please sign in to comment.