I’m trying to create a scene in Python where an instrument enter in collision with another object by following a predetermined path. I am using Discrete Intersections and the LinearMovementConstraint component to control the trajectory of the instrument.
However, the collision response doesn’t work. The intersections seems to be drawn correctly in the GUI but the objects just passe right through each other. Although, when the objects are pulled against each other with the mouse, the collisions work fine.
Any idea why it’s not working? I tried to include a code example within this message but I always get the “*** Forbidden. Message seems to be spam. ***” message when trying to submit.
Could you share your scene with us? (link to a github/wetransfer ..)
Since you are imposing the displacement (using the LinearMovementConstraint), the simulation will make sure this constraint is respected even if the object collides with others. Therefore the result is logical and it is working properly.
To work what you expect, a solution to impose the displacement on the rest_position and to add a RestShapeSpringForceField. But it’s hard to give appropriate advices without seeing your simulation.
The displacement is only imposed on one object. I don’t understand why the other object doesn’t deform or get pushed by it. I will try the RestShapeSpringForceField to see what it does.
Meanwhile, I’ve put a simplified scene here.
I do not advise to use DiscreteIntersection for the detection but rather the LocalMinDistance (or MinProximityIntersection) as shown below:
self.rootNode.createObject("LocalMinDistance", name="Intersection", alarmDistance="0.3", contactDistance="0.1", useLMDFilters="0")
You must be logged in to reply to this topic.
Get involved in this forum: