/// <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">Distance at which the limit becomes active.</param> /// <param name="spring"> /// Spring that controls how are the bodies pulled back towards the limit when they breach it. /// </param> /// <param name="restitution"> /// Controls how do objects react when the limit is reached, values closer to zero specify non-ellastic collision, while /// those closer to one specify more ellastic (i.e bouncy) collision. Must be in [0, 1] range. /// </param> public LimitLinear(float extent, Spring spring, float restitution = 0f) { this.extent = extent; this.contactDist = -1f; this.restitution = 0f; this.spring = Spring.Default(); }
/// <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"> /// Y angle of the cone. Movement is constrainted between 0 and this angle on the Y axis. /// </param> /// <param name="zLimitAngle"> /// Z angle of the cone. Movement is constrainted between 0 and this angle on the Z axis. /// </param> /// <param name="spring"> /// Spring that controls how are the bodies pulled back towards the limit when they breach it. /// </param> /// <param name="restitution"> /// Controls how do objects react when the limit is reached, values closer to zero specify non-ellastic collision, while /// those closer to one specify more ellastic (i.e bouncy) collision. Must be in [0, 1] range. /// </param> public LimitConeRange(Radian yLimitAngle, Radian zLimitAngle, Spring spring, float restitution = 0f) { this.yLimitAngle = yLimitAngle; this.zLimitAngle = zLimitAngle; this.contactDist = -1f; this.restitution = 0f; this.spring = Spring.Default(); }
/// <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">Lower distance of the limit. Must be less than <paramref name="upper"/>.</param> /// <param name="upper">Upper distance of the limit. Must be more than <paramref name="lower"/>.</param> /// <param name="spring"> /// Spring that controls how are the bodies pulled back towards the limit when they breach it. /// </param> /// <param name="restitution"> /// Controls how do objects react when the limit is reached, values closer to zero specify non-ellastic collision, while /// those closer to one specify more ellastic (i.e bouncy) collision. Must be in [0, 1] range. /// </param> public LimitLinearRange(float lower, float upper, Spring spring, float restitution = 0f) { this.lower = lower; this.upper = upper; this.contactDist = -1f; this.restitution = 0f; this.spring = Spring.Default(); }
/// <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">Lower angle of the limit. Must be less than <paramref name="upper"/>.</param> /// <param name="upper">Upper angle of the limit. Must be more than <paramref name="lower"/>.</param> /// <param name="spring"> /// Spring that controls how are the bodies pulled back towards the limit when they breach it. /// </param> /// <param name="restitution"> /// Controls how do objects react when the limit is reached, values closer to zero specify non-ellastic collision, while /// those closer to one specify more ellastic (i.e bouncy) collision. Must be in [0, 1] range. /// </param> public LimitAngularRange(Radian lower, Radian upper, Spring spring, float restitution = 0f) { this.lower = lower; this.upper = upper; this.contactDist = -1f; this.restitution = 0f; this.spring = Spring.Default(); }
/// <summary>Initializes the struct with default values.</summary> public static LimitLinear Default() { LimitLinear value = new LimitLinear(); value.extent = 0f; value.contactDist = -1f; value.restitution = 0f; value.spring = Spring.Default(); return(value); }
/// <summary>Initializes the struct with default values.</summary> public static LimitConeRange Default() { LimitConeRange value = new LimitConeRange(); value.yLimitAngle = Radian.Default(); value.zLimitAngle = Radian.Default(); value.contactDist = -1f; value.restitution = 0f; value.spring = Spring.Default(); return(value); }
/// <summary>Initializes the struct with default values.</summary> public static LimitLinearRange Default() { LimitLinearRange value = new LimitLinearRange(); value.lower = 0f; value.upper = 0f; value.contactDist = -1f; value.restitution = 0f; value.spring = Spring.Default(); return(value); }
public LimitCommon(float contactDist = -1f) { this.contactDist = contactDist; this.restitution = 0f; this.spring = Spring.Default(); }