ecs: std/transform 3D, Transform3, GlobalTransform3 and 3D propagation (step 3b of #89) #787
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language#787
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?
Context
Step 3 of 3 of #89 (ECS slice 1), second sub-step. The specification is ECS.md section 7 ("Hierarchy"), section 11 (
std/transform) and section 15 q7 (GlobalTransform3is its own component). Step 3a (#779, PR #780) has landed:std/transformexists onmainwithTransform2,GlobalTransform2andpropagate(std/transform/src/transform2.trb,global.trb,propagate.trb);std/linearhasVector3,Quaternion,Matrix3,Matrix4. This issue is 3b, the 3D half, the same shape as 3a withQuaternionandMatrix4; follow 3a's decisions and the form it proved.Goal
Add
Transform3andGlobalTransform3as separate components tostd/transform, with their arithmetic and the 3D propagation overdepthOrder, generic over the stores it reads and writes, overFloatandFixed.Depends on
#779 (merged),
std/ecs(Column,Store,Parent,depthOrder),std/linearonmain. No seed impact: no syntax, no native, no driver flag, no std name the compiler looks up by string (new items in an existing package).Requirements
std/transformshall providepublic type Transform3<Scalar: Real = Float>withtranslation: Vector3<Scalar>,rotation: Quaternion<Scalar>,scale: Vector3<Scalar>,Equals, Show, andstatic identity.Transform3shall providecomposed(with: Self): Self,inverse(): Self?(Nonewhen a scale component is zero),interpolated(toward: Self, by: Scalar): Self(translation and scale linear, rotation by the shortest path of the quaternion, asQuaternioninstd/linearoffers it) andtoMatrix4(): Matrix4<Scalar>(affine, composed from the rotation matrix, the scale and the translation).composedshall agree withtoMatrix4multiplication for uniform parent scale and is documented as exact only there, as in 3a.public type GlobalTransform3<Scalar: Real = Float>shall hold the world-spaceMatrix4<Scalar>(matrix), withEquals, Show,identity,transformedPoint(point)andtransformedDirection(direction)delegating to the matrix.propagate(the exact signature and name are the implementer's, consistent with 3a): each entity with aTransform3indepthOrdergets the parent's global matrix times its owntoMatrix4(); an entity withoutParent, or whose parent has no global, uses its own matrix.FloatandFixed, bounded byRealasstd/linearis.# Examplesblock; the package imports nothing butstd/core,std/number,std/linear,std/ecs.Decisions (by the loop)
GlobalTransform3holds aMatrix4, not a decomposed transform, for the same shear reason as in 3a (see the decisions of #779);Transform3stays decomposed for authoring and interpolation.Acceptance criteria
Transform3,GlobalTransform3and the 3D propagation exist as above;torb check std/transformandtorb format --checkare clean;tools/check-commits.shclean.std/transform/tests/: identity neutral forcomposedon both sides;inversecomposed with the transform gives identity within a tolerance,Nonefor a zero scale;interpolatedat 0, 1 and 0.5 (rotation takes the short way);toMatrix4of translation-only, rotation-only and scale-only equals the expected matrix.Parenthas global equal to its own matrix; the same chain overFixedequals the hand-computed values.tests/conformance/transform-propagate-3d.trb(astransform-propagatefor 2D) steps a small 3D hierarchy through aSchedulefor several frames, tier B runs it in the VM and natively with.expectedbyte for byte; the.allocationsbudget is taken from the first forge CI run; a leak run is clean.docs/standard-library/transform.mdgains the 3D part,skills/regenerated (--checkis a tier A gate); ECS.md notesstd/transform3D landed with #89 and this issue.Seed impact
None.
Size and model
One PR, two Conventional Commits (no
styletype):feat(std/transform): Transform3, GlobalTransform3 and 3D propagationanddocs(std/transform): the 3D part of the standard library page, skills and the design record. Implementer: sonnet, medium (std/package, no compiler change).Part of #89 (
Refs #89, notCloses).std/ecswith oneStoreper group type, andstd/transform(ECS slice 1) #89std/ecswith oneStoreper group type, andstd/transform(ECS slice 1) #89[loop:torbscript] refine: filed just in time as step 3b of #89 after 3a (#779, PR #780) landed; requirements R1-R6 and criteria follow the 2D form that landed, decided by the loop (GlobalTransform3 holds a Matrix4, same shear reason as 3a), no seed impact, no owner question. Label ready. next: implement
[loop:torbscript] claim implement by session:loop-torbscript-20261114-1626 until 2026-11-14T21:26:00Z
[loop:torbscript] implement: opened #788 (2 commits: feat Transform3/GlobalTransform3/propagate3 with tests and conformance program, docs for page, skills and ECS.md). Verified: commit format only. Unverified until CI: all tests, format, doc checks, hand-computed .expected golden, native leg, skills copy (hand-edited, no torb binary), .allocations omitted as in 2D (budget from first CI run). next: waiting (CI on the PR, then review)
[loop:torbscript] release implement by session:loop-torbscript-20261114-1626
std/ecswith oneStoreper group type, andstd/transform(ECS slice 1) #89[loop:torbscript] claim implement by session:loop-torbscript-20261114-1832 until 2026-11-14T21:32:00Z
[loop:torbscript] implement: fixed CI of PR #788 (tier A failed two gates:
format --checkon 3 files, the Transform3 command calls not in the command-call canon, anddocs check, the std/transform summary at 286 of at most 240 characters; changed: calls rewritten to the canon in transform3.trb, transform3.test.trb and transform-propagate-3d.trb, summary shortened in docs/standard-library/transform.md and in its 5 generated copies in the index pages and skills; a pushedstylefix commit was replaced byfix/docscommits because check-commits.sh refusesstyle, branch force-pushed with lease), new heade4718c95; CI re-runs.next: waiting (CI on PR #788, then argus review)
[loop:torbscript] release implement by session:loop-torbscript-20261114-1832