Struct WheelFrictionCurve

Source
pub struct WheelFrictionCurve {
    pub asymptoteSlip: Option<f32>,
    pub asymptoteValue: Option<f32>,
    pub extremumSlip: Option<f32>,
    pub extremumValue: Option<f32>,
    pub m_AsymptoteSlip: Option<f32>,
    pub m_AsymptoteValue: Option<f32>,
    pub m_ExtremumSlip: Option<f32>,
    pub m_ExtremumValue: Option<f32>,
    pub m_Stiffness: Option<f32>,
    pub stiffnessFactor: Option<f32>,
}
Expand description

WheelFrictionCurve is a sub class of the Unity engine since version 3.4.0. Exert from Unity’s scripting documentation: WheelFrictionCurve is used by the WheelCollider to describe friction properties of the wheel tire. The curve takes a measure of tire slip as an input and gives a force as output. The curve is approximated by a two-piece spline. The first section goes from (0,0) to (extremumSlip,extremumValue), at which point the curve’s tangent is zero. The second section goes from (extremumSlip,extremumValue) to (asymptoteSlip,asymptoteValue), where curve’s tangent is again zero:Wheel collider computes friction separately from the rest of physics engine, using a slip based friction model. It separates the overall friction force into a “forwards” component (in the direction of rolling, and responsible for acceleration and braking) and “sideways” component (orthogonal to rolling, responsible for keeping the car oriented). Tire friction is described separately in these directions using WheelCollider.forwardFriction and WheelCollider.sidewaysFriction. In both directions it is first determined how much the tire is slipping (what is the speed difference between the rubber and the road). Then this slip value is used to find out tire force exerted on the contact.The property of real tires is that for low slip they can exert high forces as the rubber compensates for the slip by stretching. Later when the slip gets really high, the forces are reduced as the tire starts to slide or spin. Thus tire friction curves have a shape like in the image above.Because the friction for the tires is computed separately, the PhysicMaterial of the ground does not affect the wheels. Simulation of different road materials is done by changing the WheelCollider.forwardFriction and WheelCollider.sidewaysFriction of the wheel, based on what material the wheel is hitting.See Also: WheelCollider, WheelCollider.forwardFriction, WheelCollider.sidewaysFriction.

Fields§

§asymptoteSlip: Option<f32>

Asymptote point slip (default 2). f32: (3.4.0 - 4.7.2)

§asymptoteValue: Option<f32>

Force at the asymptote slip (default 10000). f32: (3.4.0 - 4.7.2)

§extremumSlip: Option<f32>

Extremum point slip (default 1). f32: (3.4.0 - 4.7.2)

§extremumValue: Option<f32>

Force at the extremum slip (default 20000). f32: (3.4.0 - 4.7.2)

§m_AsymptoteSlip: Option<f32>

Asymptote point slip (default 2). f32: (5.0.0f4 - 2022.3.2f1)

§m_AsymptoteValue: Option<f32>

Force at the asymptote slip (default 10000). f32: (5.0.0f4 - 2022.3.2f1)

§m_ExtremumSlip: Option<f32>

Extremum point slip (default 1). f32: (5.0.0f4 - 2022.3.2f1)

§m_ExtremumValue: Option<f32>

Force at the extremum slip (default 20000). f32: (5.0.0f4 - 2022.3.2f1)

§m_Stiffness: Option<f32>

Multiplier for the extremumValue and asymptoteValue values (default 1). f32: (5.0.0f4 - 2022.3.2f1)

§stiffnessFactor: Option<f32>

f32: (3.4.0 - 4.7.2)

Trait Implementations§

Source§

impl Debug for WheelFrictionCurve

Source§

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

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

impl<'de> Deserialize<'de> for WheelFrictionCurve

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 WheelFrictionCurve

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> Same for T

Source§

type Output = T

Should always be Self
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>,