Skip to content

Commit

Permalink
Merge upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
mtheall committed May 16, 2024
1 parent 6f09d44 commit be94829
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Build extension for ${{ matrix.os }}
if: matrix.os != 'ubuntu-20.04'
run: |
python3 setup.py build
python3 setup.py build -j 4
python3 setup.py bdist_wheel --py-limited-api=cp34
- name: Build extension for ${{ matrix.os }}
Expand Down
4 changes: 2 additions & 2 deletions python-mtheall/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ PYTHON ?= python3
all: build

build:
$(PYTHON) ../setup.py build --debug -j$(shell nproc)
$(PYTHON) ../setup.py build --debug -j 4

wheel: build
$(PYTHON) ../setup.py bdist_wheel --py-limited-api=cp34

install: wheel
$(PYTHON) -m pip install --force-reinstall --user ./dist/RocketSim-2.1.0.post2-cp34-abi3-linux_x86_64.whl
$(PYTHON) -m pip install --force-reinstall --user ./dist/RocketSim-2.1.0.post3-cp34-abi3-linux_x86_64.whl

clean:
$(RM) -r build/ dist/ RocketSim.egg-info/
13 changes: 13 additions & 0 deletions python-mtheall/regression_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,5 +267,18 @@ def test_arena_ball_prediction(self):
arena = rs.Arena()
arena.get_ball_prediction(4, 2)

def test_soccar_wall(self):
arena = rs.Arena()
ball_state = arena.ball.get_state()
ball_state.vel = rs.Vec(2000.0, 0.0, 0.0)
arena.ball.set_state(ball_state)

radius = arena.ball.get_radius()

for i in range(1000):
arena.step()
x = arena.ball.get_state().pos.x
self.assertLess(x + radius, 4096)

if __name__ == "__main__":
unittest.main()
2 changes: 2 additions & 0 deletions python-mtheall/unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1460,9 +1460,11 @@ def test_ball_prediction(self):

pred = arena.get_ball_prediction()
self.assertEqual(len(pred), 120)
TestBallState.compare(self, pred[0], arena.ball.get_state())

pred = arena.get_ball_prediction(num_states=50, tick_interval=3)
self.assertEqual(len(pred), 50)
TestBallState.compare(self, pred[0], arena.ball.get_state())

def test_clone(self):
for mode in (rs.GameMode.SOCCAR, rs.GameMode.HOOPS, rs.GameMode.HEATSEEKER, rs.GameMode.SNOWDAY, rs.GameMode.THE_VOID):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def build_extension(self, ext):

setup(
name = "RocketSim",
version = "2.1.0.post2",
version = "2.1.0.post3",
description = "This is Rocket League!",
cmdclass = {"build_ext": build_ext_ex},
ext_modules = [RocketSim],
Expand Down

0 comments on commit be94829

Please sign in to comment.