Cloth

Struct Cloth 

Source
pub struct Cloth {
Show 25 fields pub m_BendingStiffness: f32, pub m_CapsuleColliders: Vec<PPtr>, pub m_Coefficients: Vec<ClothConstrainCoefficients>, pub m_CollisionMassScale: f32, pub m_Damping: f32, pub m_Enabled: u8, pub m_ExternalAcceleration: Vector3f, pub m_Friction: f32, pub m_GameObject: PPtr, pub m_RandomAcceleration: Vector3f, pub m_SleepThreshold: f32, pub m_SolverFrequency: Enum_u32__f32, pub m_SphereColliders: Vec<Enum_ClothSphereColliderPair___PPtr__PPtr>, pub m_StretchingStiffness: f32, pub m_UseContinuousCollision: bool, pub m_UseGravity: bool, pub m_UseTethers: bool, pub m_WorldAccelerationScale: f32, pub m_WorldVelocityScale: f32, pub m_SelfAndInterCollisionIndices: Option<Vec<u32>>, pub m_SelfCollisionDistance: Option<f32>, pub m_SelfCollisionStiffness: Option<f32>, pub m_UseVirtualParticles: Option<bool>, pub m_VirtualParticleIndices: Option<Vec<u32>>, pub m_VirtualParticleWeights: Option<Vec<Vector3f>>,
}
Expand description

Cloth is a class of the Unity engine since version 5.0.0f4. Exert from Unity’s scripting documentation: The Cloth class provides an interface to cloth simulation physics.

Fields§

§m_BendingStiffness: f32

Bending stiffness of the cloth.

§m_CapsuleColliders: Vec<PPtr>

An array of CapsuleColliders which this Cloth instance should collide with. Vec<PPtr<CapsuleCollider>>: (5.0.0f4 - 2022.3.2f1)

§m_Coefficients: Vec<ClothConstrainCoefficients>

The cloth skinning coefficients used to set up how the cloth interacts with the skinned mesh.

§m_CollisionMassScale: f32

How much to increase mass of colliding particles.

§m_Damping: f32

Damp cloth motion.

§m_Enabled: u8

Is this cloth enabled?

§m_ExternalAcceleration: Vector3f

A constant, external acceleration applied to the cloth.

§m_Friction: f32

The friction of the cloth when colliding with the character.

§m_GameObject: PPtr

The game object this component is attached to. A component is always attached to a game object. PPtr<GameObject>: (5.0.0f4 - 2022.3.2f1)

§m_RandomAcceleration: Vector3f

A random, external acceleration applied to the cloth.

§m_SleepThreshold: f32

Cloth’s sleep threshold.

§m_SolverFrequency: Enum_u32__f32§m_SphereColliders: Vec<Enum_ClothSphereColliderPair___PPtr__PPtr>

An array of ClothSphereColliderPairs which this Cloth instance should collide with. Vec<(PPtr<SphereCollider>, PPtr<SphereCollider>)>: (5.0.0f4 - 2019.1.0a10); Vec: (2019.1.0b1 - 2022.3.2f1)

§m_StretchingStiffness: f32

Stretching stiffness of the cloth.

§m_UseContinuousCollision: bool§m_UseGravity: bool

Should gravity affect the cloth simulation?

§m_UseTethers: bool

Use Tether Anchors.

§m_WorldAccelerationScale: f32

How much world-space acceleration of the character will affect cloth vertices.

§m_WorldVelocityScale: f32

How much world-space movement of the character will affect cloth vertices.

§m_SelfAndInterCollisionIndices: Option<Vec<u32>>

Vec: (2017.3.0b1 - 2022.3.2f1)

§m_SelfCollisionDistance: Option<f32>

Minimum distance at which two cloth particles repel each other (default: 0.0). f32: (2017.3.0b1 - 2022.3.2f1)

§m_SelfCollisionStiffness: Option<f32>

Self-collision stiffness defines how strong the separating impulse should be for colliding particles. f32: (2017.3.0b1 - 2022.3.2f1)

§m_UseVirtualParticles: Option<bool>

Add one virtual particle per triangle to improve collision stability. bool: (5.0.0f4 - 2022.3.2f1)

§m_VirtualParticleIndices: Option<Vec<u32>>

Vec: (2017.3.0b1 - 2022.3.2f1)

§m_VirtualParticleWeights: Option<Vec<Vector3f>>

Vec: (2017.3.0b1 - 2022.3.2f1)

Trait Implementations§

Source§

impl Debug for Cloth

Source§

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

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

impl<'de> Deserialize<'de> for Cloth

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 Cloth

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§

§

impl Freeze for Cloth

§

impl RefUnwindSafe for Cloth

§

impl Send for Cloth

§

impl Sync for Cloth

§

impl Unpin for Cloth

§

impl UnwindSafe for Cloth

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