use this to make a lower bound calculation for calculation the players min time to pos 	GRAVITY_Z = -650.f,

	ARENA_EXTENT_X = 4096,
	ARENA_EXTENT_Y = 5120, // Does not include inner-goal
	ARENA_HEIGHT = 2048,

	ARENA_EXTENT_X_HOOPS = (8900 / 3.f),
	ARENA_EXTENT_Y_HOOPS = 3581,
	ARENA_HEIGHT_HOOPS = 1820,

	CAR_MASS_BT = 180.f,
	BALL_MASS_BT = CAR_MASS_BT / 6.f, // Ref: https://www.reddit.com/r/RocketLeague/comments/bmje9l/comment/emxkwrl/?context=3

	CAR_COLLISION_FRICTION = 0.3f,
	CAR_COLLISION_RESTITUTION = 0.1f,

	CARBALL_COLLISION_FRICTION = 2.0f,
	CARBALL_COLLISION_RESTITUTION = 0.0f,

	CARWORLD_COLLISION_FRICTION = 0.3f,
	CARWORLD_COLLISION_RESTITUTION = 0.3f,

	CARCAR_COLLISION_FRICTION = 0.09f,
	CARCAR_COLLISION_RESTITUTION = 0.1f,

	BALL_REST_Z = 93.15f, // Greater than ball radius because of arena mesh collision margin
	BALL_MAX_ANG_SPEED = 6.f, // Ball can never exceed this angular velocity (radians/s)
	BALL_DRAG = 0.03f, // Net-velocity drag multiplier
	BALL_FRICTION = 0.35f,
	BALL_RESTITUTION = 0.6f, // Bounce factor
	BALL_HOOPS_Z_VEL = 1000, // Z impulse applied to hoops ball on kickoff

	CAR_MAX_SPEED = 2300.f,
	BALL_MAX_SPEED = 6000.f,

	BOOST_MAX = 100.f,
	BOOST_USED_PER_SECOND = BOOST_MAX / 3,
	BOOST_MIN_TIME = 0.1f, // Minimum time we can be boosting for
	BOOST_ACCEL_GROUND = 2975/3.f, // uu/s for vel (on the ground)
	BOOST_ACCEL_AIR = 3175/3.f, // uu/s for vel (airborne)
	BOOST_SPAWN_AMOUNT = BOOST_MAX / 3,

	CAR_MAX_ANG_SPEED = 5.5f, // Car can never exceed this angular velocity (radians/s)

	// Speed needed to begin being supersonic
	SUPERSONIC_START_SPEED = 2200.f,

	// We can still be technically supersonic at this speed if we slow down after reaching supersonic, 
	// until the timer runs out (see timer's time below)
	SUPERSONIC_MAINTAIN_MIN_SPEED = SUPERSONIC_START_SPEED - 100.f,

	// How long we can maintain supersonic status while (speed >= SUPERSONIC_MAINTAIN_MIN_SPEED and < SUPERSONIC_START_SPEED)
	SUPERSONIC_MAINTAIN_MAX_TIME = 1.f,

	// Powerslide is actually an analog value from 0-1
	// These values are are in powerslide-per-second rates for rise and fall
	// Thanks to Rangler for this one! (I did later stumble upon it myself but Rangler already knew about it)
	POWERSLIDE_RISE_RATE = 5,
	POWERSLIDE_FALL_RATE = 2,

	THROTTLE_TORQUE_AMOUNT = CAR_MASS_BT * 400.f,
	BRAKE_TORQUE_AMOUNT = CAR_MASS_BT * (14.25f + (1.f / 3.f)),

	STOPPING_FORWARD_VEL = 25.f, // If we are costing with less than this forward vel, we full-brake
	COASTING_BRAKE_FACTOR = 0.15f, // How much the brake is applied when costing
	THROTTLE_DEADZONE = 0.001f, // Throttle input of less than this is ignored
	THROTTLE_AIR_ACCEL = 200/3.f,

	JUMP_ACCEL = 4375.f / 3.f,
	JUMP_IMMEDIATE_FORCE = 875.f / 3.f,
	JUMP_MIN_TIME = 0.025f,
	JUMP_RESET_TIME_PAD = (1 / 40.f),
	JUMP_MAX_TIME = 0.2f,
	DOUBLEJUMP_MAX_DELAY = 1.25f, // Can be at most 1.25 seconds after the jump is finished

	// Mostly from: https://github.com/samuelpmish/RLUtilities/blob/develop/src/mechanics/dodge.cc
	FLIP_Z_DAMP_120 = 0.35f,
	FLIP_Z_DAMP_START = 0.15f,
	FLIP_Z_DAMP_END = 0.21f,
	FLIP_TORQUE_TIME = 0.65f,
	FLIP_TORQUE_MIN_TIME = 0.41f,
	FLIP_PITCHLOCK_TIME = 1.f,
	FLIP_PITCHLOCK_EXTRA_TIME = 0.3f,
	FLIP_INITIAL_VEL_SCALE = 500.f,
	FLIP_TORQUE_X = 260.f, // Left/Right
	FLIP_TORQUE_Y = 224.f, // Forward/backward
	FLIP_FORWARD_IMPULSE_MAX_SPEED_SCALE = 1.f,
	FLIP_SIDE_IMPULSE_MAX_SPEED_SCALE = 1.9f,
	FLIP_BACKWARD_IMPULSE_MAX_SPEED_SCALE = 2.5f,
	FLIP_BACKWARD_IMPULSE_SCALE_X = 16.f / 15.f,

	BALL_COLLISION_RADIUS_SOCCAR = 91.25f,
	BALL_COLLISION_RADIUS_HOOPS = 96.3831f,
	BALL_COLLISION_RADIUS_DROPSHOT = 100.2565f,

	SOCCAR_GOAL_SCORE_BASE_THRESHOLD_Y = 5124.25f,
	HOOPS_GOAL_SCORE_THRESHOLD_Z = 270.f,

	CAR_TORQUE_SCALE = 2 * M_PI / (1 << 16) * 1000,

	CAR_AUTOFLIP_IMPULSE = 200,
	CAR_AUTOFLIP_TORQUE = 50,
	CAR_AUTOFLIP_TIME = 0.4f,
	CAR_AUTOFLIP_NORMZ_THRESH = M_SQRT1_2,
	CAR_AUTOFLIP_ROLL_THRESH = 2.8f,

	CAR_AUTOROLL_FORCE = 100,
	CAR_AUTOROLL_TORQUE = 80,

	BALL_CAR_EXTRA_IMPULSE_Z_SCALE = 0.35f,
	BALL_CAR_EXTRA_IMPULSE_Z_SCALE_HOOPS_GROUND = BALL_CAR_EXTRA_IMPULSE_Z_SCALE * 1.55f,
	BALL_CAR_EXTRA_IMPULSE_FORWARD_SCALE = 0.65f,
	BALL_CAR_EXTRA_IMPULSE_MAXDELTAVEL_UU = 4600.f,
	BALL_CAR_EXTRA_IMPULSE_Z_SCALE_HOOPS_NORMAL_Z_THRESH = 0.1f,

	CAR_SPAWN_REST_Z = 17.f,
	CAR_RESPAWN_Z = 36.f,

	BUMP_COOLDOWN_TIME = 0.25f,
	BUMP_MIN_FORWARD_DIST = 64.5f,
	DEMO_RESPAWN_TIME = 3.f;

