00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef GE_BODY_H
00023 #define GE_BODY_H
00024
00025
00026
00027
00028
00029
00030 #include "basetype.h"
00031 #include "xform3d.h"
00032 #include "vfile.h"
00033 #include "bitmap.h"
00034
00035 #ifdef __cplusplus
00036 extern "C" {
00037 #endif
00038
00039 #define GE_BODY_NUMBER_OF_LOD (4) // 0 is highest detail
00040 #define GE_BODY_NO_PARENT_BONE (-1)
00041 #define GE_BODY_HIGHEST_LOD (0)
00042
00043 #define GE_BODY_ROOT (-1) // for specifying 'root' bounding box.
00044
00045 typedef struct geBody geBody;
00046
00047
00048
00049 geBody *GENESISCC geBody_Create(void);
00050
00051 void GENESISCC geBody_Destroy(geBody **B);
00052
00053 geBoolean GENESISCC geBody_IsValid(const geBody *B);
00054
00055
00056 geBoolean GENESISCC geBody_GetGeometryStats(const geBody *B, int lod, int *Vertices, int *Faces, int *Normals);
00057
00058 geBoolean GENESISCC geBody_AddFace( geBody *B,
00059 const geVec3d *Vertex1, const geVec3d *Normal1,
00060 geFloat U1, geFloat V1, int BoneIndex1,
00061 const geVec3d *Vertex2, const geVec3d *Normal2,
00062 geFloat U2, geFloat V2, int BoneIndex2,
00063 const geVec3d *Vertex3, const geVec3d *Normal3,
00064 geFloat U3, geFloat V3, int BoneIndex3,
00065 int MaterialIndex);
00066
00067
00068
00069 geBoolean GENESISCC geBody_AddMaterial( geBody *B,
00070 const char *MaterialName,
00071 geBitmap *Bitmap,
00072 geFloat Red,
00073 geFloat Green,
00074 geFloat Blue,
00075 int *MaterialIndex);
00076
00077
00078
00079 geBoolean GENESISCC geBody_GetMaterial(const geBody *Body, int MaterialIndex,
00080 const char **MaterialName,
00081 geBitmap **Bitmap, geFloat *Red, geFloat *Green, geFloat *Blue);
00082
00083
00084
00085 geBoolean GENESISCC geBody_SetMaterial(geBody *Body, int MaterialIndex,
00086 geBitmap *Bitmap, geFloat Red, geFloat Green, geFloat Blue);
00087
00088 int GENESISCC geBody_GetMaterialCount(const geBody *B);
00089
00090 geBoolean GENESISCC geBody_AddBone( geBody *B,
00091 int ParentBoneIndex,
00092 const char *BoneName,
00093 const geXForm3d *AttachmentMatrix,
00094 int *BoneIndex);
00095
00096 geBoolean GENESISCC geBody_ComputeLevelsOfDetail( geBody *B ,int Levels);
00097
00098 int GENESISCC geBody_GetBoneCount(const geBody *B);
00099
00100 void GENESISCC geBody_GetBone( const geBody *B,
00101 int BoneIndex,
00102 const char **BoneName,
00103 geXForm3d *Attachment,
00104 int *ParentBoneIndex);
00105
00106 int32 GENESISCC geBody_GetBoneNameChecksum(const geBody *B);
00107
00108 void GENESISCC geBody_SetBoundingBox( geBody *B,
00109 int BoneIndex,
00110 const geVec3d *MinimumBoxCorner,
00111 const geVec3d *MaximumBoxCorner);
00112
00113
00114 geBoolean GENESISCC geBody_GetBoundingBox( const geBody *B,
00115 int BoneIndex,
00116 geVec3d *MinimumBoxCorner,
00117 geVec3d *MaximumBoxCorner);
00118
00119 geBoolean GENESISCC geBody_GetBoneByName(const geBody* B,
00120 const char* BoneName,
00121 int* pBoneIndex,
00122 geXForm3d* Attachment,
00123 int* pParentBoneIndex);
00124
00125 geBoolean GENESISCC geBody_WriteToFile(const geBody *B, geVFile *pFile);
00126 geBody *GENESISCC geBody_CreateFromFile(geVFile *pFile);
00127
00128
00129
00130
00131 #ifdef __cplusplus
00132 }
00133 #endif
00134
00135 #endif
00136