KeepDistance
KeepDistance keeps vertices of one geometry at a given distance from another geometry.
- How it works
KeepDistance for each vertex in a Deformable Geometry finds closest triangle in a Collider (using its normals or direction from the geometry center, depends on Projection Type) and moves vertices to the Reference Distance.
If Reference Distance is set to From Reference Inputs it will use distances between Reference Geometry vertices and closest Reference Collider triangles as a Reference Distance for each vertex.
If Reference Distance is set to Set to Custom Distance it will moves all vertices of Deformable Geometry at Custom Distance (cm).
Inputs
- Deformable Geometry
Geometry
Geometry to be deformed (Keep a distance)- Collider
Geometry
Geometry that our Deformable Geometry will keep its distance from- Reference Geometry
Geometry
(optional) Reference deformed geometry, must have the same vertices count as Deformable Geometry (Unused when Reference Distance is set to Set to Custom Distance)- Reference Collider
Geometry
(optional) Reference collision model (Unused when Reference Distance is set to Set to Custom Distance)- Deformable Vertex Mask
VertexMask
(optional) Deformable vertex mask is used to select vertices to be deformed
Output
Geometry
Deformed Deformable Geometry
Parameters
- Keep Distance:
- Everywhere
always moves Deformable Geometry vertices to the reference distance
- Where Closer than Reference Distance
moves Deformable Geometry vertices to reference distance only if they are closer than reference distance
- Where Further than Reference Distance
moves Deformable Geometry vertices to reference distance only if they are further than reference distance
- Projection Type:
- Geometry
measures the distance from the nearest Collider polygons to the vertices of the Deformable Geometry using Collider normals
- Centroid
measures the distance from the nearest Collider polygons to the vertices of the Deformable Geometry, using the direction from the center of Collider (Typically used on the eyeballs)
- Reference Distance:
- From Reference Inputs
calculates reference distances for each vertex from distances between Reference Deformable Geometry and Reference Deformation Source Geometry
- Set to Custom Distance
uses custom reference distance from Custom Distance (cm)
- Custom Distance (cm):
distance in centimeters from the surface of Deformation Source Geometry (Can be negative). If Reference Distance is set to From Reference Inputs, this parameter will be ignored.