- another round of correct include names
[genesis3d.git] / include / Body.h
diff --git a/include/Body.h b/include/Body.h
new file mode 100644 (file)
index 0000000..dbe36b2
--- /dev/null
@@ -0,0 +1,136 @@
+/****************************************************************************************/\r
+/*  BODY.H                                                                              */\r
+/*                                                                                      */\r
+/*  Author: Mike Sandige                                                                   */\r
+/*  Description: Actor body interface.                                                     */\r
+/*                                                                                      */\r
+/*  The contents of this file are subject to the Genesis3D Public License               */\r
+/*  Version 1.01 (the "License"); you may not use this file except in                   */\r
+/*  compliance with the License. You may obtain a copy of the License at                */\r
+/*  http://www.genesis3d.com                                                            */\r
+/*                                                                                      */\r
+/*  Software distributed under the License is distributed on an "AS IS"                 */\r
+/*  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See                */\r
+/*  the License for the specific language governing rights and limitations              */\r
+/*  under the License.                                                                  */\r
+/*                                                                                      */\r
+/*  The Original Code is Genesis3D, released March 25, 1999.                            */\r
+/*  Genesis3D Version 1.1 released November 15, 1999                                 */\r
+/*  Copyright (C) 1999 WildTangent, Inc. All Rights Reserved           */\r
+/*                                                                                      */\r
+/****************************************************************************************/\r
+#ifndef GE_BODY_H\r
+#define GE_BODY_H \r
+\r
+/* This object is for managing the data associated with a skeletal-based mesh, \r
+   a 'body'.\r
+   This object holds the geometry for the body and the list of materials needed.\r
+*/\r
+\r
+#include "BaseType.h"\r
+#include "XForm3d.h"\r
+#include "VFile.h"\r
+#include "Bitmap.h"\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+#define GE_BODY_NUMBER_OF_LOD                  (4)             // 0 is highest detail\r
+#define GE_BODY_NO_PARENT_BONE         (-1)   \r
+#define GE_BODY_HIGHEST_LOD            (0)\r
+\r
+#define GE_BODY_ROOT                                   (-1)    // for specifying 'root' bounding box.\r
+\r
+typedef struct geBody geBody;\r
+\r
+\r
+\r
+geBody *GENESISCC geBody_Create(void);\r
+\r
+void GENESISCC geBody_Destroy(geBody **B);\r
+\r
+geBoolean GENESISCC geBody_IsValid(const geBody *B);\r
+\r
+\r
+geBoolean GENESISCC geBody_GetGeometryStats(const geBody *B, int lod, int *Vertices, int *Faces, int *Normals);\r
+\r
+geBoolean GENESISCC geBody_AddFace(    geBody *B,\r
+                                                               const geVec3d *Vertex1, const geVec3d *Normal1, \r
+                                                               geFloat U1, geFloat V1, int BoneIndex1,\r
+                                                               const geVec3d *Vertex2, const geVec3d *Normal2, \r
+                                                                       geFloat U2, geFloat V2, int BoneIndex2,\r
+                                                               const geVec3d *Vertex3, const geVec3d *Normal3, \r
+                                                                       geFloat U3, geFloat V3, int BoneIndex3,\r
+                                                               int MaterialIndex);\r
+\r
+                       // Bitmap is added to body.  It's reference count is increased.  Caller still owns a pointer\r
+                       // to the bitmap, and is responsible for destroying it.\r
+geBoolean GENESISCC geBody_AddMaterial( geBody *B, \r
+                                                                       const char *MaterialName, \r
+                                                                       geBitmap *Bitmap,\r
+                                                                       geFloat Red, \r
+                                                                       geFloat Green, \r
+                                                                       geFloat Blue,\r
+                                                                       int *MaterialIndex);\r
+\r
+                       // returned bitmap is a pointer to the bitmap in the body's list.  It may not be destroyed.\r
+                       // if caller would like to 'own' a copy of that bitmap pointer, it should call geBitmap_CreateRef()\r
+geBoolean GENESISCC geBody_GetMaterial(const geBody *Body, int MaterialIndex,\r
+                                                                               const char **MaterialName,\r
+                                                                               geBitmap **Bitmap, geFloat *Red, geFloat *Green, geFloat *Blue);\r
+\r
+                       // Bitmap is set into the body.  It's reference count is increased.  Caller still owns a pointer\r
+                       // to the bitmap, and is responsible for destroying it.\r
+geBoolean GENESISCC geBody_SetMaterial(geBody *Body, int MaterialIndex,\r
+                                                                               geBitmap *Bitmap,  geFloat Red,  geFloat Green,  geFloat Blue);\r
+\r
+int GENESISCC geBody_GetMaterialCount(const geBody *B);\r
+\r
+geBoolean GENESISCC geBody_AddBone( geBody *B, \r
+                                                       int ParentBoneIndex,\r
+                                                       const char *BoneName, \r
+                                                       const geXForm3d *AttachmentMatrix,\r
+                                                       int *BoneIndex);\r
+\r
+geBoolean GENESISCC geBody_ComputeLevelsOfDetail( geBody *B ,int Levels);\r
+\r
+int GENESISCC geBody_GetBoneCount(const geBody *B);\r
+\r
+void GENESISCC geBody_GetBone( const geBody *B, \r
+                                               int BoneIndex, \r
+                                               const char **BoneName,\r
+                                               geXForm3d *Attachment, \r
+                                               int *ParentBoneIndex);\r
+\r
+int32 GENESISCC geBody_GetBoneNameChecksum(const geBody *B);\r
+\r
+void GENESISCC geBody_SetBoundingBox( geBody *B,\r
+                                                       int BoneIndex,          // GE_BODY_ROOT for specifing 'root' bounding box.\r
+                                                       const geVec3d *MinimumBoxCorner,\r
+                                                       const geVec3d *MaximumBoxCorner);\r
\r
+\r
+geBoolean GENESISCC geBody_GetBoundingBox( const geBody *B, \r
+                                                       int BoneIndex,          // GE_BODY_ROOT for specifing 'root' bounding box.\r
+                                                       geVec3d *MinimumBoxCorner,\r
+                                                       geVec3d *MaximumBoxCorner);\r
+\r
+geBoolean GENESISCC geBody_GetBoneByName(const geBody* B,\r
+       const char* BoneName,\r
+       int* pBoneIndex,\r
+       geXForm3d* Attachment,\r
+       int* pParentBoneIndex);\r
+\r
+geBoolean GENESISCC geBody_WriteToFile(const geBody *B, geVFile *pFile);\r
+geBody  *GENESISCC  geBody_CreateFromFile(geVFile *pFile);\r
+\r
+\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif\r
+                                       \r