wiki.sine.space | sinespace

Scripting/SCloth

From wiki.sine.space
Revision as of 03:47, 13 October 2021 by Voidtech (Talk | contribs)

Jump to: navigation, search

Properties

BendingStiffness

float BendingStiffness {get; set;}

Bending stiffness of cloth.

Scene = Space.Scene

Skeleton = Scene.PlayerAvatar.Skeleton
Clothing = Skeleton.Find("Clothing IDXXXXX ( )")

Clothing.BendingStiffness = 0.5


CollisionMassScale

float CollisionMassScale {get; set;}

Increase the mass of colliding particles.

Scene = Space.Scene

Skeleton = Scene.PlayerAvatar.Skeleton
Clothing = Skeleton.Find("Clothing IDXXXXX ( )")

Clothing.CollisionMassScale =0.5


EnableContinuousCollision

bool EnableContinuousCollision {get; set;}

Enable continuous collision to improve collision stability.

Scene = Space.Scene

Skeleton = Scene.PlayerAvatar.Skeleton
Clothing = Skeleton.Find("Clothing IDXXXXX ( )")
Clothing.EnableContinuousCollision = true

Space.Log(Clothing. EnableContinuousCollision)


Enabled

bool Enabled {get; set;}

Enable or disable components.

Space.Host.ExecutingObject.Cloth.Enabled = false


--clicking this object will Enable/Disable it's Cloth component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.Cloth

OnClick = function()
component.Enabled =  not component.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)

ExternalAcceleration

SVector ExternalAcceleration {get; set;}

A constant external acceleration applied to the cloth.

Scene = Space.Scene

Skeleton = Scene.PlayerAvatar.Skeleton
Clothing = Skeleton.Find("Clothing IDXXXXX ( )")
Clothing.ExternalAcceleration = Vector.New(3,4,5)

Space.Log(“ExternalAccelerationValue here X:”..Clothing.ExternalAcceleration.X..”Y:”.. Clothing.ExternalAcceleration.Y..”Z:”.. Clothing.ExternalAcceleration.Z)


Friction

float Friction {get; set;}

Return the friction of the cloth when colliding with the character.

Scene = Space.Scene

Skeleton = Scene.PlayerAvatar.Skeleton
Clothing = Skeleton.Find("Clothing IDXXXXX ( )")

Clothing.Friction = 0.896


RandomAcceleration

SVector RandomAcceleration {get; set;}

A constant external acceleration applied to the cloth.

Scene = Space.Scene

Skeleton = Scene.PlayerAvatar.Skeleton
Clothing = Skeleton.Find("Clothing IDXXXXX ( )")
Clothing.ExternalAcceleration = Vector.New(3,4,5)

Space.Log(“Random AccelerationValue here X:”..Clothing.RandomAcceleration.X..”Y:”.. Clothing.RandomlAcceleration.Y..”Z:”.. Clothing.RandomAcceleration.Z)


StretchingStiffness

float StretchingStiffness {get; set;}

Stretching stiffness of the cloth.

Scene = Space.Scene

Skeleton = Scene.PlayerAvatar.Skeleton
Clothing = Skeleton.Find("Clothing IDXXXXX ( )")

Clothing.StretchingStiffness = 0.689


UseGravity

bool UseGravity {get; set;}

Stretching stiffness of the cloth.

Scene = Space.Scene

Skeleton = Scene.PlayerAvatar.Skeleton
Clothing = Skeleton.Find("Clothing IDXXXXX ( )")

Clothing.UseGravity = false