Select bend mode to use (Isometric bending/Linear bending).
BendStiffness value.
BendStiffness value weight on all the VertexSettings.
List of colliders assigned.
If disabled, the Component will stop enacting its behavior.
When a ScreenTransform is present on this SceneObject,
and extentsTarget
is a child of this SceneObject, extentsTarget
will be repositioned to match the exact
area this MeshVisual is being rendered. Very useful for Image and Text components.
The influence of the external body mesh acting on the cloth visual.
Friction value.
Friction value weight on all the VertexSettings.
Gravity force vector.
When a ScreenTransform is attached to the same SceneObject, this controls how the mesh will be positioned horizontally depending on stretchMode
.
Number of simulation iterations to perform per each step. Higher number contributes to higher quality, but can be difficult for device performance.
Returns the first Material.
Returns the mainPass
of the mainMaterial
.
Mass value.
Mass value weight on all the VertexSettings.
Get the array of materials used by the MaterialMeshVisual.
Control for the acceleration on motion of vertices in cloth simulation, by default set to 2000.
Whether to merge close vertices (Lens Studio might split vertices when loading FBX mesh). Changing this resets the simulation.
Threshold of close vertices. Changing this value resets the simulation.
Attached mesh.
None = 0, Caster = 1, Receiver = 2
Function called when the ClothVisual is initialized.
Indicates whether we will enable collision repulsion with collider models.
Collision friction to dampen relative motion.
Indicates the offset we set when the cloth mesh is too close to the colliders.
Indicates the stiffness of repulsion when collision.
Readonly
sceneThe scene object this component is on.
Affects the color of shadows being cast by this MeshVisual. The color of the cast shadow is a mix between shadowColor and the material's base texture color. The alpha value of shadowColor controls the mixing of these two colors, with 0 = shadowColor and 1 = shadowColor * textureColor.
Density of shadows cast by this MeshVisual.
Readonly
simulatedReturns the modified simulated mesh which can be used in another RenderMeshVisual if the same simulated mesh is needed. Useful when creating effects that might require the same mesh to be rendered twice, such as with a mirror effect. Prevents the need to run a simulation twice.
When a ScreenTransform is attached to the same SceneObject, this controls how the mesh will be stretched relative to the ScreenTransform's boundaries.
StretchStiffness Value.
StretchStiffness Value weight on all the VertexSettings.
Readonly
uniqueWhether to update normals for the cloth mesh each frame in order to get reflection update.
When a ScreenTransform is attached to the same SceneObject, this controls how the mesh will be positioned vertically depending on stretchMode
.
Adds a collider to the list of colliders.
Adds a Material to use for rendering.
Returns all the indices on the cloth mesh that are matching the color mask. Match means that the color has value on the channels which in colorMask is true.
Returns the SceneObject the component is attached to.
Gets binding SceneObject of the vertex.
Gets simulation settings of the vertex.
Returns true if this object is the same as other
. Useful for checking if two references point to the same thing.
Removes collider by its index and returns the removed collider.
Sets the binding SceneObject for the vertex.
Sets simulation settings of the vertex.
Projects screen positions from camera
's view onto the mesh's UVs.
If the MeshVisual's material uses the same texture as the camera input, the MeshVisual will look identical to the part of the screen it covers.
Handles the mesh data of cloth and prepares it for cloth simulation. Also controls all the parameters of the cloth simulator and colliders.
Example