Add structures for hitbox sets and bounding boxes.

Signed-off-by: aixxe <me@aixxe.net>
This commit is contained in:
aixxe 2016-12-19 19:40:35 +00:00
parent b746fa1e3b
commit 04fd052795
1 changed files with 70 additions and 1 deletions

View File

@ -17,7 +17,76 @@
#define BONE_USED_BY_VERTEX_LOD7 0x20000
#define BONE_USED_BY_BONE_MERGE 0x40000
class studiohdr_t;
struct mstudiobbox_t {
public:
inline const char* GetName() {
if (szhitboxnameindex == 0)
return nullptr;
return ((const char*)this) + szhitboxnameindex;
}
int bone;
int group;
Vector bbmin;
Vector bbmax;
int szhitboxnameindex;
int unused[8];
};
struct mstudiohitboxset_t {
public:
inline const char* GetName() {
return ((const char*)this) + sznameindex;
}
inline mstudiobbox_t* GetHitbox(int i) const {
return (mstudiobbox_t*)(((unsigned char*)this) + hitboxindex) + i;
};
int sznameindex;
int numhitboxes;
int hitboxindex;
};
class studiohdr_t {
public:
inline const mstudiohitboxset_t* GetHitboxSet(int i) {
if (i > numhitboxsets)
return nullptr;
return (const mstudiohitboxset_t*)((unsigned char*)this + hitboxsetindex) + i;
}
int id;
int version;
long checksum;
char szName[64];
int length;
Vector vecEyePos;
Vector vecIllumPos;
Vector vecHullMin;
Vector vecHullMax;
Vector vecBBMin;
Vector vecBBMax;
int flags;
int numBones;
int indexBones;
int numbonecontrollers;
int bonecontrollerindex;
int numhitboxsets;
int hitboxsetindex;
int numlocalanim;
int localanimindex;
int numlocalseq;
int localseqindex;
int activitylistversion;
int eventsindexed;
int numtextures;
int textureindex;
};
class model_t;
class IVModelInfoClient {
public: