Skip to content

Commit d6e9045

Browse files
Adjust table surface Y offset and fix ja doc encoding
1 parent 2878dd9 commit d6e9045

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

docs/object-conversion/table.ja.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Table 変換仕様
1+
# Table 変換仕様
22

33
[English](table.md)
44

@@ -48,7 +48,7 @@ Udonarium の `game-table` オブジェクトを Resonite の slot/component へ
4848

4949
天板子 slot(`-surface`):
5050

51-
- `position = (width / 2, 0, -height / 2)`
51+
- `position = (width / 2, -0.0001, -height / 2)`
5252
- `rotation = (90, 0, 0)`
5353

5454
これにより、table コンテナの座標安定性を保ちつつ、天板メッシュを table 平面に一致させます。
@@ -93,7 +93,7 @@ table ルート slot:
9393

9494
## 8. 確認ポイント
9595

96-
1. `-surface``(width/2, 0, -height/2)` に配置される
96+
1. `-surface``(width/2, -0.0001, -height/2)` に配置される
9797
2. table ルート回転が `(0,0,0)` に固定される
9898
3. `-surface``QuadMesh``BoxCollider` が付与される
9999
4. table 配下オブジェクトが `-surface` の後続子として変換される

docs/object-conversion/table.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Root slot:
4848

4949
Surface child slot (`-surface`):
5050

51-
- `position = (width / 2, 0, -height / 2)`
51+
- `position = (width / 2, -0.0001, -height / 2)`
5252
- `rotation = (90, 0, 0)`
5353

5454
This keeps the table container transform stable while aligning the visual mesh to table coordinates.
@@ -93,7 +93,7 @@ This ensures only selected table(s) are visible when multiple tables are present
9393

9494
## 8. Validation Points
9595

96-
1. surface slot is created with center offset `(width/2, 0, -height/2)`
96+
1. surface slot is created with center offset `(width/2, -0.0001, -height/2)`
9797
2. table root rotation remains `(0,0,0)`
9898
3. surface has `QuadMesh` + `BoxCollider`
9999
4. child objects under the source table are converted as root children after `-surface`

src/converter/objectConverters/tableConverter.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ describe('convertTable', () => {
7171
expect(result.children).toHaveLength(2);
7272

7373
const visual = result.children[0];
74-
expect(visual.position).toEqual({ x: 10, y: 0, z: -5 });
74+
expect(visual.position).toEqual({ x: 10, y: -0.0001, z: -5 });
7575
expect(visual.rotation).toEqual({ x: 90, y: 0, z: 0 });
7676
// QuadMesh + MeshRenderer + Material + StaticTexture2D + BoxCollider
7777
const collider = visual.components.find((c) => c.type === COMPONENT_TYPES.BOX_COLLIDER);

src/converter/objectConverters/tableConverter.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { ResoniteObject, Vector3 } from '../../domain/ResoniteObject';
33
import { ResoniteObjectBuilder } from '../ResoniteObjectBuilder';
44
import { ImageAssetContext } from '../imageAssetContext';
55

6+
const TABLE_SURFACE_Y_OFFSET = -0.0001;
7+
68
export function convertTable(
79
udonObj: GameTable,
810
basePosition: Vector3,
@@ -25,7 +27,7 @@ export function convertTable(
2527
id: surfaceId,
2628
name: `${udonObj.name}-surface`,
2729
})
28-
.setPosition({ x: udonObj.width / 2, y: 0, z: -udonObj.height / 2 })
30+
.setPosition({ x: udonObj.width / 2, y: TABLE_SURFACE_Y_OFFSET, z: -udonObj.height / 2 })
2931
.setRotation({ x: 90, y: 0, z: 0 })
3032
.addQuadMesh({
3133
...(textureIdentifier != null ? { textureIdentifier } : {}),

0 commit comments

Comments
 (0)