/// <summary> /// Gets a bounding volume transformed by an inverted FTransform object. /// </summary> /// <param name="m">The transformation object to perform the inversely transform this box with.</param> /// <returns>The transformed box.</returns> public FBox InverseTransformBy(FTransform m) { FVector[] vertices = new FVector[8] { Min, new FVector(Min.X, Min.Y, Max.Z), new FVector(Min.X, Max.Y, Min.Z), new FVector(Max.X, Min.Y, Min.Z), new FVector(Max.X, Max.Y, Min.Z), new FVector(Max.X, Min.Y, Max.Z), new FVector(Min.X, Max.Y, Max.Z), Max }; FBox newBox = default(FBox); for (int vertexIndex = 0; vertexIndex < vertices.Length; vertexIndex++) { FVector4 projectedVertex = m.InverseTransformPosition(vertices[vertexIndex]); newBox += (FVector)projectedVertex; } return(newBox); }