( entity: EntityData, ctx: InstantiateContext, warnings: string[], )
| 196 | } |
| 197 | |
| 198 | function spawnModelEntity( |
| 199 | entity: EntityData, |
| 200 | ctx: InstantiateContext, |
| 201 | warnings: string[], |
| 202 | ): SceneNodeHandle { |
| 203 | const modelRef = entity.modelRef as string; |
| 204 | const modelHandle = ctx.getModelHandle(modelRef); |
| 205 | if (modelHandle === 0) { |
| 206 | warnings.push('entity ' + entity.id + ' references unknown model "' + modelRef + '" — skipped'); |
| 207 | return 0; |
| 208 | } |
| 209 | |
| 210 | const node = createSceneNode(); |
| 211 | attachModelToNode(node, modelHandle, 0); |
| 212 | setSceneNodeTransform(node, trsToMat4(entity.transform)); |
| 213 | |
| 214 | if (entity.tint !== null) { |
| 215 | applyTint(node, entity.tint); |
| 216 | } |
| 217 | |
| 218 | setSceneNodeVisible(node, true); |
| 219 | return node; |
| 220 | } |
| 221 | |
| 222 | function spawnPrefabEntity( |
| 223 | entity: EntityData, |
no test coverage detected