Sly 2:Transform: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
TheOnlyZac (talk | contribs) m (FIx typos) |
mNo edit summary |
||
Line 5: | Line 5: | ||
}} |
}} |
||
The '''Transform''' component, or '''XFM''' struct, is responsible for the position, rotation, and velocity of an entity. |
The '''Transform''' component, or '''XFM''' struct, is responsible for the position, rotation, and velocity of an entity (or an entity's individual parts). |
||
== Fields == |
== Fields == |
Latest revision as of 01:28, 30 October 2023
Data Structure | |
---|---|
Game | Sly 2: Band of Thieves |
Size | 0x100 bytes |
The Transform component, or XFM struct, is responsible for the position, rotation, and velocity of an entity (or an entity's individual parts).
Fields
The Transform struct has the following fields:
Offset | Size | Type | Name | Notes |
---|---|---|---|---|
0x0 | struct MAT4
|
transformation
|
4x4 matrix | |
0x30 | 16 | struct VECTOR
|
position
| |
0x94 | 4 | int
|
freeze coordinates?
|
Freezes the coords if set to anything but 1 |
0x98 | 4 | xfm state?
| ||
0xB0 | 16 | struct VECTOR
|
velocity
|
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.