Method CalculateBounds
CalculateBounds<TPoint>(IMap<Vector3, Vector3>, IExplicitShape<TPoint>, Func<TPoint, Vector3>, Func<TPoint, Vector3>)
Calculates the world bounds of an explicit shape.
public static Bounds CalculateBounds<TPoint>(this IMap<Vector3, Vector3> gridToWorld, IExplicitShape<TPoint> shape, Func<TPoint, Vector3> cellSize, Func<TPoint, Vector3> toVector)
Parameters
gridToWorldIMap<Vector3, Vector3>The map that represents the transform from grid point to world point.
shapeIExplicitShape<TPoint>The shape whose bounds to calculate.
cellSizeFunc<TPoint, Vector3>A function that gives the dimensions of a cell at a given point in world space.
toVectorFunc<TPoint, Vector3>A function that can turn a grid point into a Vector3.
Returns
Type Parameters
TPointThe point type of the shape.
Remarks
The bounds are guaranteed to be tight.