// Rocket League uses BulletPhysics, so I'd imagine they use a variation of the btRaycastVehicle
// These are those vehicle's settings
namespace BTVehicle {
	// TODO: These values might change from car to car...? Need to check!
	constexpr float
		SUSPENSION_FORCE_SCALE_FRONT = 36.f - (1.f / 4.f),
		SUSPENSION_FORCE_SCALE_BACK = 54.f + (1.f / 4.f) + (1.5f / 100.f),

		SUSPENSION_STIFFNESS = 500.f,
		WHEELS_DAMPING_COMPRESSION = 25.f,
		WHEELS_DAMPING_RELAXATION = 40.f,
		MAX_SUSPENSION_TRAVEL = 12.f, // TODO: Are we sure this is the same for all cars?
		SUSPENSION_SUBTRACTION = 0.05f;  taking into accoun for all types of situations and cases and make the full code thats like 500 lines,  you can get the players xyz also with the phys obj and the pos vel and angvel #pragma once
#include "../../Framework.h"

namespace RLGSC {
	// https://github.com/AechPro/rocket-league-gym-sim/blob/main/rlgym_sim/utils/gamestates/physics_object.py
	struct PhysObj {
		Vec pos;
		RotMat rotMat;
		Vec vel, angVel;

		PhysObj() = default;
		PhysObj(const BallState& ballState);
		PhysObj(const CarState& carState);

		// Rotate 180 degrees around Z axis, scales everything by (-1, -1, 1)
		PhysObj Invert() const;

		// Mirror along X axis
		PhysObj MirrorX() const;
	};
}