go.transform: position, localPosition, localMatrix, worldMatrix (#84) #96
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crowmaki/cinnabar!96
Loading…
Reference in a new issue
No description provided.
Delete branch "luau-transform-84"
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?
Closes #84. Part of #75.
What
go.transformis a Transform userdata bound to the same GameObject Handle, cached per Handle in a weak table like the GameObject and Component userdata.positionandlocalPositionread as{x, y, z}tables and write from either{1, 2, 3}or{x = 1, y = 2, z = 3}. A write replaces only the translation column and goes throughgameobject_set_world_transformorgameobject_set_local_transform.worldMatrixandlocalMatrixread and write sixteen numbers in Mat4 column-major order.go.transformitself.run_awaketest helper moved intotests/luau/harness.odin.One reading to confirm
The issue says positions "read and write as
{x, y, z}tables". Reads answer keyed tables, so writes accept the keyed form too:a.transform.position = b.transform.positionworks, and the "missing component" acceptance criterion is what a keyed table with nozproduces.Tests
tests/luau/transform_test.odincovers every acceptance criterion from Luau source strings, checked againstgameobject_local_transformandgameobject_world_transform.just checkandjust testpass (449 tests).