Add a Get world position node with just the world x and y
Get position hands out four numbers, local and world. A graph that only needs where an object is in the world had to pick the two world ports out of four and leave the local ones dangling. - Get world position has one object input and the outputs x and y. It reads the same worldPositionOf as Get position, so a child adds every parent's position in. - Without an object it reports the origin, like Get position. Tests: - Node catalog: a top-level object, a child under a parent and no object (3 cases). - node-catalog and hierarchy: 2 files, 378 tests, all green. The full gate was not run for this commit, CI covers it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ed7872c893
commit
526b1da7f4
3 files changed
+34
No files matched your search
@@ -752,6 +752,19 @@ const CASES: Record<string, Case[]> = {
|
||||
outputs: { x: 0, y: 0, worldX: 0, worldY: 0 },
|
||||
},
|
||||
],
|
||||
GetWorldPosition: [
|
||||
{
|
||||
name: 'a top-level object is at its own position',
|
||||
inputs: { object: at('A', 10, 20) },
|
||||
outputs: { x: 10, y: 20 },
|
||||
},
|
||||
{
|
||||
name: 'a child is at the summed position of its parents',
|
||||
inputs: { object: { ...at('child', 10, 20), parent: at('parent', 100, 200) } },
|
||||
outputs: { x: 110, y: 220 },
|
||||
},
|
||||
{ name: 'no object is the origin', inputs: { object: null }, outputs: { x: 0, y: 0 } },
|
||||
],
|
||||
GetZ: [
|
||||
{
|
||||
name: 'a child reports its own z and the z summed up with its parents',
|
||||
|
||||
Reference in new issue
Block a user