Example #1
0
 public LinearElasticSystem(float initialValue, float initialVelocity,
                            ElasticExtentProperties <float> extentInfo,
                            ElasticProperties elasticProperties)
     : base(initialValue, initialVelocity,
            extentInfo, elasticProperties)
 {
 }
Example #2
0
 /// <summary>
 /// Initialize system with source info from controllers/hands.
 /// Left and right handles must both be specified, but this does not
 /// preclude single-hand interaction when Update() is called.
 /// </summary>
 /// <param name="leftHandleStart">World position of "left" handle point.</param>
 /// <param name="rightHandleStart">World position of "right" handle point.</param>
 /// <param name="extentInfo">Properties of the linear 1-D elastic extent to be manipulated</param>
 /// <param name="elasticProperties">Properties of the elastic material/spring.</param>
 /// <param name="leftHandleVelocity">Optional, initial velocity in 1-dimensional stretch space</param>
 /// <param name="rightHandleVelocity">Optional, initial velocity in 1-dimensional stretch space</param>
 public virtual void Setup(Vector3 leftHandleStart, Vector3 rightHandleStart,
                           ElasticExtentProperties <float> extentInfo, ElasticProperties elasticProperties)
 {
     isSetup              = true;
     leftInitialPosition  = leftHandleStart;
     rightInitialPosition = rightHandleStart;
     elasticSystem        = new LinearElasticSystem((leftHandleStart - rightHandleStart).magnitude, elasticSystem?.GetCurrentVelocity() ?? 0.0f, extentInfo, elasticProperties);
 }
Example #3
0
 public ElasticSystem(T initialValue, T initialVelocity,
                      ElasticExtentProperties <T> extentInfo,
                      ElasticProperties elasticProperties)
 {
     this.extentInfo        = extentInfo;
     this.elasticProperties = elasticProperties;
     currentValue           = initialValue;
     currentVelocity        = initialVelocity;
 }