ArticulationDrive

Struct ArticulationDrive 

Source
pub struct ArticulationDrive {
    pub damping: f32,
    pub forceLimit: f32,
    pub lowerLimit: f32,
    pub stiffness: f32,
    pub target: f32,
    pub targetVelocity: f32,
    pub upperLimit: f32,
    pub driveType: Option<i32>,
}
Expand description

ArticulationDrive is a sub class of the Unity engine since version 2020.1.0b1. Exert from Unity’s scripting documentation: Drive applies forces and torques to the connected bodies. Drive moves the body along one degree of freedom, be it a linear motion along a particular axis or a rotational motion around a particular axis. The drive will apply force to the body that is calculated from the current value of the drive, using this formula: F = stiffness * (currentPosition - target) - damping * (currentVelocity - targetVelocity). In this formula, currentPosition and currentVelocity are linear position and linear velocity in case of the linear drive. In case of the rotational drive, currentPosition and currentVelocity correspond to the angle and angular velocity respectively.

Fields§

§damping: f32

The damping of the spring attached to this drive.

§forceLimit: f32

The maximum force this drive can apply to a body.

§lowerLimit: f32

The lower limit of motion for a particular degree of freedom.

§stiffness: f32

The stiffness of the spring connected to this drive.

§target: f32

The target value the drive will try to reach.

§targetVelocity: f32

The velocity of the body this drive will try to reach.

§upperLimit: f32

The upper limit of motion for a particular degree of freedom.

§driveType: Option<i32>

Specifies which drive type to use for this drive. i32: (2022.2.0b1 - 2022.3.2f1)

Trait Implementations§

Source§

impl Debug for ArticulationDrive

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ArticulationDrive

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ArticulationDrive

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,