pub struct PrismaticJointBuilder<'w> { /* private fields */ }Expand description
Builder for a prismatic joint in world space. Fluent builder for prismatic joints using world anchors and axis.
Implementations§
Source§impl<'w> PrismaticJointBuilder<'w>
impl<'w> PrismaticJointBuilder<'w>
Sourcepub fn anchors_world<VA: Into<Vec2>, VB: Into<Vec2>>(self, a: VA, b: VB) -> Self
pub fn anchors_world<VA: Into<Vec2>, VB: Into<Vec2>>(self, a: VA, b: VB) -> Self
Set world-space anchors for A and B.
Sourcepub fn axis_world<V: Into<Vec2>>(self, axis: V) -> Self
pub fn axis_world<V: Into<Vec2>>(self, axis: V) -> Self
Set prismatic axis in world space.
Sourcepub fn limit(self, lower: f32, upper: f32) -> Self
pub fn limit(self, lower: f32, upper: f32) -> Self
Enable limits with lower/upper translation (meters).
Sourcepub fn motor(self, max_force: f32, speed: f32) -> Self
pub fn motor(self, max_force: f32, speed: f32) -> Self
Enable motor with maximum force (N) and speed (m/s).
Sourcepub fn motor_deg(self, max_force: f32, speed_deg: f32) -> Self
pub fn motor_deg(self, max_force: f32, speed_deg: f32) -> Self
Enable motor with maximum force (N) and speed (deg/s).
Sourcepub fn spring(self, hertz: f32, damping_ratio: f32) -> Self
pub fn spring(self, hertz: f32, damping_ratio: f32) -> Self
Enable spring with stiffness (Hz) and damping ratio.
Sourcepub fn collide_connected(self, flag: bool) -> Self
pub fn collide_connected(self, flag: bool) -> Self
Allow bodies to collide while connected.
Sourcepub fn with_stiffness(
self,
linear_hz: f32,
linear_dr: f32,
angular_hz: f32,
angular_dr: f32,
) -> Self
pub fn with_stiffness( self, linear_hz: f32, linear_dr: f32, angular_hz: f32, angular_dr: f32, ) -> Self
Stiffness on both linear and angular degrees of freedom.
- linear_hz/angular_hz: stiffness (Hz), typical 4–20
- linear_dr/angular_dr: damping ratio [0, 1], typical 0.1–0.7
pub fn linear_stiffness(self, hertz: f32, damping_ratio: f32) -> Self
pub fn angular_stiffness(self, hertz: f32, damping_ratio: f32) -> Self
pub fn build(self) -> Joint<'w>
pub fn try_build(self) -> ApiResult<Joint<'w>>
pub fn build_owned(self) -> OwnedJoint
pub fn try_build_owned(self) -> ApiResult<OwnedJoint>
Auto Trait Implementations§
impl<'w> Freeze for PrismaticJointBuilder<'w>
impl<'w> RefUnwindSafe for PrismaticJointBuilder<'w>
impl<'w> !Send for PrismaticJointBuilder<'w>
impl<'w> !Sync for PrismaticJointBuilder<'w>
impl<'w> Unpin for PrismaticJointBuilder<'w>
impl<'w> UnsafeUnpin for PrismaticJointBuilder<'w>
impl<'w> !UnwindSafe for PrismaticJointBuilder<'w>
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