Skip to main content

PrismaticJointBuilder

Struct PrismaticJointBuilder 

Source
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>

Source

pub fn anchors_world<VA: Into<Vec2>, VB: Into<Vec2>>(self, a: VA, b: VB) -> Self

Set world-space anchors for A and B.

Source

pub fn axis_world<V: Into<Vec2>>(self, axis: V) -> Self

Set prismatic axis in world space.

Source

pub fn limit(self, lower: f32, upper: f32) -> Self

Enable limits with lower/upper translation (meters).

Source

pub fn motor(self, max_force: f32, speed: f32) -> Self

Enable motor with maximum force (N) and speed (m/s).

Source

pub fn motor_deg(self, max_force: f32, speed_deg: f32) -> Self

Enable motor with maximum force (N) and speed (deg/s).

Source

pub fn spring(self, hertz: f32, damping_ratio: f32) -> Self

Enable spring with stiffness (Hz) and damping ratio.

Source

pub fn collide_connected(self, flag: bool) -> Self

Allow bodies to collide while connected.

Source

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
Source

pub fn linear_stiffness(self, hertz: f32, damping_ratio: f32) -> Self

Source

pub fn angular_stiffness(self, hertz: f32, damping_ratio: f32) -> Self

Source

pub fn build(self) -> Joint<'w>

Source

pub fn try_build(self) -> ApiResult<Joint<'w>>

Source

pub fn build_owned(self) -> OwnedJoint

Source

pub fn try_build_owned(self) -> ApiResult<OwnedJoint>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.