Exemple #1
0
        internal void Rotate(Quaternion delta, AxisPivot pivot)
        {
            _rotation = delta * Rotation;
            Vector3 rotatedMin = MathHelper.RotateAroundPivot(Min, pivot.Pivot, delta);
            Vector3 rotatedMax = MathHelper.RotateAroundPivot(Max, pivot.Pivot, delta);

            Min = new Vector3(
                Mathf.Min(rotatedMin.x, rotatedMax.x),
                Mathf.Min(rotatedMin.y, rotatedMax.y),
                Mathf.Min(rotatedMin.z, rotatedMax.z));

            Max = new Vector3(
                Mathf.Max(rotatedMin.x, rotatedMax.x),
                Mathf.Max(rotatedMin.y, rotatedMax.y),
                Mathf.Max(rotatedMin.z, rotatedMax.z));
        }
 public void Rotate(AxisConstraint constraint, AxisPivot pivot, int clockwiseTurns)
 {
     Quaternion delta = constraint.Rotation(clockwiseTurns);
     _blockBounds.Rotate(delta, pivot);
 }