Exemple #1
0
        private Vector3 RotateAround(Quaternion startRotation, Quaternion rotation, Vector3 point, Vector3 pivot)
        {
            // In order to add two quaternion rotations correctly you multiply them.
            // To subtract you need to multiply by the inverse.
            Quaternion rotationDelta = (rotation * Quaternion.Inverse(startRotation));

            return(Snap.RotateAroundPivotWorld(mesh.transform, point, pivot, rotationDelta));
        }