Skip to content

Commit

Permalink
Fix limit disc mismatch and uncover slider angular limit behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
manio143 committed Aug 15, 2021
1 parent 6b313ea commit 699852f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ public HingeModelWrapper(HingeConstraintDesc desc, Pivot pivot, Graphics.Graphic
var zRotation = Quaternion.RotationX(MathUtil.PiOverTwo); // Yup rotated towards Z
AddModelEntity("Zend", tip, material2, position: CylinderRadius * 4f * Vector3.UnitZ, rotation: zRotation);

lowerLimit = AddModelEntity("LowerLimit", limitLower, limitMaterial, Quaternion.RotationZ(MathUtil.PiOverTwo) * Quaternion.RotationX(MathUtil.PiOverTwo)).Get<ModelComponent>();
upperLimit = AddModelEntity("UpperLimit", limitUpper, limitMaterial, Quaternion.RotationZ(-MathUtil.PiOverTwo) * Quaternion.RotationX(-MathUtil.PiOverTwo)).Get<ModelComponent>();
lowerLimit = AddModelEntity("LowerLimit", limitLower, limitMaterial, Quaternion.RotationZ(-MathUtil.PiOverTwo) * Quaternion.RotationX(-MathUtil.PiOverTwo)).Get<ModelComponent>();
upperLimit = AddModelEntity("UpperLimit", limitUpper, limitMaterial, Quaternion.RotationZ(MathUtil.PiOverTwo) * Quaternion.RotationX(MathUtil.PiOverTwo)).Get<ModelComponent>();

Update(desc);
}
Expand Down Expand Up @@ -523,8 +523,8 @@ public SliderModelWrapper(SliderConstraintDesc desc, Pivot pivot, Graphics.Graph
var zRotation = Quaternion.RotationX(MathUtil.PiOverTwo); // Yup rotated towards Z
AddModelEntity("Zend", tip, material2, position: CylinderRadius * 4f * Vector3.UnitZ, rotation: zRotation);

lowerAngulerLimit = AddModelEntity("LowerAngularLimit", limitLower, limitMaterial, Quaternion.RotationZ(MathUtil.PiOverTwo) * Quaternion.RotationX(MathUtil.PiOverTwo)).Get<ModelComponent>();
upperAngularLimit = AddModelEntity("UpperAngularLimit", limitUpper, limitMaterial, Quaternion.RotationZ(-MathUtil.PiOverTwo) * Quaternion.RotationX(-MathUtil.PiOverTwo)).Get<ModelComponent>();
lowerAngulerLimit = AddModelEntity("LowerAngularLimit", limitLower, limitMaterial, Quaternion.RotationZ(-MathUtil.PiOverTwo) * Quaternion.RotationX(-MathUtil.PiOverTwo)).Get<ModelComponent>();
upperAngularLimit = AddModelEntity("UpperAngularLimit", limitUpper, limitMaterial, Quaternion.RotationZ(MathUtil.PiOverTwo) * Quaternion.RotationX(MathUtil.PiOverTwo)).Get<ModelComponent>();

lowerLinearLimit = AddModelEntity("LowerLinearLimit", sphere, limitMaterial);
upperLinearLimit = AddModelEntity("UpperLinearLimit", sphere, limitMaterial);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public class LimitDesc
/// Negative limit (-Pi, 0). Left handed rotation when thumb points at positive X axis of the constraint.
/// </summary>
/// <userdoc>
/// Negative limit (-Pi, 0), where 0 is at positive Z axis. Left handed rotation when thumb points at positive X axis of the constraint.
/// Negative limit (-Pi, 0), where 0 is at the initial position. Left handed rotation when thumb points at positive X axis of the constraint.
/// </userdoc>
[Display(2)]
[DataMemberRange(-Math.PI, 0, MathUtil.PiOverFour / 9, MathUtil.PiOverFour, 3)]
Expand All @@ -111,7 +111,7 @@ public class LimitDesc
/// Positive limit (0, Pi). Right handed rotation when thumb points at positive X axis of the constraint.
/// </summary>
/// <userdoc>
/// Positive limit (0, Pi), where 0 is at positive Z axis. Right handed rotation when thumb points at positive X axis of the constraint.
/// Positive limit (0, Pi), where 0 is at the initial position. Right handed rotation when thumb points at positive X axis of the constraint.
/// </userdoc>
[Display(3)]
[DataMemberRange(0, Math.PI, MathUtil.PiOverFour / 9, MathUtil.PiOverFour, 3)]
Expand Down

0 comments on commit 699852f

Please sign in to comment.