// volume public void SetVolume(bool sw, float maxLength = 0.05f, float stiffness = 0.5f, float shear = 0.5f) { useVolume = sw; maxVolumeLength = maxLength; volumeShearStiffness.SetParam(stiffness, stiffness, false); volumeShearStiffness.SetParam(shear, shear, false); }
// clamp position public void SetClampPositionLength(bool sw, float sval = 0.03f, float eval = 0.2f, float ratioX = 1, float ratioY = 1, float ratioZ = 1, float influence = 0.2f) { useClampPositionLength = sw; clampPositionLength.SetParam(sval, eval); clampPositionRatioX = ratioX; clampPositionRatioY = ratioY; clampPositionRatioZ = ratioZ; clampPositionVelocityInfluence = influence; }
// restore distance public void SetRestoreDistance(float influence = 1.0f, float structStiffness = 1.0f) { restoreDistanceVelocityInfluence = influence; structDistanceStiffness.SetParam(structStiffness, structStiffness, false); }
// clamp rotation public void SetClampRotationAngle(bool sw, float sval = 30.0f, float eval = 30.0f, float influence = 0.2f) { useClampRotation = sw; clampRotationAngle.SetParam(sval, eval); clampRotationVelocityInfluence = influence; }
// world move/rot influence public void SetWorldInfluence(float maxspeed, float moveval, float rotval) { maxMoveSpeed = maxspeed; worldMoveInfluence.SetParam(moveval, moveval, false); worldRotationInfluence.SetParam(rotval, rotval, false); }
// max velocity public void SetMaxVelocity(bool sw, float sval = 3, float eval = 3) { useMaxVelocity = sw; maxVelocity.SetParam(sval, eval); }
// drag public void SetDrag(bool sw, float sval = 0.015f, float eval = 0.015f) { useDrag = sw; drag.SetParam(sval, eval); }
// gravity public void SetGravity(bool sw, float sval = -9.8f, float eval = -9.8f) { useGravity = sw; gravity.SetParam(sval, eval); }
// mass public void SetMass(float sval, float eval, bool useEval = true, float cval = 0.0f, bool useCval = false) { mass.SetParam(sval, eval, useEval, cval, useCval); }
//========================================================================================= // radius public void SetRadius(float sval, float eval) { radius.SetParam(sval, eval); }
// triangle bend public void SetTriangleBend(bool sw, float sval = 0.03f, float eval = 0.03f) { useTriangleBend = sw; triangleBend.SetParam(sval, eval); }
public void SetSpringDistanceAtten(float sval, float eval, float cval) { springDistanceAtten.SetParam(sval, eval, true, cval, true); }
// restore rotation public void SetRestoreRotation(bool sw, float sval = 0.02f, float eval = 0.001f, float influence = 0.3f) { useRestoreRotation = sw; restoreRotation.SetParam(sval, eval); restoreRotationVelocityInfluence = influence; }
// world move/rot influence public void SetWorldInfluence(float moveval, float rotval) { worldMoveInfluence.SetParam(moveval, moveval, false); worldRotationInfluence.SetParam(rotval, rotval, false); }
public void SetDirectionalDamping(bool sw, float sval = 1.0f, float eval = 0.1f, float curve = -0.5f, Transform target = null) { useDirectionalDamping = sw; directionalDamping.SetParam(sval, eval, true, curve, true); directionalDampingObject = target; }