This is an old revision of the document!


Internal Model Definition

Gorilla3D holds model, animation and material data inside of an internal structure for better instancing, abstraction and management.

The so-called DefTypes can be stored and loaded to/from *.G3D file format.

Structure

Take a look at the following schematic structure of a model definition.

-TModelDef
        // holds a list of TMeshDef instances
 	-List::Meshes
 		-TMeshDef
                        // a reference to the owner model
 			-@Model::TModelDef
 		-/TMeshDef
 	-/List::Meshes

 	// holds a list of THumanoidDef instances
 	-List::Humanoids
 		-THumanoidDef
                        // a reference to the owner model
 			-@Model::TModelDef
 			// holds a list of TControllerDef references
 			-@List::Controllers

 			// represents a tree of TJointDef nodes
 			-Root::TJointDef
 				-TJointDef
 					-TJointDef
 						-TJointDef
 						-TJointDef
 					-/TJointDef
 				-/TJointDef
 			-/Root::TJointDef
 		-/THumanoidDef
 		-THumanoidDef
 			[...]
 		-/THumanoidDef
 	-/List::Humanoids

 	// holds a list of TControllerDef instances
 	-List::Controllers
 		-TControllerDef
                        // a reference to the mesh, the controller handles
 			-@Mesh::TMeshDef

 			// is a sub component of TSkinDef
 			-Skin::TSkinDef
 				-TSkinDef
                                        // the owner controller of the skin definition
 					-@Controller::TControllerDef

 					// holds a list of TJointRefDef instances - these
 					// are referenced objects to TJointDef instances
 					-List::LinkedJoint
 						-TJointRefDef
 						-TJointRefDef
 						-TJointRefDef
 						-TJointRefDef
 						-TJointRefDef
 						[...]
 					-/List::LinkedJoints

 					// contains the root joint of the skeleton
 					-@Skeleton::TJointRefDef
 				-/TSkinDef
 			-/Skin::TSkinDef
 		-/TControllerDef
 		-TControllerDef
 			[...]
 		-/TControllerDef
 	-/List::Controllers

 	// holds a list of TAnimationDef instances
 	-List::Animations
 		-TAnimationDef
 			-@Model::TModelDef

 			// holds a list of TAnimationStageDef instances
 			-List::Stages
 				-TAnimationStageDef
 					-List::Interpolators
 						-TInterpolatorDef
 						-TInterpolatorDef
 						-TInterpolatorDef
 						[...]
 					-/List::Interpolators
 				-/TAnimationStageDef
 				-TAnimationStageDef
 					[...]
 				-/TAnimationStageDef
 			-/List::Stages
 		-/TAnimationDef
 		-TAnimationDef
 			[...]
 		-/TAnimationDef
 	-/List::Animations
 -/TModelDef

G3D File Format