Table of Contents

Class CarWheel

Namespace
Gym.Environments.Envs.Box2D
Assembly
Gym.Environments.dll

A wheel of Car: its Box2D body with the attributes Gymnasium hangs on it (wheel_rad, gas, brake, steer, phase, omega, the skid state, joint, tiles). The body's user data is this object, as Python's w.userData = w makes the contact listener find the wheel.

public sealed class CarWheel
Inheritance
CarWheel
Inherited Members
Extension Methods

Properties

Body

The wheel's Box2D body.

public b2Body Body { get; }

Property Value

b2Body

Brake

Python's brake: the brake; 0.9 and above locks the wheel.

public double Brake { get; set; }

Property Value

double

Color

Python's color: WheelColor, as fractions of 255 the draw scales (black).

public (double R, double G, double B) Color { get; set; }

Property Value

(double R, double G, double B)

Gas

Python's gas: the throttle, which Gas(double) raises by at most 0.1 per call (rear wheels only).

public double Gas { get; set; }

Property Value

double

Joint

Python's joint: the revolute joint to the hull, whose motor steers the wheel.

public b2RevoluteJoint Joint { get; }

Property Value

b2RevoluteJoint

Omega

Python's omega: the wheel's angular velocity.

public double Omega { get; set; }

Property Value

double

Phase

Python's phase: the wheel's rotation angle, which places its white stripe.

public double Phase { get; set; }

Property Value

double

SkidParticle

Python's skid_particle: the mark this wheel extends, or null.

public Particle? SkidParticle { get; set; }

Property Value

Particle

SkidStarted

Whether a skid has started (Python's skid_start is not None). Python keeps the body's position there, which pybox2d returns as a live view, so the point it later reads is the wheel's position then, not when the skid started; this flag stands for it.

public bool SkidStarted { get; set; }

Property Value

bool

Steer

Python's steer: the steering target the joint's motor turns toward (front wheels only).

public double Steer { get; set; }

Property Value

double

Tiles

Python's tiles: the road tiles the wheel touches, kept by the contact listener.

public HashSet<CarRacingEnv.RoadTile> Tiles { get; }

Property Value

HashSet<CarRacingEnv.RoadTile>

WheelRad

Python's wheel_rad: the radius in metres (0.54).

public double WheelRad { get; }

Property Value

double