go.transform: position, localPosition, localMatrix, worldMatrix (#75) #84
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crowmaki/cinnabar#84
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
#75
What to build
Moving something from a Script is one line.
go.transformis a small userdata bound to the same GameObject Handle.positionandlocalPositionread and write as{x, y, z}tables and are the translation column of the World Transform and the local transform; writing them replaces only that column and goes throughgameobject_set_world_transformorgameobject_set_local_transform.worldMatrixandlocalMatrixread and write as the full sixteen numbers. Rotation and scale helpers are out of scope; the matrix is the escape hatch.Acceptance criteria
go.transform.localPosition = {1, 2, 3}is visible viagameobject_local_transform, and only the translation column changedgo.transform.positionunder a parented GameObject is visible viagameobject_world_transformand the local transform is recomputed accordinglypositionandlocalPositionreturns tables withx,y,zmatching OdinworldMatrixandlocalMatrixround-trip sixteen numbers in Mat4 column-major ordergo.transformon a dead GameObject raisesBlocked by