Exemplo n.º 1
0
 def get_position_in_front(caster_location):
     orientation = caster_location.o
     position = Vector(
         math.cos(orientation) * 2,
         math.sin(orientation) * 2) + caster_location
     position.o = orientation
     return position
Exemplo n.º 2
0
    def get_position_for_totem(totem_tool_id, caster_location):
        totem_slot = SummonedObjectPositions.TOTEM_INDICES_BY_TOOL.get(
            totem_tool_id, -1)
        if totem_slot == -1:
            return caster_location

        totem_angle = math.pi / float(TotemSlots.MAX_TOTEM_SLOT) - (
            totem_slot * 2 * math.pi / float(TotemSlots.MAX_TOTEM_SLOT))

        totem_angle += caster_location.o  # Orientation
        position = Vector(2 * math.cos(totem_angle),
                          2 * math.sin(totem_angle)) + caster_location
        position.o = caster_location.o
        return position