Lens Scripting API

    Class VertexSimulationSettings

    Provides settings for vertex physics in the ClothVisual component.

    //Create Cloth Visual Component
    var clothVisual = script.getSceneObject().createComponent("Component.ClothVisual");

    // yellow vertex colors
    var yellow = new vec4(1.0, 1.0, 0.0, 1.0);

    // different color mask (picking which color channel to compare)
    var colorMask = new vec4b(true, true, true, true);
    var yellowIndices = [];

    //Initialize ClothVisual Component
    clothVisual.onInitialized = clothInitCallback;
    clothVisual.updatePriority = 0;

    function clothInitCallback(clothVisualArg) {
    var yellowIndices = clothVisualArg.getPointIndicesByColor(yellow, colorMask);

    // create a vertex settings and set specific simulation settings value on it
    var vertexSettings = ClothVisual.createVertexSettings();
    vertexSettings.stretchStiffness = 0.75;
    vertexSettings.bendStiffness = 0.75;
    vertexSettings.stretchStiffnessGlobalWeight = 0.0;
    vertexSettings.bendStiffnessGlobalWeight = 0.0;

    // set this vertex simulation settings to all the yellow vertices with
    for (var i = 0; i < yellowIndices.length; i++) {
    clothVisual.setVertexSettings(yellowIndices[i], vertexSettings);
    }

    // we can also use getVertexSettings(vertexIndex) and modify vertex settings.
    clothVisual.resetSimulation();
    }

    Hierarchy (View Summary, Expand)

    Index

    Constructors

    Properties

    bendStiffness: number

    Bend Stiffness value.

    bendStiffnessGlobalWeight: number

    BendStiffness value weight on Global Simulation Settings for this vertex.

    friction: number

    Friction value.

    frictionGlobalWeight: number

    Friction value weight on Global Simulation Settings for this vertex.

    mass: number

    Mass value.

    massGlobalWeight: number

    Mass value weight on Global Simulation Settings for this vertex.

    stretchStiffness: number

    Stretch Stiffness value.

    stretchStiffnessGlobalWeight: number

    StretchStiffness value weight on Global Simulation Settings for this vertex.

    Methods

    • Returns true if the object matches or derives from the passed in type.

      Parameters

      • type: string

      Returns boolean

    • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

      Parameters

      Returns boolean

    MMNEPVFCICPMFPCPTTAAATR