Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

MS3D.h

00001 
00002 #ifndef __MS3D_H
00003 #define __MS3D_H
00004 
00005 /* 
00006     MS3D STRUCTURES 
00007 */
00008 
00009 // byte-align structures
00010 #ifdef _MSC_VER
00011 #       pragma pack( push, packing )
00012 #       pragma pack( 1 )
00013 #       define PACK_STRUCT
00014 #elif defined( __GNUC__ )
00015 #       define PACK_STRUCT      __attribute__((packed))
00016 #else
00017 #       error you must byte-align these structures with the appropriate compiler directives
00018 #endif
00019 
00020 typedef unsigned char byte;
00021 typedef unsigned short word;
00022 
00023 // File header
00024 struct MS3DHeader
00025 {
00026     char m_ID[10];
00027     int m_version;
00028 } PACK_STRUCT;
00029 
00030 // Vertex information
00031 struct MS3DVertex
00032 {
00033     byte m_flags;
00034     float m_vertex[3];
00035     char m_boneID;
00036     byte m_refCount;
00037 } PACK_STRUCT;
00038 
00039 // Triangle information
00040 struct MS3DTriangle
00041 {
00042     word m_flags;
00043     word m_vertexIndices[3];
00044     float m_vertexNormals[3][3];
00045     float m_s[3], m_t[3];
00046     byte m_smoothingGroup;
00047     byte m_groupIndex;
00048 } PACK_STRUCT;
00049 
00050 // Material information
00051 struct MS3DMaterial
00052 {
00053     char m_name[32];
00054     float m_ambient[4];
00055     float m_diffuse[4];
00056     float m_specular[4];
00057     float m_emissive[4];
00058     float m_shininess;  // 0.0f - 128.0f
00059     float m_transparency;       // 0.0f - 1.0f
00060     byte m_mode;        // 0, 1, 2 is unused now
00061     char m_texture[128];
00062     char m_alphamap[128];
00063 } PACK_STRUCT;
00064 
00065 //      Joint information
00066 struct MS3DJoint
00067 {
00068     byte m_flags;
00069     char m_name[32];
00070     char m_parentName[32];
00071     float m_rotation[3];
00072     float m_translation[3];
00073     word m_numRotationKeyframes;
00074     word m_numTranslationKeyframes;
00075 } PACK_STRUCT;
00076 
00077 // Keyframe data
00078 struct MS3DKeyframe
00079 {
00080     float m_time;
00081     float m_parameter[3];
00082 } PACK_STRUCT;
00083 
00084 // Default alignment
00085 #ifdef _MSC_VER
00086 #       pragma pack( pop, packing )
00087 #endif
00088 
00089 #undef PACK_STRUCT
00090 
00091 #endif // __MS3D_H

Generated on Mon Aug 25 23:40:57 2003 for Shadow by doxygen 1.3.2