00001 /****************************************************************************************/ 00002 /* BODY._H */ 00003 /* */ 00004 /* Author: Mike Sandige */ 00005 /* Description: Exports private BODY data structures for "friends". */ 00006 /* */ 00007 /* The contents of this file are subject to the Genesis3D Public License */ 00008 /* Version 1.01 (the "License"); you may not use this file except in */ 00009 /* compliance with the License. You may obtain a copy of the License at */ 00010 /* http://www.genesis3d.com */ 00011 /* */ 00012 /* Software distributed under the License is distributed on an "AS IS" */ 00013 /* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See */ 00014 /* the License for the specific language governing rights and limitations */ 00015 /* under the License. */ 00016 /* */ 00017 /* The Original Code is Genesis3D, released March 25, 1999. */ 00018 /* Genesis3D Version 1.1 released November 15, 1999 */ 00019 /* Copyright (C) 1999 WildTangent, Inc. All Rights Reserved */ 00020 /* */ 00021 /****************************************************************************************/ 00022 #ifndef GE_BODY__H 00023 #define GE_BODY__H 00024 00025 #include "basetype.h" 00026 #include "xform3d.h" 00027 #include "body.h" 00028 #include "strblock.h" 00029 #include "bitmap.h" 00030 00031 00032 #ifdef __cplusplus 00033 extern "C" { 00034 #endif 00035 00036 #define GE_BODY_INDEX_MAX (0xEFFF) 00037 00038 #define GE_BODY_REALLY_BIG_NUMBER (9e9f) // bigger than any skin point 00039 00040 #define GE_BODY_HIGHEST_LOD_MASK ( 1 << GE_BODY_HIGHEST_LOD ) 00041 #define GE_BODY_BBOX_LOD_MASK ( 1 << GE_BODY_NUMBER_OF_LOD ) // bounding box mask 00042 00043 00044 typedef int16 geBody_Index; 00045 00046 typedef struct geBody_XSkinVertex 00047 { 00048 geVec3d XPoint; 00049 geFloat XU,XV; 00050 int8 LevelOfDetailMask; 00051 geBody_Index BoneIndex; 00052 } geBody_XSkinVertex; 00053 00054 typedef struct geBody_Normal 00055 { 00056 geVec3d Normal; 00057 int8 LevelOfDetailMask; 00058 geBody_Index BoneIndex; 00059 } geBody_Normal; 00060 00061 typedef struct geBody_Bone 00062 { 00063 geVec3d BoundingBoxMin; 00064 geVec3d BoundingBoxMax; 00065 geXForm3d AttachmentMatrix; 00066 geBody_Index ParentBoneIndex; 00067 } geBody_Bone; 00068 00069 typedef struct geBody_Triangle 00070 { 00071 geBody_Index VtxIndex[3]; 00072 geBody_Index NormalIndex[3]; 00073 geBody_Index MaterialIndex; 00074 //geBody_Index FaceNormal; 00075 } geBody_Triangle; 00076 00077 typedef struct geBody_TriangleList 00078 { 00079 geBody_Index FaceCount; 00080 geBody_Triangle *FaceArray; // Sorted by MaterialIndex 00081 } geBody_TriangleList; 00082 00083 typedef struct geBody_Material 00084 { 00085 geBitmap *Bitmap; 00086 geFloat Red,Green,Blue; 00087 } geBody_Material; 00088 00089 typedef struct geBody 00090 { 00091 geVec3d BoundingBoxMin; 00092 geVec3d BoundingBoxMax; 00093 00094 geBody_Index XSkinVertexCount; 00095 geBody_XSkinVertex *XSkinVertexArray; // Sorted by BoneIndex 00096 00097 geBody_Index SkinNormalCount; 00098 geBody_Normal *SkinNormalArray; 00099 00100 geBody_Index BoneCount; 00101 geBody_Bone *BoneArray; 00102 geStrBlock *BoneNames; 00103 00104 geBody_Index MaterialCount; 00105 geBody_Material *MaterialArray; 00106 geStrBlock *MaterialNames; 00107 00108 int LevelsOfDetail; 00109 geBody_TriangleList SkinFaces[GE_BODY_NUMBER_OF_LOD]; 00110 00111 geBody *IsValid; 00112 } geBody; 00113 00114 #if defined(DEBUG) || !defined(NDEBUG) 00115 geBoolean GENESISCC geBody_SanityCheck(const geBody *B); 00116 #endif 00117 00118 00119 00120 #ifdef __cplusplus 00121 } 00122 #endif 00123 00124 #endif
1.3.2