Car and CarState¶
The Car class is fairly intuitive, and contains both the physics data and CarState of a given Car.
-
class Car¶
-
struct CarState¶
-
Public Members
-
Vec pos = {0, 0, 17}¶
Position in world space (UU)
-
RotMat rotMat = RotMat::GetIdentity()¶
-
Vec vel = {0, 0, 0}¶
Linear velocity.
-
Vec angVel = {0, 0, 0}¶
Angular velocity (rad/s)
-
bool isOnGround = true¶
-
bool hasJumped = false¶
-
bool hasDoubleJumped = false¶
-
bool hasFlipped = false¶
-
Vec lastRelDodgeTorque = {0, 0, 0}¶
-
float jumpTime = 0¶
Active during the duration of a jump or flip.
-
float flipTime = 0¶
-
bool isJumping = false¶
True during a jump (not double jumps or a flip)
-
float airTimeSinceJump = 0¶
Time spent in the air once !isJumping.
-
float boost = RLConst::BOOST_SPAWN_AMOUNT¶
Goes from 0 to 100.
-
float timeSpentBoosting = 0¶
Added to replicate minimum boosting time NOTE: Will be used even when we have no boost.
-
bool isSupersonic = false¶
-
float supersonicTime = 0¶
Time spent supersonic, for checking with the supersonic maintain time (see RLConst.h)
-
float handbrakeVal = 0¶
This is a state variable due to the rise/fall rate of handbrake inputs (see RLConst.h)
-
bool isAutoFlipping = false¶
-
float autoFlipTimer = 0¶
-
float autoFlipTorqueScale = 0¶
Counts down when auto-flipping.
-
bool hasContact = false¶
-
Vec contactNormal¶
-
uint32_t otherCarID = 0¶
-
float cooldownTimer = 0¶
-
bool isDemoed = false¶
-
float demoRespawnTimer = 0¶
-
uint64_t lastHitBallTick = ~0ULL¶
Set to arena->tickCount when ball is hit Don’t change this unless you know what you’re doing.
-
CarControls lastControls = CarControls()¶
Controls from last tick, set to this->controls after simulation.
-
Vec pos = {0, 0, 17}¶