Oe_import_ms3d.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. Header k animacim
  3. */
  4. // byte-align structures
  5. #ifdef _MSC_VER
  6. # pragma pack( push, packing )
  7. # pragma pack( 1 )
  8. # define PACK_STRUCT
  9. #elif defined( __GNUC__ )
  10. # define PACK_STRUCT __attribute__((packed))
  11. #else
  12. # error you must byte-align these structures with the appropriate compiler directives
  13. #endif
  14. // File header
  15. struct MS3DHeader
  16. {
  17. char m_ID[10];
  18. int m_version;
  19. } PACK_STRUCT;
  20. // Vertex information
  21. struct MS3DVertex
  22. {
  23. byte m_flags;
  24. float m_vertex[3];
  25. char m_boneID;
  26. byte m_refCount;
  27. } PACK_STRUCT;
  28. // Triangle information
  29. struct MS3DTriangle
  30. {
  31. word m_flags;
  32. word m_vertexIndices[3];
  33. float m_vertexNormals[3][3];
  34. float m_s[3], m_t[3];
  35. byte m_smoothingGroup;
  36. byte m_groupIndex;
  37. } PACK_STRUCT;
  38. // Material information
  39. struct MS3DMaterial
  40. {
  41. char m_name[32];
  42. float m_ambient[4];
  43. float m_diffuse[4];
  44. float m_specular[4];
  45. float m_emissive[4];
  46. float m_shininess; // 0.0f - 128.0f
  47. float m_transparency; // 0.0f - 1.0f
  48. byte m_mode; // 0, 1, 2 is unused now
  49. char m_texture[128];
  50. char m_alphamap[128];
  51. } PACK_STRUCT;
  52. // Joint information
  53. struct MS3DJoint
  54. {
  55. byte m_flags;
  56. char m_name[32];
  57. char m_parentName[32];
  58. float m_rotation[3];
  59. float m_translation[3];
  60. word m_numRotationKeyframes;
  61. word m_numTranslationKeyframes;
  62. } PACK_STRUCT;
  63. // Keyframe data
  64. struct MS3DKeyframe
  65. {
  66. float m_time;
  67. float m_parameter[3];
  68. } PACK_STRUCT;