Пример #1
0
 /// <summary>
 /// Returns this vector with each component snapped to the nearest multiple of `step`.
 /// This can also be used to round to an arbitrary number of decimals.
 /// </summary>
 /// <param name="step">A vector value representing the step size to snap to.</param>
 /// <returns>The snapped vector.</returns>
 public Vector3d Snapped(Vector3d step)
 {
     return(new Vector3d
            (
                Mathd.Snapped(x, step.x),
                Mathd.Snapped(y, step.y),
                Mathd.Snapped(z, step.z)
            ));
 }
Пример #2
0
 public Vector4d Snapped(Vector4d by)
 {
     return(new Vector4d
            (
                Mathd.Snapped(x, by.x),
                Mathd.Snapped(y, by.y),
                Mathd.Snapped(z, by.z),
                Mathd.Snapped(w, by.w)
            ));
 }
Пример #3
0
 /// <summary>
 /// Returns this vector with each component snapped to the nearest multiple of `step`.
 /// This can also be used to round to an arbitrary number of decimals.
 /// </summary>
 /// <param name="step">A vector value representing the step size to snap to.</param>
 /// <returns>The snapped vector.</returns>
 public Vector2d Snapped(Vector2d step)
 {
     return(new Vector2d(Mathd.Snapped(x, step.x), Mathd.Snapped(y, step.y)));
 }