How to use the rlbot.utils.game_state_util.Vector3 function in rlbot

To help you get started, we’ve selected a few rlbot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github samuelpmish / ExampleBots / 4_Aerial / agent.py View on Github external
def get_output(self, packet: GameTickPacket) -> SimpleControllerState:
        self.info.read_packet(packet)
        self.controls = SimpleControllerState()

        if self.timer == 0.0:

            self.csign = random.choice([-1, 1])

            # this just initializes the car and ball
            # to different starting points each time
            c_position = Vector3(random.uniform(-1000, 1000),
                                 random.uniform(-4500, -4000),
                                 25)

            car_state = CarState(physics=Physics(
                location=c_position,
                velocity=Vector3(0, 1000, 0),
                rotation=Rotator(0, 1.5 * self.csign, 0),
                angular_velocity=Vector3(0, 0, 0)
            ))

            self.bsign = random.choice([-1, 1])

            b_position = Vector3(random.uniform(-3500, -3000) * self.bsign,
                                 random.uniform(-1500,  1500),
                                 random.uniform(  150,   500))
github Darxeal / BotimusPrime / training / botimus_training.py View on Github external
def vec3_to_Vector3(vec: vec3) -> Vector3:
    return Vector3(vec[0], vec[1], vec[2])
github Darxeal / BotimusPrime / tools / state_setting.py View on Github external
def ball_stop(self):
        self._changed = True
        self.ball.physics.angular_velocity = Vector3(0, 0, 0)
        self.ball.physics.velocity = Vector3(0, 0, 0)
github Darxeal / BotimusPrime / tools / state_setting.py View on Github external
def car_stop(self):
        self._changed = True
        self.car.physics.angular_velocity = Vector3(0, 0, 0)
        self.car.physics.velocity = Vector3(0, 0, 0)
        self.car.physics.rotation = Rotator(0, None, 0)
github RLBot / RLBotPythonExample / training / hello_world_training.py View on Github external
def make_game_state(self, rng: SeededRandomNumberGenerator) -> GameState:
        return GameState(
            ball=BallState(physics=Physics(
                location=Vector3(0, 0, 100),
                velocity=Vector3(0, 0, 0),
                angular_velocity=Vector3(0, 0, 0))),
            cars={
                0: CarState(
                    physics=Physics(
                        location=Vector3(0, 2000, 0),
                        rotation=Rotator(0, -pi / 2, 0),
                        velocity=Vector3(0, 0, 0),
                        angular_velocity=Vector3(0, 0, 0)),
                    jumped=False,
                    double_jumped=False,
                    boost_amount=100)
            },
            boosts={i: BoostState(0) for i in range(34)},
        )