Arena¶
The Arena class is the highest level class, which contains all Car instances, the Ball, and the arena collision geometry.
-
class Arena¶
The container for all game simulation Stores cars, the ball, all arena collisions, and manages the overall game state.
Public Functions
-
inline float GetTickRate()¶
Time in seconds each tick (1/tickrate)
-
inline const vector<BoostPad*> &GetBoostPads()¶
-
bool RemoveCar(Car *car)¶
Returns false if the car was not found in the cars list NOTE: If the car was removed, the car will be freed and the pointer will be made invalid.
-
void SetGoalScoreCallback(GoalScoreEventFn callbackFn, void *userInfo = NULL)¶
-
void WriteToFile(std::filesystem::path path)¶
Serialize cars, ball, and boostpads to a file.
-
Arena(const Arena &other) = delete¶
No copy constructor, use Arena::Clone() instead.
-
void Step(int ticksToSimulate = 1)¶
Simulate everything in the arena for a given number of ticks.
-
void ResetToRandomKickoff(int seed = -1)¶
-
~Arena()¶
Free all associated memory.
Public Members
-
GameMode gameMode¶
-
float tickTime¶
-
uint64_t tickCount = 0¶
Total ticks this arena instance has been simulated for, never resets.
-
btCollisionConfiguration *collisionConfig¶
-
btCollisionDispatcher *collisionDispatcher¶
-
btDbvtBroadphase *overlappingPairCache¶
-
btConstraintSolver *constraintSolver¶
-
GoalScoreEventFn func = NULL¶
-
void *userInfo = NULL¶
-
inline float GetTickRate()¶