pub struct JointDef {
pub user_data: u64,
pub body_id_a: BodyId,
pub body_id_b: BodyId,
pub local_frame_a: Transform,
pub local_frame_b: Transform,
pub force_threshold: f32,
pub torque_threshold: f32,
pub constraint_hertz: f32,
pub constraint_damping_ratio: f32,
pub draw_scale: f32,
pub collide_connected: bool,
}Expand description
Base joint definition used by all joint types. The local frames are measured from the body’s origin rather than the center of mass because:
- you might not know where the center of mass will be
- if you add/remove shapes from a body and recompute the mass, the joints will be broken
(b2JointDef)
Fields§
§user_data: u64User data
body_id_a: BodyIdThe first attached body
body_id_b: BodyIdThe second attached body
local_frame_a: TransformThe first local joint frame
local_frame_b: TransformThe second local joint frame
force_threshold: f32Force threshold for joint events
torque_threshold: f32Torque threshold for joint events
constraint_hertz: f32Constraint hertz (advanced feature)
constraint_damping_ratio: f32Constraint damping ratio (advanced feature)
draw_scale: f32Debug draw scale
collide_connected: boolSet this flag to true if the attached bodies should collide
Trait Implementations§
impl Copy for JointDef
impl StructuralPartialEq for JointDef
Auto Trait Implementations§
impl Freeze for JointDef
impl RefUnwindSafe for JointDef
impl Send for JointDef
impl Sync for JointDef
impl Unpin for JointDef
impl UnsafeUnpin for JointDef
impl UnwindSafe for JointDef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more