private static void ConstructScene(this GltfObject gltfObject, GltfScene gltfScene) { for (int i = 0; i < gltfScene.nodes.Length; i++) { ConstructNode(gltfObject, gltfObject.nodes[gltfScene.nodes[i]], gltfScene.nodes[i], gltfObject.GameObjectReference.transform); } }
private static async Task ConstructSceneAsync(this GltfObject gltfObject, GltfScene gltfScene) { for (int i = 0; i < gltfScene.nodes.Length; i++) { await ConstructNodeAsync(gltfObject, gltfObject.nodes[gltfScene.nodes[i]], gltfScene.nodes[i], gltfObject.GameObjectReference.transform); } }
private static async Task ConstructSceneAsync(this GltfObject gltfObject, GltfScene gltfScene, GameObject root) { for (int i = 0; i < gltfScene.nodes.Length; i++) { // TODO Uncomment this out after implementing root object transform normalization. await ConstructNodeAsync(gltfObject, gltfObject.nodes[gltfScene.nodes[i]], gltfScene.nodes[i], root.transform /*, gltfObject.scenes.Length == 1*/); } }
private static async Task ConstructSceneAsync(this GltfObject gltfObject, GltfScene gltfScene, GameObject root) { for (int i = 0; i < gltfScene.nodes.Length; i++) { // Note: glTF objects are currently imported with their original scale from the glTF scene, which may apply an unexpected transform // to the root node. If this behavior needs to be changed, functionality should be added below to ConstructNodeAsync await ConstructNodeAsync(gltfObject, gltfObject.nodes[gltfScene.nodes[i]], gltfScene.nodes[i], root.transform); } }
public Scene Read() { GltfScene rootScene = this._root.Scenes[this._root.Scene.Value]; Scene scene = new Scene(rootScene.Name); foreach (int nodeIndex in rootScene.Nodes) { Node n = readNode(nodeIndex); if (n != null) { scene.Nodes.Add(n); } } return(scene); }