rmp::behavior::GridSnap
struct GridSnap
Squares the position with a grid, AFTER everything that moves it. That is what keeps a puzzle piece from sitting on half a pixel when it rotates or falls, and it is why this declares _late_update and not _update.
Added to an object with add<rmp::behavior::GridSnap>(); the framework calls its _late_update with the object it is on.
Fields
| Field | Type | Default | What it is |
|---|---|---|---|
cell | Vector2 | { 32, 32 } | The grid's spacing per axis; 0 = that axis is left alone |
offset | Vector2 | {} | Where the grid's origin is |