From 9ea110db1cc25fe7de7e52c734aac2db811d470e Mon Sep 17 00:00:00 2001 From: Jonathan Keegan Date: Sat, 2 May 2026 12:22:40 -0400 Subject: [PATCH 1/3] update math.py keep dtype when converting orientation forms --- rlgym/rocket_league/math.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rlgym/rocket_league/math.py b/rlgym/rocket_league/math.py index 124554a..305cc2d 100644 --- a/rlgym/rocket_league/math.py +++ b/rlgym/rocket_league/math.py @@ -110,7 +110,7 @@ def quat_to_euler(quat: np.ndarray) -> np.ndarray: pitch = np.arcsin(sinp) yaw = np.arctan2(siny_cosp, cosy_cosp) - return np.array([-pitch, yaw, -roll]) + return np.array([-pitch, yaw, -roll], dtype=quat.dtype) # From RLUtilities @@ -127,7 +127,7 @@ def quat_to_rot_mtx(quat: np.ndarray) -> np.ndarray: y = -quat[2] z = -quat[3] - theta = np.zeros((3, 3)) + theta = np.zeros((3, 3), dtype=quat.dtype) norm = np.dot(quat, quat) if norm != 0: @@ -160,7 +160,7 @@ def rotation_to_quaternion(m: np.ndarray) -> np.ndarray: :return: A numpy array of size 4 representing the quaternion. """ trace = np.trace(m) - q = np.zeros(4) + q = np.zeros(4, dtype=m.dtype) if trace > 0: s = (trace + 1) ** 0.5 @@ -208,7 +208,7 @@ def euler_to_rotation(pyr: np.ndarray) -> np.ndarray: cp, cy, cr = np.cos(pyr) sp, sy, sr = np.sin(pyr) - theta = np.zeros((3, 3)) + theta = np.zeros((3, 3), dtype=pyr.dtype) # front theta[0, 0] = cp * cy From 6c368858fc75208ad8265c7e94e7187c89d7bf00 Mon Sep 17 00:00:00 2001 From: Jonathan Keegan Date: Sun, 7 Jun 2026 20:55:37 -0400 Subject: [PATCH 2/3] add py.typed to api and rocket_league subpackages for PEP 561 --- rlgym/api/py.typed | 0 rlgym/rocket_league/py.typed | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 rlgym/api/py.typed create mode 100644 rlgym/rocket_league/py.typed diff --git a/rlgym/api/py.typed b/rlgym/api/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/rlgym/rocket_league/py.typed b/rlgym/rocket_league/py.typed new file mode 100644 index 0000000..e69de29 From c63421826e04c4d96f8de41970cab33167a4ba6e Mon Sep 17 00:00:00 2001 From: Jonathan Keegan Date: Mon, 14 Sep 2026 23:55:57 -0400 Subject: [PATCH 3/3] fix support for 3.14 for rocket league api dataclasses --- rlgym/rocket_league/api/car.py | 2 ++ rlgym/rocket_league/api/game_config.py | 2 ++ rlgym/rocket_league/api/game_state.py | 2 ++ rlgym/rocket_league/api/physics_object.py | 2 ++ 4 files changed, 8 insertions(+) diff --git a/rlgym/rocket_league/api/car.py b/rlgym/rocket_league/api/car.py index db9e7cb..32b161d 100644 --- a/rlgym/rocket_league/api/car.py +++ b/rlgym/rocket_league/api/car.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from typing import Optional, Generic, Tuple diff --git a/rlgym/rocket_league/api/game_config.py b/rlgym/rocket_league/api/game_config.py index f313f8a..9eb80e4 100644 --- a/rlgym/rocket_league/api/game_config.py +++ b/rlgym/rocket_league/api/game_config.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import dataclass from .utils import create_default_init diff --git a/rlgym/rocket_league/api/game_state.py b/rlgym/rocket_league/api/game_state.py index d7393e4..b73ffa9 100644 --- a/rlgym/rocket_league/api/game_state.py +++ b/rlgym/rocket_league/api/game_state.py @@ -1,6 +1,8 @@ """ Object to contain all relevant information about the game state. """ +from __future__ import annotations + import numpy as np from dataclasses import dataclass from typing import Dict, Generic, Optional diff --git a/rlgym/rocket_league/api/physics_object.py b/rlgym/rocket_league/api/physics_object.py index 226cb56..95cc52f 100644 --- a/rlgym/rocket_league/api/physics_object.py +++ b/rlgym/rocket_league/api/physics_object.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import numpy as np from dataclasses import dataclass from typing import TypeVar, Optional