Updated transform Gizmos #340

This commit is contained in:
W2.Wizard
2023-02-16 15:23:18 +01:00
committed by Wojtek Figat
parent 969053a240
commit f8aa1cd5f8
14 changed files with 224 additions and 142 deletions

View File

@@ -419,6 +419,31 @@ namespace FlaxEngine
return box;
}
/// <summary>
/// Constructs a <see cref="BoundingBox" /> that is as large as the box and point.
/// </summary>
/// <param name="value1">The box to merge.</param>
/// <param name="value2">The point to merge.</param>
/// <param name="result">When the method completes, contains the newly constructed bounding box.</param>
public static void Merge(ref BoundingBox value1, ref Vector3 value2, out BoundingBox result)
{
Vector3.Min(ref value1.Minimum, ref value2, out result.Minimum);
Vector3.Max(ref value1.Maximum, ref value2, out result.Maximum);
}
/// <summary>
/// Constructs a <see cref="BoundingBox" /> that is as large as the box and point.
/// </summary>
/// <param name="value2">The point to merge.</param>
/// <returns>The newly constructed bounding box.</returns>
public BoundingBox Merge(Vector3 value2)
{
BoundingBox result;
Vector3.Min(ref Minimum, ref value2, out result.Minimum);
Vector3.Max(ref Maximum, ref value2, out result.Maximum);
return result;
}
/// <summary>
/// Transforms bounding box using the given transformation matrix.
/// </summary>
@@ -498,6 +523,19 @@ namespace FlaxEngine
result = new BoundingBox(min, max);
}
/// <summary>
/// Creates the bounding box that is offseted by the given vector. Adds the offset value to minimum and maximum points.
/// </summary>
/// <param name="offset">The bounds offset.</param>
/// <returns>The offsetted bounds.</returns>
public BoundingBox MakeOffsetted(Vector3 offset)
{
BoundingBox result;
Vector3.Add(ref Minimum, ref offset, out result.Minimum);
Vector3.Add(ref Maximum, ref offset, out result.Maximum);
return result;
}
/// <summary>
/// Creates the bounding box that is offseted by the given vector. Adds the offset value to minimum and maximum points.
/// </summary>