Some of my geometry is generated by code (a terrain mesh from a heightmap), not loaded from models. At the moment I dont think there is a way for me to put this geometry into a node.
I was thinking there could be another function simmilar to
setNodeParam that could take a pointer, this way I could pass in a list of vertecies.
E.g. I want to do something like this:
Code:
bool setNodeParamArray( unsigned int id, SceneNodeParam param, void* value, int size );
....
//This class loads an image and generates geometry from the height values:
CHeightmap terrain( 'heightmap.jpg' );
float* pVerts = terrain.getVertecies();
int numVerts = terrain.getNumVertecies();
unsigned int* pIndicies= terrain.getIndicies();
int numIndicies = terrain.getNumIndicies();
//Send the geometry to the engine:
setNodeStruct( node_id, SceneNodeParams::Vertecies, (void*)pVerts, numVerts );
setNodeStruct( node_id, SceneNodeParams::Indicies, (void*)pIndicies, numIndicies );
What do you think of something like this? I think its a good idea to allow the program that uses the engine to upload its own vertex data.