pub struct RevoluteJointDef { /* private fields */ }Expand description
Builder for a Box3D revolute joint.
A revolute joint fixes a point on body B to a point on body A and allows relative rotation about the joint z axis.
Implementations§
Source§impl RevoluteJointDef
impl RevoluteJointDef
Sourcepub fn raw(&self) -> &b3RevoluteJointDef
pub fn raw(&self) -> &b3RevoluteJointDef
Returns the raw Box3D definition backing this builder.
Sourcepub fn body_ids(self, body_a: BodyId, body_b: BodyId) -> Self
pub fn body_ids(self, body_a: BodyId, body_b: BodyId) -> Self
Sets the two bodies connected by the joint.
Sourcepub fn local_frame_a(self, frame: Transform) -> Self
pub fn local_frame_a(self, frame: Transform) -> Self
Sets the local constraint frame on body A.
Box3D measures joint local frames from each body’s origin, not from its center of mass. This keeps the joint stable when body shapes are later added, removed, or have mass recomputed.
Sourcepub fn local_frame_b(self, frame: Transform) -> Self
pub fn local_frame_b(self, frame: Transform) -> Self
Sets the local constraint frame on body B.
Box3D measures joint local frames from each body’s origin, not from its center of mass.
Sourcepub fn collide_connected(self, collide_connected: bool) -> Self
pub fn collide_connected(self, collide_connected: bool) -> Self
Controls whether the connected bodies may collide with each other.
Sourcepub fn force_threshold(self, threshold: f32) -> Self
pub fn force_threshold(self, threshold: f32) -> Self
Sets the force threshold, in newtons, used to emit joint events.
Sourcepub fn torque_threshold(self, threshold: f32) -> Self
pub fn torque_threshold(self, threshold: f32) -> Self
Sets the torque threshold, in newton-meters, used to emit joint events.
Sourcepub fn constraint_tuning(self, tuning: JointTuning) -> Self
pub fn constraint_tuning(self, tuning: JointTuning) -> Self
Sets the common constraint frequency and damping ratio.
The frequency is in hertz and the damping ratio is dimensionless.
Sourcepub fn draw_scale(self, draw_scale: f32) -> Self
pub fn draw_scale(self, draw_scale: f32) -> Self
Sets the scale used by native debug drawing for this joint.
Sourcepub unsafe fn raw_user_data(self, user_data: *mut c_void) -> Self
pub unsafe fn raw_user_data(self, user_data: *mut c_void) -> Self
Sets the raw Box3D userData pointer on this joint definition.
§Safety
The caller must ensure the pointer remains valid for every native Box3D use and
must not rely on boxddd to manage, alias-check, or drop the pointed-to value.
Source§impl RevoluteJointDef
impl RevoluteJointDef
Sourcepub fn new(body_a: BodyId, body_b: BodyId) -> Self
pub fn new(body_a: BodyId, body_b: BodyId) -> Self
Creates a revolute joint definition for two bodies.
Sourcepub fn spring(self, enabled: bool, hertz: f32, damping_ratio: f32) -> Self
pub fn spring(self, enabled: bool, hertz: f32, damping_ratio: f32) -> Self
Enables or disables the angular spring and sets its tuning.
hertz is cycles per second and damping_ratio is dimensionless.
Sourcepub fn target_angle(self, target_angle: f32) -> Self
pub fn target_angle(self, target_angle: f32) -> Self
Sets the target angle, in radians, for the angular spring.
Trait Implementations§
Source§impl Clone for RevoluteJointDef
impl Clone for RevoluteJointDef
Source§fn clone(&self) -> RevoluteJointDef
fn clone(&self) -> RevoluteJointDef
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more