A constraint between two bodies (use a Static body as a fixed world anchor).
Anchors are in each body's local frame. Held in Physics2D.joints.
Constructors
distance(a :
Flock::Entity, b :
Flock::Entity, length :
Number, anchor_a :
Flock::Vec2 =
Flock::Vec2.new, anchor_b :
Flock::Vec2 =
Flock::Vec2.new) :
Joint2D Sourcenew(a :
Flock::Entity, b :
Flock::Entity, type :
Flock::Collision::JointType, anchor_a :
Flock::Vec2 =
Flock::Vec2.new, anchor_b :
Flock::Vec2 =
Flock::Vec2.new, length :
Float32 = 0.0_f32, stiffness :
Float32 = 100.0_f32, damping :
Float32 = 1.0_f32, min_length :
Float32 = 0.0_f32, max_length :
Float32 = 0.0_f32, motor_speed :
Float32 = 0.0_f32, max_motor_torque :
Float32 = 0.0_f32, enable_limit :
Bool = false, lower_angle :
Float32 = 0.0_f32, upper_angle :
Float32 = 0.0_f32, reference_angle :
Float32 = 0.0_f32)
Sourcepin(a : Flock::Entity, b : Flock::Entity, anchor_a : Flock::Vec2 = Flock::Vec2.new, anchor_b : Flock::Vec2 = Flock::Vec2.new) : Joint2D
Sourcerevolute(a :
Flock::Entity, b :
Flock::Entity, anchor_a :
Flock::Vec2 =
Flock::Vec2.new, anchor_b :
Flock::Vec2 =
Flock::Vec2.new, motor_speed :
Number = 0.0, max_motor_torque :
Number = 0.0, enable_limit :
Bool = false, lower_angle :
Number = 0.0, upper_angle :
Number = 0.0, reference_angle :
Number = 0.0) :
Joint2D A revolute joint with an optional angular motor and/or angle limits.
Sourcerope(a :
Flock::Entity, b :
Flock::Entity, max_length :
Number, min_length :
Number = 0.0, anchor_a :
Flock::Vec2 =
Flock::Vec2.new, anchor_b :
Flock::Vec2 =
Flock::Vec2.new) :
Joint2D A rope: the two anchors may come closer than max_length freely but never
exceed it (set min_length for a two-sided limit).
Sourcespring(a :
Flock::Entity, b :
Flock::Entity, length :
Number, stiffness :
Number = 100.0, damping :
Number = 1.0, anchor_a :
Flock::Vec2 =
Flock::Vec2.new, anchor_b :
Flock::Vec2 =
Flock::Vec2.new) :
Joint2D SourceInstance methods
anchor_a=(anchor_a : Flock::Vec2)
Sourceanchor_b=(anchor_b : Flock::Vec2)
Sourceenable_limit
Revolute (Pin) angle limits on (rotb - rota - reference_angle).
Sourceenable_limit=(enable_limit :
Bool)
Revolute (Pin) angle limits on (rotb - rota - reference_angle).
Sourcemin_length
Rope mode (Distance): when max_length > 0 the joint only acts outside
[min_length, max_length].
SourceRope mode (Distance): when max_length > 0 the joint only acts outside
[min_length, max_length].
Sourcemotor_speed
Revolute (Pin) angular motor: drives (ωb - ωa) toward motor_speed, capped
at max_motor_torque. Enabled when max_motor_torque > 0.
Sourcemotor_speed=(motor_speed :
Float32)
Revolute (Pin) angular motor: drives (ωb - ωa) toward motor_speed, capped
at max_motor_torque. Enabled when max_motor_torque > 0.
Source