7within this specification, int is assumed to be 32bit, float is assumed to be 32bit, char is assumed to be 8bit, text is assumed to be an array of chars with NULL termination
8all values are big endian (also known as network byte ordering), NOT x86 little endian
9general notes:
10a pose is a 3x4 matrix (rotation matrix, and translate vector)
11parent bones must always be lower in number than their children, models will be rejected if this is not obeyed (can be fixed by modelling utilities)
12utility notes:
13if a hard edge is desired (faceted lighting, or a jump to another set of skin coordinates), vertices must be duplicated
14ability to visually edit groupids of triangles is highly recommended
15bones should be markable as 'attach' somehow (up to the utility) and thus protected from culling of unused resources
16frame 0 is always the base pose (the one the skeleton was built for)
17game notes:
18the loader should be very thorough about error checking, all vertex and bone indices should be validated, etc
19the gamecode can look up bone numbers by name using a builtin function, for use in attachment situations (the client should have the same model as the host of the gamecode in question - that is to say if the server gamecode is setting the bone number, the client and server must have vaguely compatible models so the client understands, and if the client gamecode is setting the bone number, the server could have a completely different model with no harm done)
20the triangle groupid values are up to the gamecode, it is recommended that gamecode process this in an object-oriented fashion (I.E. bullet hits entity, call that entity's function for getting properties of that groupid)
21frame 0 should be usable, not skipped
22speed optimizations for the saver to do:
23remove all unused data (unused bones, vertices, etc, be sure to check if bones are used for attachments however)
24sort triangles into strips
25sort vertices according to first use in a triangle (caching benefits) after sorting triangles
26speed optimizations for the loader to do:
27if the model only has one frame, process it at load time to create a simple static vertex mesh to render (this is a hassle, but it is rewarding to optimize all such models)
28rendering process:
291*. one or two poses are looked up by number
302*. boneposes (matrices) are interpolated, building bone matrix array
313. bones are parsed sequentially, each bone's matrix is transformed by it's parent bone (which can be -1; the model to world matrix)
324. meshs are parsed sequentially, as follows:
33 1. vertices are parsed sequentially and may be influenced by more than one bone (the results of the 3x4 matrix transform will be added together - weighting is already built into these)
34 2. shader is looked up and called, passing vertex buffer (temporary) and triangle indices (which are stored in the mesh)
355. rendering is complete
36* - these stages can be replaced with completely dynamic animation instead of pose animations.