Table of Contents

Class b2RevoluteJointDef

Namespace
Gym.Box2D
Assembly
Gym.Environments.dll

A revolute joint definition (pybox2d's revoluteJointDef): two bodies share an anchor point, with an optional angle limit and an optional motor.

public sealed class b2RevoluteJointDef : b2JointDef
Inheritance
b2RevoluteJointDef
Inherited Members
Extension Methods

Remarks

Constructors

b2RevoluteJointDef()

A revolute joint definition with no limit and no motor.

public b2RevoluteJointDef()

b2RevoluteJointDef(b2Body?, b2Body?, b2Vec2?, b2Vec2?, double?, bool, double, double, bool, double, double, bool, b2Vec2?)

A revolute joint definition from pybox2d's keyword arguments (revoluteJointDef(bodyA=..., bodyB=..., ...)): the bodies are set first, then the rest, and when both bodies are given without a reference angle, the reference angle becomes bodyB.angle - bodyA.angle at this moment, as pybox2d computes it (a Python float difference stored as float32). A refused argument raises pybox2d's Failed on kwargs for b2RevoluteJointDef.anchor: … (its keyword named).

public b2RevoluteJointDef(b2Body? bodyA = null, b2Body? bodyB = null, b2Vec2? localAnchorA = null, b2Vec2? localAnchorB = null, double? referenceAngle = null, bool enableLimit = false, double lowerAngle = 0, double upperAngle = 0, bool enableMotor = false, double motorSpeed = 0, double maxMotorTorque = 0, bool collideConnected = false, b2Vec2? anchor = null)

Parameters

bodyA b2Body

Body A.

bodyB b2Body

Body B.

localAnchorA b2Vec2?

The anchor relative to body A's origin (origin when null).

localAnchorB b2Vec2?

The anchor relative to body B's origin (origin when null).

referenceAngle double?

The reference angle, or null to take it from the bodies.

enableLimit bool

Whether the angle limit is enforced.

lowerAngle double

The lower angle limit.

upperAngle double

The upper angle limit.

enableMotor bool

Whether the motor is enabled.

motorSpeed double

The motor's target speed.

maxMotorTorque double

The motor's maximum torque.

collideConnected bool

Whether the bodies may collide.

anchor b2Vec2?

A world anchor point; sets both local anchors from the bodies' current frames (pybox2d's anchor).

Exceptions

ValueError

Thrown when anchor is given without both bodies.

OverflowError

Thrown for a scalar beyond the float32 range.

Properties

Anchor

The world anchor (pybox2d's anchor): reading maps local anchor A (or B) to the world; writing sets both local anchors from the bodies' current frames.

public b2Vec2 Anchor { get; set; }

Property Value

b2Vec2

Exceptions

ValueError

Thrown when the needed bodies are unset, with pybox2d's messages.

EnableLimit

Whether the angle limit is enforced.

public bool EnableLimit { get; set; }

Property Value

bool

EnableMotor

Whether the motor is enabled.

public bool EnableMotor { get; set; }

Property Value

bool

LocalAnchorA

The anchor relative to body A's origin.

public b2Vec2 LocalAnchorA { get; set; }

Property Value

b2Vec2

LocalAnchorB

The anchor relative to body B's origin.

public b2Vec2 LocalAnchorB { get; set; }

Property Value

b2Vec2

LowerAngle

The lower angle limit (stored as float32).

public double LowerAngle { get; set; }

Property Value

double

MaxMotorTorque

The motor's maximum torque (stored as float32).

public double MaxMotorTorque { get; set; }

Property Value

double

MotorSpeed

The motor's target speed (stored as float32).

public double MotorSpeed { get; set; }

Property Value

double

ReferenceAngle

The reference angle (stored as float32).

public double ReferenceAngle { get; set; }

Property Value

double

UpperAngle

The upper angle limit (stored as float32).

public double UpperAngle { get; set; }

Property Value

double