Here are the preliminary fields of the data structure that will be used to store LDraw models in engine.
Code:
and I'd like to make this a subclass of TSShape to make it really easy to replace existing models with LDraw models, and that should take care of holding the node representations (though I'm not yet sure how to handle the possibility of nodes nested within subfiles.....)
There will also be several global variables controlling stud rendering options and possibly other primitive/part-interceptions, and client connections will have "a selection depth" variable to control how recursively deep to select submodels within a model.
Finally, we'll have some sort of part cache, maintained separately from the models, to prevent commonly used pieces from having to be reparsed over and over.
Code:
//Random info
filename (string)
author (string)
bfcCertified (boolean)
parent (ptr, possibly null, to another ldraw object)
//Cached vertex buffers for this file and all subfiles
lineRenderCache (F32 array)
triRenderCache (F32 array)
quadRenderCache (F32 array)
//not quite sure how this will be implemented, but it will store the vertex buffer responsible for drawing the stud textures in place of stud primitives
studRenderCache (F32 array)
lineTransforms // Point3F array of all line commands stored in *this* file
triTransforms // Point3F array of all tri commands stored in *this* file
quadTransforms // Point3F array of all quad commands stored in *this* file
subFileReferences //string array referencing the names of any .mpd/.ldr/.dat subfiles
subFileTransforms //MatrixF array controlling the transform of the equivalently indexed subfile.
and I'd like to make this a subclass of TSShape to make it really easy to replace existing models with LDraw models, and that should take care of holding the node representations (though I'm not yet sure how to handle the possibility of nodes nested within subfiles.....)
There will also be several global variables controlling stud rendering options and possibly other primitive/part-interceptions, and client connections will have "a selection depth" variable to control how recursively deep to select submodels within a model.
Finally, we'll have some sort of part cache, maintained separately from the models, to prevent commonly used pieces from having to be reparsed over and over.