Sly 2:Transform

From SlyMods
Jump to navigation Jump to search
Data Structure
GameSly 2: Band of Thieves
Size0x100 bytes

The Transform component, or XFM struct, is responsible for the position, rotation, and velocity of an entity (or an entity's individual parts).


The Transform struct has the following fields:

Offset Size Type Name Notes
struct MAT4
transformation 4x4 matrix
0x30 16
struct VECTOR
0x94 4
freeze coordinates? Freezes the coords if set to anything but 1
0x98 4
xfm state?
0xB0 16
struct VECTOR

Transformation matrix

The the rotation, scale, translation, and projection of the entity are encoded in a 4x4 matrix. The rotation and scale are embedded in the first 3 rows, and the 4th row controls the translation and projection. For the purposes of memory editing, you can effectively treat it as four VECTORs at offsets 0x0, 0x10, 0x20, and 0x30.