@series-inc/rundot-3d-engine 0.6.14 → 0.6.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/SKILL.md CHANGED
@@ -172,6 +172,51 @@ renderer.setMaterial(customMaterial)
172
172
 
173
173
  **Static meshes** (`isStatic: true`) skip per-frame matrix updates — use for non-moving objects.
174
174
 
175
+ #### Sub-Meshes & Named Children
176
+
177
+ Meshes with named child groups (from the editor's hierarchy) are automatically promoted to GameObjects.
178
+ You can access them by name to add components, move them, etc.
179
+
180
+ ```typescript
181
+ const renderer = new MeshRenderer("vehicle_mesh")
182
+ const meshObj = new GameObject("VehicleMesh")
183
+ meshObj.addComponent(renderer)
184
+ parent.add(meshObj)
185
+
186
+ // Wait for mesh to load, then access named children
187
+ renderer.onLoaded(() => {
188
+ // Get a single child by name
189
+ const wheel = renderer.getMeshChild("Wheel_FL")
190
+ if (wheel) {
191
+ wheel.addComponent(new WheelSpinner())
192
+ wheel.position.y -= 0.1 // offset the wheel
193
+ }
194
+
195
+ // Get all named children
196
+ const children = renderer.getMeshChildren()
197
+ if (children) {
198
+ for (const [name, childGO] of children) {
199
+ console.log(`Child: ${name}`, childGO.position)
200
+ }
201
+ }
202
+ })
203
+ ```
204
+
205
+ **Sub-mesh mode** (from prefab): When a `stow_mesh` component has a `subMesh` field, MeshRenderer
206
+ loads only that named group's geometry instead of the full mesh. This is how the editor's expanded
207
+ sub-mesh hierarchy works at runtime — each child node gets its own MeshRenderer rendering only its part.
208
+
209
+ ```json
210
+ {
211
+ "type": "stow_mesh",
212
+ "mesh": { "pack": "main", "assetId": "vehicle" },
213
+ "subMesh": "Wheel_FL"
214
+ }
215
+ ```
216
+
217
+ Each sub-mesh node is a real GameObject in the prefab tree, so you can attach any component
218
+ (physics, scripts, etc.) to individual parts of a mesh.
219
+
175
220
  ### SkeletalRenderer — Animated Characters
176
221
 
177
222
  ```typescript