goat3dgfx

changeset 28:0b863938da04

I don't remember
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 01 Mar 2014 22:37:49 +0200
parents be9754def417
children 9d581abd0bfb
files src/scene.cc src/scene.h
diffstat 2 files changed, 13 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- a/src/scene.cc	Thu Feb 27 02:19:16 2014 +0200
     1.2 +++ b/src/scene.cc	Sat Mar 01 22:37:49 2014 +0200
     1.3 @@ -40,6 +40,7 @@
     1.4  		return false;
     1.5  	}
     1.6  
     1.7 +	// load all the meshes
     1.8  	int num_meshes = goat3d_get_mesh_count(goat);
     1.9  	for(int i=0; i<num_meshes; i++) {
    1.10  		goat3d_mesh *gmesh = goat3d_get_mesh(goat, i);
    1.11 @@ -49,6 +50,12 @@
    1.12  		}
    1.13  	}
    1.14  
    1.15 +	// load all the nodes recursively
    1.16 +	int num_nodes = goat3d_get_node_count(goat);
    1.17 +	for(int i=0; i<num_nodes; i++) {
    1.18 +		goat3d_node *gnode = goat3d_get_node(goat, i);
    1.19 +	}
    1.20 +
    1.21  	goat3d_free(goat);
    1.22  	return true;
    1.23  }
    1.24 @@ -64,6 +71,7 @@
    1.25  		objects[i]->draw(msec);
    1.26  	}
    1.27  
    1.28 +	// if there are no objects in the scene, just draw the meshes instead
    1.29  	if(objects.empty()) {
    1.30  		for(size_t i=0; i<meshes.size(); i++) {
    1.31  			meshes[i]->draw();
     2.1 --- a/src/scene.h	Thu Feb 27 02:19:16 2014 +0200
     2.2 +++ b/src/scene.h	Sat Mar 01 22:37:49 2014 +0200
     2.3 @@ -12,6 +12,11 @@
     2.4  	std::vector<Object*> objects;
     2.5  	std::vector<Mesh*> meshes;
     2.6  	std::vector<Curve*> curves;
     2.7 +	std::vector<Light*> lights;
     2.8 +	std::vector<Camera*> cameras;
     2.9 +
    2.10 +	// nodes can be objects, lights, cameras, or just dummy nodes
    2.11 +	std::vector<XFormNode*> nodes;
    2.12  
    2.13  	~Scene();
    2.14  	void destroy();