Ejemplo n.º 1
0
    def _init_collision_shapes(self):
        """Initialize collision shape list

        """
        if 'collision shapes' in self.data:
            for couple_of_shapes in self.data['collision shapes']:
                self.collision_shapes.append(choose_solver(*couple_of_shapes))
Ejemplo n.º 2
0
    def _init_collision_shapes(self):
        """Initialize collision shape list

        """
        if 'collision shapes' in self.data:
            for couple_of_shapes in self.data['collision shapes']:
                self.collision_shapes.append(choose_solver(*couple_of_shapes))
Ejemplo n.º 3
0
 def __init__(self, shapes, collision_solver, proximity, name):
     assert isinstance(shapes[0], Shape)
     assert isinstance(shapes[1], Shape)
     Constraint.__init__(self, name)
     if collision_solver is None:
         # automatically find the collision solver
         from arboris.collisions import choose_solver
         (shapes, collision_solver) = choose_solver(shapes[0], shapes[1])
     self._shapes = shapes
     self._is_active = None
     self._sdist = None
     self._frames = (MovingSubFrame(shapes[0].frame.body),
                     MovingSubFrame(shapes[1].frame.body))
     self._collision_solver = collision_solver
     self._proximity = proximity
Ejemplo n.º 4
0
    def __init__(self, sh1, sh2, name=None):
        """ Record the distance between two shapes.

        :param sh1: the first shape to compute the distance
        :type  sh1: :class:`~arboris.core.Shape`
        :param sh2: the first shape to compute the distance
        :type  sh2: :class:`~arboris.core.Shape`
        :param string name: the instance name of the observer

        **Warning:**

        This recorder works only if a distance solver for these two shapes
        is returned by :meth:`~arboris.collisions.choose_solver`.

        """
        _Recorder.__init__(self, name)
        self.shapes, self.solver = choose_solver(sh1, sh2)