Skip to main content

Textured Mesh

Textured meshes can also be loaded from an OBJ and MTL file.

This example shows how to load a textured mesh and add it to the world.

const pack = new TResourcePack(engine, {
texturedMeshes: [trainLocoMesh],
textures: [trainTexture],
});
await pack.load();

this.world.createEntity([
new TTexturedMeshComponent({ source: 'path', path: trainLocoMesh }),
new TTextureComponent(engine.resources.get<TTexture>(trainTexture)!),
]);