Ejemplo n.º 1
0
Archivo: entity.py Proyecto: jdddog/hri
    def is_infront_of(self, other_entity):
        if not isinstance(other_entity, AbstractEntity):
            raise TypeError("is_infront_of() parameter other_entity={0} is not a subclass of AbstractEntity".format(other_entity))

        origin = Point()
        other = self.translation_to(other_entity)
        return GeomMath.is_infront_of(other, origin)
Ejemplo n.º 2
0
Archivo: entity.py Proyecto: jdddog/hri
    def is_infront_of(self, other_entity):
        if not isinstance(other_entity, AbstractEntity):
            raise TypeError(
                "is_infront_of() parameter other_entity={0} is not a subclass of AbstractEntity"
                .format(other_entity))

        origin = Point()
        other = self.translation_to(other_entity)
        return GeomMath.is_infront_of(other, origin)
Ejemplo n.º 3
0
 def test_is_infront_of(self):
     self.assertTrue(GeomMath.is_infront_of(self.infront, self.center))
     self.assertFalse(GeomMath.is_infront_of(self.behind, self.center))