Table of Contents

Method CalculateBounds

Namespace
Gamelogic.Grids2
Assembly
Gamelogic.Grids2.dll

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

gridToWorld IMap<Vector3, Vector3>

The map that represents the transform from grid point to world point.

shape IExplicitShape<TPoint>

The shape whose bounds to calculate.

cellSize Func<TPoint, Vector3>

A function that gives the dimensions of a cell at a given point in world space.

toVector Func<TPoint, Vector3>

A function that can turn a grid point into a Vector3.

Returns

Bounds

Type Parameters

TPoint

The point type of the shape.

Remarks

The bounds are guaranteed to be tight.