private static extern void Internal_getSpring(IntPtr thisPtr, out Spring __output);
 private static extern void Internal_setSpring(IntPtr thisPtr, ref Spring value);
Exemple #3
0
 protected LimitCommon(Spring spring, float restitution = 0.0f)
 {
     data.contactDist = -1.0f;
     data.restitution = restitution;
     data.spring      = spring;
 }
Exemple #4
0
 /// <summary>
 /// Constructs a soft limit. Once the limit is reached the bodies will bounce back according to the resitution
 /// parameter and will be pulled back towards the limit by the provided spring.
 /// </summary>
 /// <param name="lower"><see cref="Lower"/></param>
 /// <param name="upper"><see cref="Upper"/></param>
 /// <param name="spring"><see cref="LimitCommon.Spring"/></param>
 /// <param name="restitution"><see cref="LimitCommon.Restitution"/></param>
 public LimitLinearRange(float lower, float upper, Spring spring, float restitution = 0.0f)
     : base(spring, restitution)
 {
     data.lower = lower;
     data.upper = upper;
 }
Exemple #5
0
 /// <summary>
 /// Constructs a soft limit. Once the limit is reached the bodies will bounce back according to the resitution
 /// parameter and will be pulled back towards the limit by the provided spring.
 /// </summary>
 /// <param name="lower"><see cref="Lower"/></param>
 /// <param name="upper"><see cref="Upper"/></param>
 /// <param name="spring"><see cref="LimitCommon.Spring"/></param>
 /// <param name="restitution"><see cref="LimitCommon.Restitution"/></param>
 public LimitAngularRange(Radian lower, Radian upper, Spring spring, float restitution = 0.0f)
     : base(spring, restitution)
 {
     data.lower = lower;
     data.upper = upper;
 }
Exemple #6
0
 /// <summary>
 /// Constructs a soft limit. Once the limit is reached the bodies will bounce back according to the resitution
 /// parameter and will be pulled back towards the limit by the provided spring.
 /// </summary>
 /// <param name="yLimitAngle"><see cref="YLimitAngle"/></param>
 /// <param name="zLimitAngle"><see cref="ZLimitAngle"/></param>
 /// <param name="spring"><see cref="LimitCommon.Spring"/></param>
 /// <param name="restitution"><see cref="LimitCommon.Restitution"/></param>
 public LimitConeRange(Radian yLimitAngle, Radian zLimitAngle, Spring spring, float restitution = 0.0f)
     : base(spring, restitution)
 {
     data.yLimitAngle = yLimitAngle;
     data.zLimitAngle = zLimitAngle;
 }
 public LimitCommon(Spring spring, float restitution = 0f)
 {
     this.contactDist = -1f;
     this.restitution = restitution;
     this.spring      = spring;
 }
Exemple #8
0
 /// <summary>
 /// Constructs a soft limit.Once the limit is reached the bodies will bounce back according to the resitution
 /// parameter and will be pulled back towards the limit by the provided spring.
 /// </summary>
 /// <param name="extent"><see cref="Extent"/></param>
 /// <param name="spring"><see cref="LimitCommon.Spring"/></param>
 /// <param name="restitution"><see cref="LimitCommon.Restitution"/></param>
 public LimitLinear(float extent, Spring spring, float restitution = 0.0f)
     : base(spring, restitution)
 {
     data.extent = extent;
 }
Exemple #9
0
 /// <summary>
 /// Constructs a soft limit.Once the limit is reached the bodies will bounce back according to the resitution
 /// parameter and will be pulled back towards the limit by the provided spring.
 /// </summary>
 /// <param name="extent"><see cref="Extent"/></param>
 /// <param name="spring"><see cref="LimitCommon.Spring"/></param>
 /// <param name="restitution"><see cref="LimitCommon.Restitution"/></param>
 public LimitLinear(float extent, Spring spring, float restitution = 0.0f)
     : base(spring, restitution)
 {
     data.extent = extent;
 }
Exemple #10
0
 /// <summary>
 /// Constructs a soft limit. Once the limit is reached the bodies will bounce back according to the resitution
 /// parameter and will be pulled back towards the limit by the provided spring.
 /// </summary>
 /// <param name="lower"><see cref="Lower"/></param>
 /// <param name="upper"><see cref="Upper"/></param>
 /// <param name="spring"><see cref="LimitCommon.Spring"/></param>
 /// <param name="restitution"><see cref="LimitCommon.Restitution"/></param>
 public LimitLinearRange(float lower, float upper, Spring spring, float restitution = 0.0f)
     : base(spring, restitution)
 {
     data.lower = lower;
     data.upper = upper;
 }
Exemple #11
0
 /// <summary>
 /// Constructs a soft limit. Once the limit is reached the bodies will bounce back according to the resitution
 /// parameter and will be pulled back towards the limit by the provided spring.
 /// </summary>
 /// <param name="yLimitAngle"><see cref="YLimitAngle"/></param>
 /// <param name="zLimitAngle"><see cref="ZLimitAngle"/></param>
 /// <param name="spring"><see cref="LimitCommon.Spring"/></param>
 /// <param name="restitution"><see cref="LimitCommon.Restitution"/></param>
 public LimitConeRange(Radian yLimitAngle, Radian zLimitAngle, Spring spring, float restitution = 0.0f)
     : base(spring, restitution)
 {
     data.yLimitAngle = yLimitAngle;
     data.zLimitAngle = zLimitAngle;
 }
Exemple #12
0
 protected LimitCommon(Spring spring, float restitution = 0.0f)
 {
     data.contactDist = -1.0f;
     data.restitution = restitution;
     data.spring = spring;
 }
Exemple #13
0
 /// <summary>
 /// Constructs a soft limit. Once the limit is reached the bodies will bounce back according to the resitution
 /// parameter and will be pulled back towards the limit by the provided spring.
 /// </summary>
 /// <param name="lower"><see cref="Lower"/></param>
 /// <param name="upper"><see cref="Upper"/></param>
 /// <param name="spring"><see cref="LimitCommon.Spring"/></param>
 /// <param name="restitution"><see cref="LimitCommon.Restitution"/></param>
 public LimitAngularRange(Radian lower, Radian upper, Spring spring, float restitution = 0.0f)
     : base(spring, restitution)
 {
     data.lower = lower;
     data.upper = upper;
 }
 private static extern void Internal_SetSpring(IntPtr thisPtr, ref Spring value);
Exemple #15
0
        /// <summary>
        /// Constructs a new set of GUI elements for inspecting the spring object.
        /// </summary>
        /// <param name="spring">Initial values to assign to the GUI elements.</param>
        /// <param name="layout">Layout to append the GUI elements to.</param>
        public SpringGUI(Spring spring, GUILayout layout)
        {
            this.spring = spring;

            stiffnessField.OnChanged += x => { spring.stiffness = x; MarkAsModified(); };
            stiffnessField.OnFocusLost += ConfirmModify;
            stiffnessField.OnConfirmed += ConfirmModify;

            dampingField.OnChanged += x => { spring.damping = x; MarkAsModified(); };
            dampingField.OnFocusLost += ConfirmModify;
            dampingField.OnConfirmed += ConfirmModify;

            layout.AddElement(stiffnessField);
            layout.AddElement(dampingField);
        }