Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct studiohdr_t
- {
- int id;
- int version;
- int checksum; // this has to be the same in the phy and vtx files to load!
- char name[64];
- int length;
- Vector eyeposition; // ideal eye position
- Vector illumposition; // illumination center
- Vector hull_min; // ideal movement hull size
- Vector hull_max;
- Vector view_bbmin; // clipping bounding box
- Vector view_bbmax;
- int flags;
- int numbones; // bones
- int boneindex;
- int RemapSeqBone(int iSequence, int iLocalBone) const; // maps local sequence bone to global bone
- int RemapAnimBone(int iAnim, int iLocalBone) const; // maps local animations bone to global bone
- int numbonecontrollers; // bone controllers
- int bonecontrollerindex;
- int numhitboxsets;
- int hitboxsetindex;
- // Look up hitbox set by index
- mstudiohitboxset_t *pHitboxSet(int i) const
- {
- Assert(i >= 0 && i < numhitboxsets);
- return (mstudiohitboxset_t *)(((BYTE *)this) + hitboxsetindex) + i;
- };
- // Calls through to hitbox to determine size of specified set
- inline mstudiobbox_t *pHitbox(int i, int set) const
- {
- mstudiohitboxset_t const *s = pHitboxSet(set);
- if (!s)
- return NULL;
- return s->pHitbox(i);
- };
- // Calls through to set to get hitbox count for set
- inline int iHitboxCount(int set) const
- {
- mstudiohitboxset_t const *s = pHitboxSet(set);
- if (!s)
- return 0;
- return s->numhitboxes;
- };
- // file local animations? and sequences
- //private:
- int numlocalanim; // animations/poses
- int localanimindex; // animation descriptions
- int numlocalseq; // sequences
- int localseqindex;
- //public:
- bool SequencesAvailable() const;
- int GetNumSeq() const;
- int iRelativeAnim(int baseseq, int relanim) const; // maps seq local anim reference to global anim index
- int iRelativeSeq(int baseseq, int relseq) const; // maps seq local seq reference to global seq index
- //private:
- mutable int activitylistversion; // initialization flag - have the sequences been indexed?
- mutable int eventsindexed;
- //public:
- int GetSequenceActivity(int iSequence);
- void SetSequenceActivity(int iSequence, int iActivity);
- int GetActivityListVersion(void);
- void SetActivityListVersion(int version) const;
- int GetEventListVersion(void);
- void SetEventListVersion(int version);
- // raw textures
- int numtextures;
- int textureindex;
- // raw textures search paths
- int numcdtextures;
- int cdtextureindex;
- inline char *pCdtexture(int i) const { return (((char *)this) + *((int *)(((BYTE *)this) + cdtextureindex) + i)); };
- // replaceable textures tables
- int numskinref;
- int numskinfamilies;
- int skinindex;
- inline short *pSkinref(int i) const { return (short *)(((BYTE *)this) + skinindex) + i; };
- int numbodyparts;
- int bodypartindex;
- // queryable attachable points
- //private:
- int numlocalattachments;
- int localattachmentindex;
- //public:
- int GetNumAttachments(void) const;
- int GetAttachmentBone(int i);
- // used on my tools in hlmv, not persistant
- void SetAttachmentBone(int iAttachment, int iBone);
- // animation node to animation node transition graph
- //private:
- int numlocalnodes;
- int localnodeindex;
- int localnodenameindex;
- inline char *pszLocalNodeName(int iNode) const { Assert(iNode >= 0 && iNode < numlocalnodes); return (((char *)this) + *((int *)(((BYTE *)this) + localnodenameindex) + iNode)); }
- inline BYTE *pLocalTransition(int i) const { Assert(i >= 0 && i < (numlocalnodes * numlocalnodes)); return (BYTE *)(((BYTE *)this) + localnodeindex) + i; };
- //public:
- int EntryNode(int iSequence);
- int ExitNode(int iSequence);
- char *pszNodeName(int iNode);
- int GetTransition(int iFrom, int iTo) const;
- int numflexdesc;
- int flexdescindex;
- int numflexcontrollers;
- int flexcontrollerindex;
- int numflexrules;
- int flexruleindex;
- int numikchains;
- int ikchainindex;
- int nummouths;
- int mouthindex;
- //private:
- int numlocalposeparameters;
- int localposeparamindex;
- //public:
- int GetNumPoseParameters(void) const;
- int GetSharedPoseParameter(int iSequence, int iLocalPose) const;
- int surfacepropindex;
- inline char * const pszSurfaceProp(void) const { return ((char *)this) + surfacepropindex; }
- // Key values
- int keyvalueindex;
- int keyvaluesize;
- inline const char * KeyValueText(void) const { return keyvaluesize != 0 ? ((char *)this) + keyvalueindex : NULL; }
- int numlocalikautoplaylocks;
- int localikautoplaylockindex;
- int GetNumIKAutoplayLocks(void) const;
- int CountAutoplaySequences() const;
- int CopyAutoplaySequences(unsigned short *pOut, int outCount) const;
- int GetAutoplayList(unsigned short **pOut) const;
- // The collision model mass that jay wanted
- float mass;
- int contents;
- // external animations, models, etc.
- int numincludemodels;
- int includemodelindex;
- // implementation specific call to get a named model
- const studiohdr_t *FindModel(void **cache, char const *modelname) const;
- // implementation specific back pointer to virtual data
- mutable void *virtualModel;
- //virtualmodel_t GetVirtualModel(void) const;
- // for demand loaded animation blocks
- int szanimblocknameindex;
- inline char * const pszAnimBlockName(void) const { return ((char *)this) + szanimblocknameindex; }
- int numanimblocks;
- int animblockindex;
- mutable void *animblockModel;
- BYTE * GetAnimBlock(int i) const;
- int bonetablebynameindex;
- inline const BYTE *GetBoneTableSortedByName() const { return (BYTE *)this + bonetablebynameindex; }
- // used by tools only that don't cache, but persist mdl's peer data
- // engine uses virtualModel to back link to cache pointers
- void *pVertexBase;
- void *pIndexBase;
- // if STUDIOHDR_FLAGS_CONSTANT_DIRECTIONAL_LIGHT_DOT is set,
- // this value is used to calculate directional components of lighting
- // on static props
- BYTE constdirectionallightdot;
- // set during load of mdl data to track *desired* lod configuration (not actual)
- // the *actual* clamped root lod is found in studiohwdata
- // this is stored here as a global store to ensure the staged loading matches the rendering
- BYTE rootLOD;
- // set in the mdl data to specify that lod configuration should only allow first numAllowRootLODs
- // to be set as root LOD:
- // numAllowedRootLODs = 0 means no restriction, any lod can be set as root lod.
- // numAllowedRootLODs = N means that lod0 - lod(N-1) can be set as root lod, but not lodN or lower.
- BYTE numAllowedRootLODs;
- BYTE unused[1];
- int unused4; // zero out if version < 47
- int numflexcontrollerui;
- int flexcontrolleruiindex;
- int unused3[2];
- // FIXME: Remove when we up the model version. Move all fields of studiohdr2_t into studiohdr_t.
- int studiohdr2index;
- // NOTE: No room to add stuff? Up the .mdl file format version
- // [and move all fields in studiohdr2_t into studiohdr_t and kill studiohdr2_t],
- // or add your stuff to studiohdr2_t. See NumSrcBoneTransforms/SrcBoneTransform for the pattern to use.
- int unused2[1];
- studiohdr_t() {}
- private:
- // No copy constructors allowed
- studiohdr_t(const studiohdr_t& vOther);
- friend struct virtualmodel_t;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement