Protected
constructorSelect 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.
Clears the colliders list.
Clears all Materials.
Static
createCreates a new instance of vertex simulation settings.
Destroys the component.
Returns all available vertex colors on cloth mesh.
Returns the number of Materials used 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 order of this Visual in the render queue.
Returns the SceneObject the component is attached to.
Returns the Transform this component is attached to.
Returns the name of this object's type.
Returns true if the Cloth Simulation feature is supported by the current device.
Returns true if the Cloth Simulation and resources are initialized. Always return false if device is not supported.
Returns true if the object matches or derives from the passed in type.
Returns true if this object is the same as other
. Useful for checking if two references point to the same thing.
Range maximum of the local-space axis-aligned bounding box (AABB) of the visual.
Range minimum of the local-space axis-aligned bounding box (AABB) of the visual.
Removes collider by its index and returns the removed collider.
Resets the cloth simulation.
Sets the order of this Visual in the render queue.
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.
Range maximum of the world-space axis-aligned bounding box (AABB) of the visual.
Range minimum of the world-space axis-aligned bounding box (AABB) of the visual.
Simulates and renders cloth visuals in a Lens.
Remarks
Handles the mesh data of cloth and prepares it for cloth simulation. Also controls all the parameters of the cloth simulator and colliders.
See
Cloth Simulation
Example