Loading a 3D scene

The Mesh component is useful when you want to import a single object's shape from an external file. However, sometimes you want to import multiple objects from a single file. For example, you could prepare some decorations surrounding your game action and then import them all at once. This is where the SceneLoader component becomes useful.

It can be used similar to the Mesh component:

Entity {    components: [        SceneLoader {            source: "path/to/scene/file"        }    ]}

However, instead of providing shape for its entity, SceneLoader creates a whole tree of Entity objects that become children of the SceneLoader's entity. Each new entity will be provided with a mesh, a material, and a transform according to the file data. SceneLoader uses ...

Get Game Programming using Qt 5 Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.