Table of Contents

Method CalculatePointGrid

Namespace
Pinwheel.Vista
Assembly
Pinwheel.Vista.Runtime.dll

CalculatePointGrid(Vector4, Vector2, out Vector2)

Computes the grid layout for a uniform set of points covering the given world bounds at the given spacing.

public static Vector2Int CalculatePointGrid(Vector4 worldBounds, Vector2 spacing, out Vector2 lowerLeftPoint)

Parameters

worldBounds Vector4

The world bounds of the biome as x, y origin and z, w size.

spacing Vector2

The distance between adjacent points in world meters along each axis.

lowerLeftPoint Vector2

Receives the world position of the lower left grid point, snapped to the spacing.

Returns

Vector2Int

The number of grid points along the x and y axes, each rounded up to a multiple of eight.

Remarks

This is the pure sizing step shared by the Points node and any node that needs to allocate a matching position buffer before dispatching GeneratePoints(ComputeBuffer, Vector4, Vector2, Vector2, Vector2Int). The instance count is the product of the two returned axes.