diff --git a/src/bot.py b/src/bot.py index 8fa1905..bd883a8 100644 --- a/src/bot.py +++ b/src/bot.py @@ -11,7 +11,6 @@ from util.vec import Vec3 -# Would you like to use numpy utilities? Check out the np_util folder! class MyBot(BaseAgent): diff --git a/src/np_util/data.py b/src/np_util/data.py deleted file mode 100644 index 6c23ec2..0000000 --- a/src/np_util/data.py +++ /dev/null @@ -1,141 +0,0 @@ -'''Rocket League data pre-processing.''' - -from .utils import Car, Ball, BoostPad, arr_from_list, arr_from_rot, arr_from_vec, orient_matrix - -import numpy as np - - -def setup(self, packet, field_info): - """Sets up the variables and classes for the agent. - - Arguments: - self {BaseAgent} -- The agent. - packet {GameTickPacket} -- Information about the game. - field_info {FieldInfoPacket} -- Information about the game field. - """ - - # Game info - self.game_time = packet.game_info.seconds_elapsed - self.dt = 1.0 / 120.0 - self.last_time = 0.0 - self.r_active = packet.game_info.is_round_active - self.ko_pause = packet.game_info.is_kickoff_pause - self.m_ended = packet.game_info.is_match_ended - self.gravity = packet.game_info.world_gravity_z - - # Creates Car objects for each car. - self.teammates = [] - self.opponents = [] - for index in range(packet.num_cars): - car = packet.game_cars[index] - if index == self.index: - self.player = Car(self.index, self.team, self.name) - elif car.team == self.team: - self.teammates.append(Car(index, car.team, car.name)) - else: - self.opponents.append(Car(index, car.team, car.name)) - - # Creates a Ball object. - self.ball = Ball() - - # Creates Boostpad objects. - self.l_pads = [] - self.s_pads = [] - for i in range(field_info.num_boosts): - pad = field_info.boost_pads[i] - pad_type = self.l_pads if pad.is_full_boost else self.s_pads - pad_obj = BoostPad(i, arr_from_vec(pad.location)) - pad_type.append(pad_obj) - - -def process(self, packet): - """Processes the gametick packet. - Arguments: - self {BaseAgent} -- The agent. - packet {GameTickPacket} -- The game packet being processed. - """ - - # Processing game info. - self.game_time = packet.game_info.seconds_elapsed - self.dt = self.game_time - self.last_time - self.last_time = self.game_time - self.r_active = packet.game_info.is_round_active - self.ko_pause = packet.game_info.is_kickoff_pause - self.m_ended = packet.game_info.is_match_ended - self.gravity = packet.game_info.world_gravity_z - - # Processing player data. - # From packet: - self.player.pos = arr_from_vec(packet.game_cars[self.player.index].physics.location) - self.player.rot = arr_from_rot(packet.game_cars[self.player.index].physics.rotation) - self.player.vel = arr_from_vec(packet.game_cars[self.player.index].physics.velocity) - self.player.ang_vel = arr_from_vec(packet.game_cars[self.player.index].physics.angular_velocity) - self.player.dead = packet.game_cars[self.player.index].is_demolished - self.player.wheel_c = packet.game_cars[self.player.index].has_wheel_contact - self.player.sonic = packet.game_cars[self.player.index].is_super_sonic - self.player.jumped = packet.game_cars[self.player.index].jumped - self.player.d_jumped = packet.game_cars[self.player.index].double_jumped - self.player.boost = packet.game_cars[self.player.index].boost - # Calculated: - self.player.orient_m = orient_matrix(self.player.rot, self.player.orient_m) - - # Processing teammates. - for teammate in self.teammates: - # From packet: - teammate.pos = arr_from_vec(packet.game_cars[teammate.index].physics.location) - teammate.rot = arr_from_rot(packet.game_cars[teammate.index].physics.rotation) - teammate.vel = arr_from_vec(packet.game_cars[teammate.index].physics.velocity) - teammate.ang_vel = arr_from_vec(packet.game_cars[teammate.index].physics.angular_velocity) - teammate.dead = packet.game_cars[teammate.index].is_demolished - teammate.wheel_c = packet.game_cars[teammate.index].has_wheel_contact - teammate.sonic = packet.game_cars[teammate.index].is_super_sonic - teammate.jumped = packet.game_cars[teammate.index].jumped - teammate.d_jumped = packet.game_cars[teammate.index].double_jumped - teammate.boost = packet.game_cars[teammate.index].boost - - # Processing opponents. - for opponent in self.opponents: - # From packet: - opponent.pos = arr_from_vec(packet.game_cars[opponent.index].physics.location) - opponent.rot = arr_from_rot(packet.game_cars[opponent.index].physics.rotation) - opponent.vel = arr_from_vec(packet.game_cars[opponent.index].physics.velocity) - opponent.ang_vel = arr_from_vec(packet.game_cars[opponent.index].physics.angular_velocity) - opponent.dead = packet.game_cars[opponent.index].is_demolished - opponent.wheel_c = packet.game_cars[opponent.index].has_wheel_contact - opponent.sonic = packet.game_cars[opponent.index].is_super_sonic - opponent.jumped = packet.game_cars[opponent.index].jumped - opponent.d_jumped = packet.game_cars[opponent.index].double_jumped - opponent.boost = packet.game_cars[opponent.index].boost - - # Processing Ball data. - self.ball.pos = arr_from_vec(packet.game_ball.physics.location) - self.ball.rot = arr_from_rot(packet.game_ball.physics.rotation) - self.ball.vel = arr_from_vec(packet.game_ball.physics.velocity) - self.ball.ang_vel = arr_from_vec(packet.game_ball.physics.angular_velocity) - self.ball.last_touch = packet.game_ball.latest_touch - - # Processing ball prediction. - ball_prediction_struct = self.get_ball_prediction_struct() - dtype = [ - ('physics', [ - ('pos', ' np.ndarray: - """Converts list to numpy array. - Arguments: - L {list} -- The list to convert containing 3 elements. - Returns: - np.array -- Numpy array with the same contents as the list. - """ - if len(L) != 3: - raise ValueError('Expected a list of length 3.') - return np.array(L[0], L[1], L[2]) - - -def arr_from_rot(R: Rotator) -> np.ndarray: - """Converts rotator to numpy array. - - Arguments: - R {Rotator} -- Rotator class containing pitch, yaw, and roll. - - Returns: - np.ndarray -- Numpy array with the same contents as the rotator. - """ - return np.array([R.pitch, R.yaw, R.roll]) - - -def arr_from_vec(V: Vector3) -> np.ndarray: - """Converts vector3 to numpy array. - - Arguments: - V {Vector3} -- Vector3 class containing x, y, and z. - - Returns: - np.ndarray -- Numpy array with the same contents as the vector3. - """ - return np.array([V.x, V.y, V.z]) - - -# ----------------------------------------------------------- - -# USEFUL UTILITY FUNCTIONS: - -def normalise(V: np.ndarray) -> np.ndarray: - """Normalises a vector. - - Arguments: - V {np.ndarray} -- Vector. - - Returns: - np.ndarray -- Normalised vector. - """ - magnitude = np.linalg.norm(V) - if magnitude != 0.0: - return V / magnitude - else: - return V - - -def angle_between_vectors(v1: np.ndarray, v2: np.ndarray) -> float: - """Returns the positive angle in radians between vectors v1 and v2. - - Arguments: - v1 {np.ndarray} -- First vector. - v2 {np.ndarray} -- Second vector - - Returns: - float -- Positive acute angle between the vectors in radians. - """ - v1_u = normalise(v1) - v2_u = normalise(v2) - return np.arccos(np.clip(np.dot(v1_u, v2_u), -1.0, 1.0)) - -# ----------------------------------------------------------- - -# FUNCTIONS FOR CONVERTING BETWEEN WORLD AND LOCAL COORDINATES: - -def orient_matrix(R: np.ndarray, A: np.ndarray = np.zeros((3, 3))) -> np.ndarray: - """Converts from Euler angles to an orientation matrix. - - Arguments: - R {np.ndarray} -- Pitch, yaw, and roll. - A {np.ndarray} -- Previous orientation matrix. (default: {np.zeros((3, 3))}) - - Returns: - np.ndarray -- Orientation matrix of shape (3, 3). - """ - # Credits to chip https://samuelpmish.github.io/notes/RocketLeague/aerial_control/ - pitch: float = R[0] - yaw: float = R[1] - roll: float = R[2] - - CR: float = np.cos(roll) - SR: float = np.sin(roll) - CP: float = np.cos(pitch) - SP: float = np.sin(pitch) - CY: float = np.cos(yaw) - SY: float = np.sin(yaw) - - A = np.zeros((3, 3)) - - # front direction - A[0, 0] = CP * CY - A[1, 0] = CP * SY - A[2, 0] = SP - - # right direction - A[0, 1] = CY * SP * SR - CR * SY - A[1, 1] = SY * SP * SR + CR * CY - A[2, 1] = -CP * SR - - # up direction - A[0, 2] = -CR * CY * SP - SR * SY - A[1, 2] = -CR * SY * SP + SR * CY - A[2, 2] = CP * CR - - return A - - -def local(A: np.ndarray, p0: np.ndarray, p1: np.ndarray) -> np.ndarray: - """Transforms world coordinates into local coordinates. - - Arguments: - A {np.ndarray} -- The local orientation matrix. - p0 {np.ndarray} -- World x, y, and z coordinates of the start point for the vector. - p1 {np.ndarray} -- World x, y, and z coordinates of the end point for the vector. - - Returns: - np.ndarray -- Local x, y, and z coordinates. - """ - return np.dot(A.T, p1 - p0) - - -def world(A: np.ndarray, p0: np.ndarray, p1: np.ndarray) -> np.ndarray: - """Transforms local into world coordinates. - - Arguments: - A {np.ndarray} -- The local orientation matrix. - p0 {np.ndarray} -- World x, y, and z coordinates of the start point for the vector. - p1 {np.ndarray} -- Local x, y, and z coordinates of the end point for the vector. - - Returns: - np.ndarray -- World x, y, and z coordinates. - """ - return p0 + A * p1 - -# ----------------------------------------------------------- - -# ROCKET LEAGUE SPECIFIC FUNCTIONS: - -def team_sign(team: int) -> int: - """Gives the sign for a calculation based on team. - - Arguments: - team {int} -- 0 if Blue, 1 if Orange. - - Returns: - int -- 1 if Blue, -1 if Orange - """ - # Other creative ways to do it: - - # return (1, -1)[team] - - # return 1 if team == 0 else -1 - - # for i in range(team): - # return 1 - # return -1 - - # return -range(-1, 2, -2)[team] - - return -2 * team + 1 - - -def turn_r(v: np.ndarray) -> float: - """Calculates the minimum turning radius for given velocity. - - Arguments: - v {np.ndarray} -- A velocity vector. - - Returns: - float -- The smallest radius possible for the given velocity. - """ - s = np.linalg.norm(v) - return -6.901E-11 * s**4 + 2.1815E-07 * s**3 - 5.4437E-06 * s**2 + 0.12496671 * s + 157 - -# ----------------------------------------------------------- - -# OTHER: - -def linear_predict(start_pos: np.ndarray, start_vel: np.ndarray, start_time: float, seconds: float) -> np.ndarray: - """Predicts motion of object in a straight line. - - Arguments: - start_pos {np.ndarray} -- Current position. - start_vel {np.ndarray} -- Current velocity. - start_time {float} -- Current time. - seconds {float} -- Time for which to predict. - - Returns: - np.ndarray -- linear prediction, 60 tps. - dtype = [ - ('pos', float, (ticks, 3)), - ('vel', float, (ticks, 3)), - ('time', float, (ticks, 1)) - ] - """ - ticks = int(60*seconds) - time = np.linspace(0, seconds, ticks)[:, np.newaxis] - pos = start_pos + time * start_vel - vel = np.ones_like(time) * start_vel - time += start_time - - dtype = [('pos', float, (ticks, 3)), ('vel', float, (ticks, 3)), ('time', float, (ticks, 1))] - prediction = np.array((pos, vel, time), dtype=dtype) - return prediction - - -def closest_to(pos: np.ndarray, others: np.ndarray) -> int: - """Finds the index of the closest point. - - Arguments: - pos {np.ndarray} -- coordinates of the position of interest. - others {np.ndarray} -- Array where each row is a position. - - Returns: - int -- index of the closest position to the position of interest. - """ - vectors = others - pos - distances = np.sqrt(np.einsum('ij,ij->i', vectors, vectors)) - return np.argmin(distances) # returns first if more than one is closest - - -def special_sauce(x: float, a: float) -> float: - """Modified sigmoid function. - - Arguments: - x {float} -- The input. - a {float} -- Constant; larger => faster rise. - - Returns: - float -- Output. - """ - # Graph showing how it can be used for steering: - # https://www.geogebra.org/m/udfp2zcy - return 2 / (1 + np.exp(a*x)) - 1 diff --git a/src/rlutilities/__init__.py b/src/rlutilities/__init__.py new file mode 100644 index 0000000..0ed8833 --- /dev/null +++ b/src/rlutilities/__init__.py @@ -0,0 +1,6 @@ +import sys +from .rlutilities import mechanics, simulation, linear_algebra + +sys.modules["rlutilities.mechanics"] = mechanics +sys.modules["rlutilities.simulation"] = simulation +sys.modules["rlutilities.linear_algebra"] = linear_algebra diff --git a/src/rlutilities/__init__.pyi b/src/rlutilities/__init__.pyi new file mode 100644 index 0000000..288e09e --- /dev/null +++ b/src/rlutilities/__init__.pyi @@ -0,0 +1,10 @@ +from typing import * +from typing import Iterable as iterable +from typing import Iterator as iterator +from numpy import float64 +_Shape = Tuple[int, ...] +__all__ = [ +"linear_algebra", +"mechanics", +"simulation" +] \ No newline at end of file diff --git a/src/rlutilities/linear_algebra.pyi b/src/rlutilities/linear_algebra.pyi new file mode 100644 index 0000000..ec58005 --- /dev/null +++ b/src/rlutilities/linear_algebra.pyi @@ -0,0 +1,198 @@ +from typing import * +from typing import Iterable as iterable +from typing import Iterator as iterator +from numpy import float64 +_Shape = Tuple[int, ...] +__all__ = [ +"mat2", +"mat3", +"vec2", +"vec3", +"vec4", +"angle_between", +"axis_to_rotation", +"clip", +"cross", +"dot", +"euler_to_rotation", +"inv", +"look_at", +"norm", +"normalize", +"rotation", +"rotation_to_axis", +"rotation_to_euler", +"sgn", +"transpose", +"xy" +] +class mat2(): + + def __getitem__(self, arg0: Tuple[int, int]) -> float: ... + def __init__(self, arg0: float, arg1: float, arg2: float, arg3: float) -> None: ... + def __setitem__(self, arg0: Tuple[int, int], arg1: float) -> None: ... + def __str__(self) -> str: ... + + pass +class mat3(): + + def __getitem__(self, arg0: Tuple[int, int]) -> float: ... + def __init__(self, arg0: float, arg1: float, arg2: float, arg3: float, arg4: float, arg5: float, arg6: float, arg7: float, arg8: float) -> None: ... + def __setitem__(self, arg0: Tuple[int, int], arg1: float) -> None: ... + def __str__(self) -> str: ... + + pass +class vec2(): + + def __add__(self, arg0: vec2) -> vec2: ... + def __getitem__(self, arg0: int) -> float: ... + def __iadd__(self, arg0: vec2) -> vec2: ... + def __imul__(self, arg0: float) -> vec2: ... + @overload + def __init__(self, arg0: vec2) -> None: + pass + @overload + def __init__(self, arg0: vec3) -> None: ... + @overload + def __init__(self, arg0: float, arg1: float) -> None: ... + def __isub__(self, arg0: vec2) -> vec2: ... + def __itruediv__(self, arg0: float) -> vec2: ... + def __mul__(self, arg0: float) -> vec2: ... + def __rmul__(self, arg0: float) -> vec2: ... + def __setitem__(self, arg0: int, arg1: float) -> None: ... + def __str__(self) -> str: ... + def __sub__(self, arg0: vec2) -> vec2: ... + def __truediv__(self, arg0: float) -> vec2: ... + + pass +class vec3(): + + def __add__(self, arg0: vec3) -> vec3: ... + def __getitem__(self, arg0: int) -> float: ... + def __iadd__(self, arg0: vec3) -> vec3: ... + def __imul__(self, arg0: float) -> vec3: ... + @overload + def __init__(self, arg0: vec3) -> None: + pass + @overload + def __init__(self, arg0: float, arg1: float, arg2: float) -> None: ... + @overload + def __init__(self, arg0: vec2) -> None: ... + def __isub__(self, arg0: vec3) -> vec3: ... + def __itruediv__(self, arg0: float) -> vec3: ... + def __mul__(self, arg0: float) -> vec3: ... + def __rmul__(self, arg0: float) -> vec3: ... + def __setitem__(self, arg0: int, arg1: float) -> None: ... + def __str__(self) -> str: ... + def __sub__(self, arg0: vec3) -> vec3: ... + def __truediv__(self, arg0: float) -> vec3: ... + + pass +class vec4(): + + def __add__(self, arg0: vec4) -> vec4: ... + def __getitem__(self, arg0: int) -> float: ... + def __iadd__(self, arg0: vec4) -> vec4: ... + def __imul__(self, arg0: float) -> vec4: ... + def __init__(self, arg0: float, arg1: float, arg2: float, arg3: float) -> None: ... + def __isub__(self, arg0: vec4) -> vec4: ... + def __itruediv__(self, arg0: float) -> vec4: ... + def __mul__(self, arg0: float) -> vec4: ... + def __rmul__(self, arg0: float) -> vec4: ... + def __setitem__(self, arg0: int, arg1: float) -> None: ... + def __str__(self) -> str: ... + def __sub__(self, arg0: vec4) -> vec4: ... + def __truediv__(self, arg0: float) -> vec4: ... + + pass +@overload +def angle_between(arg0: mat3, arg1: mat3) -> float: + pass +@overload +def angle_between(arg0: vec3, arg1: vec3) -> float: + pass +@overload +def angle_between(arg0: vec2, arg1: vec2) -> float: + pass +def axis_to_rotation(arg0: vec3) -> mat3: + pass +@overload +def clip(arg0: int, arg1: int, arg2: int) -> int: + pass +@overload +def clip(arg0: float, arg1: float, arg2: float) -> float: + pass +@overload +def cross(arg0: vec3, arg1: vec3) -> vec3: + pass +@overload +def cross(arg0: vec3) -> vec3: + pass +@overload +def cross(arg0: vec2) -> vec2: + pass +@overload +def dot(arg0: vec2, arg1: mat2) -> vec2: + pass +@overload +def dot(arg0: vec4, arg1: vec4) -> float: + pass +@overload +def dot(arg0: vec2, arg1: vec2) -> float: + pass +@overload +def dot(arg0: vec3, arg1: mat3) -> vec3: + pass +@overload +def dot(arg0: mat3, arg1: mat3) -> mat3: + pass +@overload +def dot(arg0: vec3, arg1: vec3) -> float: + pass +@overload +def dot(arg0: mat2, arg1: mat2) -> mat2: + pass +@overload +def dot(arg0: mat2, arg1: vec2) -> vec2: + pass +@overload +def dot(arg0: mat3, arg1: vec3) -> vec3: + pass +def euler_to_rotation(arg0: vec3) -> mat3: + pass +@overload +def inv(arg0: mat3) -> mat3: + pass +@overload +def inv(arg0: mat2) -> mat2: + pass +def look_at(arg0: vec3, arg1: vec3) -> mat3: + pass +@overload +def norm(arg0: vec2) -> float: + pass +@overload +def norm(arg0: vec3) -> float: + pass +@overload +def normalize(arg0: vec3) -> vec3: + pass +@overload +def normalize(arg0: vec2) -> vec2: + pass +def rotation(arg0: float) -> mat2: + pass +def rotation_to_axis(arg0: mat3) -> vec3: + pass +def rotation_to_euler(arg0: mat3) -> vec3: + pass +def sgn(arg0: float) -> float: + pass +@overload +def transpose(arg0: mat2) -> mat2: + pass +@overload +def transpose(arg0: mat3) -> mat3: + pass +def xy(arg0: vec3) -> vec3: + pass \ No newline at end of file diff --git a/src/rlutilities/mechanics.pyi b/src/rlutilities/mechanics.pyi new file mode 100644 index 0000000..98be138 --- /dev/null +++ b/src/rlutilities/mechanics.pyi @@ -0,0 +1,129 @@ +from typing import * +from typing import Iterable as iterable +from typing import Iterator as iterator +from numpy import float64 +_Shape = Tuple[int, ...] +import rlutilities.simulation +__all__ = [ +"Aerial", +"AerialTurn", +"Boostdash", +"Dodge", +"Drive", +"Jump", +"Wavedash" +] +class Aerial(): + boost_accel = 1060.0 + boost_per_second = 30.0 + max_speed = 2300.0 + throttle_accel = 66.66667175292969 + + def __init__(self, arg0: rlutilities.simulation.Car) -> None: ... + def is_viable(self) -> bool: ... + def simulate(self) -> rlutilities.simulation.Car: ... + def step(self, arg0: float) -> None: ... + + angle_threshold: float + arrival_time: float + boost_estimate: float + controls: rlutilities.simulation.Input + finished: bool + reorient_distance: float + single_jump: bool + target: vec3 + target_orientation: Optional[mat3] + throttle_distance: float + up: vec3 + velocity_estimate: vec3 + pass +class AerialTurn(): + + def __init__(self, arg0: rlutilities.simulation.Car) -> None: ... + def simulate(self) -> rlutilities.simulation.Car: ... + def step(self, arg0: float) -> None: ... + + alpha: vec3 + controls: rlutilities.simulation.Input + eps_omega: float + eps_phi: float + finished: bool + horizon_time: float + target: mat3 + pass +class Boostdash(): + + def __init__(self, arg0: rlutilities.simulation.Car) -> None: ... + def step(self, arg0: float) -> None: ... + + controls: rlutilities.simulation.Input + finished: bool + pass +class Dodge(): + forward_torque = 224.0 + input_threshold = 0.5 + side_torque = 260.0 + timeout = 1.5 + torque_time = 0.6499999761581421 + z_damping = 0.3499999940395355 + z_damping_end = 0.20999999344348907 + z_damping_start = 0.15000000596046448 + + def __init__(self, arg0: rlutilities.simulation.Car) -> None: ... + def simulate(self) -> rlutilities.simulation.Car: ... + def step(self, arg0: float) -> None: ... + + controls: rlutilities.simulation.Input + delay: Optional[float] + direction: Optional[vec2] + duration: Optional[float] + finished: bool + preorientation: Optional[mat3] + target: Optional[vec3] + timer: float + pass +class Drive(): + boost_accel = 991.6669921875 + brake_accel = 3500.0 + coasting_accel = 525.0 + max_speed = 2300.0 + max_throttle_speed = 1410.0 + + def __init__(self, arg0: rlutilities.simulation.Car) -> None: ... + @staticmethod + def max_turning_curvature(arg0: float) -> float: ... + @staticmethod + def max_turning_speed(arg0: float) -> float: ... + def step(self, arg0: float) -> None: ... + @staticmethod + def throttle_accel(arg0: float) -> float: ... + + controls: rlutilities.simulation.Input + finished: bool + reaction_time: float + speed: float + target: vec3 + pass +class Jump(): + acceleration = 1458.333251953125 + max_duration = 0.20000000298023224 + min_duration = 0.02500000037252903 + speed = 291.6669921875 + + def __init__(self, arg0: rlutilities.simulation.Car) -> None: ... + def simulate(self) -> rlutilities.simulation.Car: ... + def step(self, arg0: float) -> None: ... + + controls: rlutilities.simulation.Input + duration: float + finished: bool + pass +class Wavedash(): + + def __init__(self, arg0: rlutilities.simulation.Car) -> None: ... + def step(self, arg0: float) -> None: ... + + controls: rlutilities.simulation.Input + direction: Optional[vec2] + finished: bool + pass \ No newline at end of file diff --git a/src/rlutilities/rlutilities.cp37-win_amd64.pyd b/src/rlutilities/rlutilities.cp37-win_amd64.pyd new file mode 100644 index 0000000..62f0818 Binary files /dev/null and b/src/rlutilities/rlutilities.cp37-win_amd64.pyd differ diff --git a/src/rlutilities/simulation.pyi b/src/rlutilities/simulation.pyi new file mode 100644 index 0000000..aab6b1c --- /dev/null +++ b/src/rlutilities/simulation.pyi @@ -0,0 +1,232 @@ +from typing import * +from typing import Iterable as iterable +from typing import Iterator as iterator +from numpy import float64 +_Shape = Tuple[int, ...] +__all__ = [ +"Ball", +"Car", +"ControlPoint", +"Curve", +"Field", +"Game", +"Goal", +"Input", +"Pad", +"obb", +"ray", +"sphere", +"tri", +"intersect" +] +class Ball(): + collision_radius = 93.1500015258789 + drag = -0.030500000342726707 + friction = 2.0 + mass = 30.0 + max_omega = 6.0 + max_speed = 4000.0 + moment_of_inertia = 99918.75 + radius = 91.25 + restitution = 0.6000000238418579 + + @overload + def __init__(self) -> None: + pass + @overload + def __init__(self, arg0: Ball) -> None: ... + def hitbox(self) -> sphere: ... + @overload + def step(self, arg0: float) -> None: + pass + @overload + def step(self, arg0: float, arg1: Car) -> None: ... + + angular_velocity: vec3 + position: vec3 + time: float + velocity: vec3 + pass +class Car(): + + @overload + def __init__(self) -> None: + pass + @overload + def __init__(self, arg0: Car) -> None: ... + def extrapolate(self, arg0: float) -> None: ... + def forward(self) -> vec3: ... + def hitbox(self) -> obb: ... + def left(self) -> vec3: ... + def step(self, arg0: Input, arg1: float) -> None: ... + def up(self) -> vec3: ... + + angular_velocity: vec3 + boost: int + controls: Input + demolished: bool + dodge_rotation: mat2 + dodge_timer: float + double_jumped: bool + id: int + jump_timer: float + jumped: bool + on_ground: bool + orientation: mat3 + position: vec3 + quaternion: vec4 + rotator: vec3 + supersonic: bool + team: int + time: float + velocity: vec3 + pass +class ControlPoint(): + + @overload + def __init__(self, arg0: vec3, arg1: vec3, arg2: vec3) -> None: + pass + @overload + def __init__(self) -> None: ... + + n: vec3 + p: vec3 + t: vec3 + pass +class Curve(): + + @overload + def __init__(self, arg0: List[ControlPoint]) -> None: + pass + @overload + def __init__(self, arg0: List[vec3]) -> None: ... + def calculate_distances(self) -> None: ... + def calculate_max_speeds(self, arg0: float, arg1: float) -> float: ... + def calculate_tangents(self) -> None: ... + def curvature_at(self, arg0: float) -> float: ... + def find_nearest(self, arg0: vec3) -> float: ... + def max_speed_at(self, arg0: float) -> float: ... + def point_at(self, arg0: float) -> vec3: ... + def pop_front(self) -> None: ... + def tangent_at(self, arg0: float) -> vec3: ... + def write_to_file(self, arg0: str) -> None: ... + + length: float + points: List[vec3] + pass +class Field(): + mode = 'Uninitialized' + triangles = [] + walls = [] + + @staticmethod + @overload + def collide(arg0: obb) -> ray: + pass + @staticmethod + @overload + def collide(arg0: sphere) -> ray: ... + @staticmethod + def raycast_any(arg0: ray) -> ray: ... + @staticmethod + def snap(arg0: vec3) -> ray: ... + + pass +class Game(): + frametime = 0.008333333767950535 + gravity = -650.0 + map = 'map_not_set' + + def __init__(self, arg0: int) -> None: ... + def read_game_information(self, arg0: object, arg1: object) -> None: ... + @staticmethod + def set_mode(arg0: str) -> None: ... + + ball: Ball + cars: List[Car[8]] + frame: int + frame_delta: int + kickoff_pause: bool + match_ended: bool + num_cars: int + overtime: bool + pads: List[Pad] + round_active: bool + team: int + time: float + time_delta: float + time_remaining: float + pass +class Goal(): + + def __init__(self) -> None: ... + + direction: vec3 + location: vec3 + team: int + pass +class Input(): + + def __init__(self) -> None: ... + + boost: bool + handbrake: bool + jump: bool + pitch: float + roll: float + steer: float + throttle: float + yaw: float + pass +class Pad(): + + def __init__(self) -> None: ... + + is_active: bool + is_full_boost: bool + position: vec3 + timer: float + pass +class obb(): + + def __init__(self) -> None: ... + + center: vec3 + half_width: vec3 + orientation: mat3 + pass +class ray(): + + @overload + def __init__(self) -> None: + pass + @overload + def __init__(self, arg0: vec3, arg1: vec3) -> None: ... + + direction: vec3 + start: vec3 + pass +class sphere(): + + @overload + def __init__(self, arg0: vec3, arg1: float) -> None: + pass + @overload + def __init__(self) -> None: ... + + center: vec3 + radius: float + pass +class tri(): + + def __getitem__(self, arg0: int) -> vec3: ... + def __init__(self) -> None: ... + def __setitem__(self, arg0: int, arg1: vec3) -> None: ... + + pass +@overload +def intersect(arg0: sphere, arg1: obb) -> bool: + pass +@overload +def intersect(arg0: obb, arg1: sphere) -> bool: + pass \ No newline at end of file