Class b2RevoluteJointDef
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
Reference: Box2D/Dynamics/Joints/b2RevoluteJoint.h.
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
bodyAb2BodyBody A.
bodyBb2BodyBody B.
localAnchorAb2Vec2?The anchor relative to body A's origin (origin when null).
localAnchorBb2Vec2?The anchor relative to body B's origin (origin when null).
referenceAngledouble?The reference angle, or null to take it from the bodies.
enableLimitboolWhether the angle limit is enforced.
lowerAngledoubleThe lower angle limit.
upperAngledoubleThe upper angle limit.
enableMotorboolWhether the motor is enabled.
motorSpeeddoubleThe motor's target speed.
maxMotorTorquedoubleThe motor's maximum torque.
collideConnectedboolWhether the bodies may collide.
anchorb2Vec2?A world anchor point; sets both local anchors from the bodies' current frames (pybox2d's
anchor).
Exceptions
- ValueError
Thrown when
anchoris 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
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
EnableMotor
Whether the motor is enabled.
public bool EnableMotor { get; set; }
Property Value
LocalAnchorA
The anchor relative to body A's origin.
public b2Vec2 LocalAnchorA { get; set; }
Property Value
LocalAnchorB
The anchor relative to body B's origin.
public b2Vec2 LocalAnchorB { get; set; }
Property Value
LowerAngle
The lower angle limit (stored as float32).
public double LowerAngle { get; set; }
Property Value
MaxMotorTorque
The motor's maximum torque (stored as float32).
public double MaxMotorTorque { get; set; }
Property Value
MotorSpeed
The motor's target speed (stored as float32).
public double MotorSpeed { get; set; }
Property Value
ReferenceAngle
The reference angle (stored as float32).
public double ReferenceAngle { get; set; }
Property Value
UpperAngle
The upper angle limit (stored as float32).
public double UpperAngle { get; set; }