Skip to content

Commit b8b629c

Browse files
Adjust import root and offset slot Y positions
1 parent d6e9045 commit b8b629c

4 files changed

Lines changed: 11 additions & 6 deletions

File tree

src/config/MappingConfig.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ export const IMPORT_GROUP_SCALE = 1;
1818

1919
/**
2020
* Default Y-axis offset for the import root group slot.
21-
* Keeps imported content slightly above origin for visibility.
21+
* The import root itself stays on origin; top-level content offset is handled by child slots.
2222
*/
23-
export const IMPORT_GROUP_Y_OFFSET = 0.001;
23+
export const IMPORT_GROUP_Y_OFFSET = 0;
2424

2525
/**
2626
* Tag applied to import root container slots.

src/resonite/SlotBuilder.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ describe('SlotBuilder', () => {
439439
expect.objectContaining({
440440
parentId: 'Root',
441441
name: 'Offset',
442+
position: { x: 0, y: 0.001, z: 0 },
442443
})
443444
);
444445
const offsetCallArgs = mockClient.addSlot.mock.calls[0][0] as { id: string };
@@ -547,6 +548,7 @@ describe('SlotBuilder', () => {
547548
expect(offsetCall?.name).toBe('Offset');
548549
expect(offsetCall?.parentId).toBe('Root');
549550
expect(offsetCall?.position?.x).toBe(-30);
551+
expect(offsetCall?.position?.y).toBe(0.001);
550552
expect(offsetCall?.position?.z).toBe(15);
551553
});
552554

src/resonite/SlotBuilder.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ function isCharacterObject(obj: ResoniteObject): obj is CharacterResoniteObject
5252
return obj.sourceType === 'character';
5353
}
5454

55+
const OFFSET_SLOT_Y_POSITION = 0.001;
56+
5557
const UDONARIUM_OBJECT_TYPES = new Set<ObjectType>([
5658
'character',
5759
'dice-symbol',
@@ -498,12 +500,13 @@ export class SlotBuilder {
498500
private computeOffsetPositionFromLargestTableCenter(objects: ResoniteObject[]): Vector3 {
499501
const largestTableCenter = this.findLargestTableCenter(objects);
500502
if (!largestTableCenter) {
501-
return { x: 0, y: 0, z: 0 };
503+
return { x: 0, y: OFFSET_SLOT_Y_POSITION, z: 0 };
502504
}
503-
// Move all content so the largest table center becomes the local origin.
505+
// Move all content so the largest table center becomes the local origin on X/Z.
506+
// Keep a small positive Y offset to avoid coplanar overlap with origin-aligned content.
504507
return {
505508
x: -largestTableCenter.x,
506-
y: -largestTableCenter.y,
509+
y: OFFSET_SLOT_Y_POSITION,
507510
z: -largestTableCenter.z,
508511
};
509512
}

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
* Auto-generated by scripts/sync-version.cjs.
33
* Do not edit manually.
44
*/
5-
export const APP_VERSION = '1.0.0-beta.4';
5+
export const APP_VERSION = '1.0.0';

0 commit comments

Comments
 (0)