On this page
  1. Fields

rmp::behavior::GridSnap

behavior #include <rmp/behavior.h> include/rmp/behavior.h:337
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

FieldTypeDefaultWhat it is
cellVector2{ 32, 32 }

The grid's spacing per axis; 0 = that axis is left alone

offsetVector2{}

Where the grid's origin is