-
Notifications
You must be signed in to change notification settings - Fork 18
Simulation
samuelpmish edited this page Jul 10, 2019
·
1 revision
Car simulation when on the ground is limited. 1D simulation of a car driving along a path is partially supported, but predicting the car's future locations from an initial state and a sequence of controls is not possible, at present.
However, simulation of jumping, dodging (including canceled dodges in the near future), and aerials are all supported.
Theory reference for:
TODO
Regular ball simulation follows the theory presented here.
Car-ball interactions are also modeled according to the collision mechanics outlined here.
basic ball prediction in Python:
from rlutilities.linear_algebra import vec3
from rlutilities.simulation import Game, Ball
# configure the Game to use the soccar collision geometry
Game.set_mode("soccar");
# make an instance of a Ball object
b = Ball()
# initialize it to a position in the middle of the field, some distance above the ground
b.position = vec3(0, 0, 1500)
b.velocity = vec3(0, 0, 0)
b.angular_velocity = vec3(0, 0, 0)
for i in range(120):
# calling step() advances the Ball forward in time
b.step(1.0 / 120.0)
# and we can see where it goes
print(b.position)