/*#define MDXABONEDEF // used in the mdxformat.h file to stop redefinitions of the bone struct.
typedefstruct{
floatmatrix[3][4];
}mdxaBone_t;
*/
#include"../renderer/mdx_format.h"
// we save the whole structure here.
structboneInfo_t
{
intboneNumber;// what bone are we overriding?
mdxaBone_tmatrix;// details of bone angle overrides - some are pre-done on the server, some in ghoul2
intflags;// flags for override
intstartFrame;// start frame for animation
intendFrame;// end frame for animation NOTE anim actually ends on endFrame+1
intstartTime;// time we started this animation
intpauseTime;// time we paused this animation - 0 if not paused
floatanimSpeed;// speed at which this anim runs. 1.0f means full speed of animation incoming - ie if anim is 20hrtz, we run at 20hrts. If 5hrts, we run at 5 hrts
floatblendFrame;// frame PLUS LERP value to blend from
intblendLerpFrame;// frame to lerp the blend frame with.
intblendTime;// Duration time for blending - used to calc amount each frame of new anim is blended with last frame of the last anim
intblendStart;// Time when blending starts - not necessarily the same as startTime since we might start half way through an anim
intboneBlendTime;// time for duration of bone angle blend with normal animation
intboneBlendStart;// time bone angle blend with normal animation began
mdxaBone_tnewMatrix;// This is the lerped matrix that Ghoul2 uses on the client side - does not go across the network
//rww - RAGDOLL_BEGIN
intlastTimeUpdated;// if non-zero this is all intialized
intlastContents;
vec3_tlastPosition;
vec3_tvelocityEffector;
vec3_tlastAngles;
vec3_tminAngles;
vec3_tmaxAngles;
vec3_tcurrentAngles;
vec3_tanglesOffset;
vec3_tpositionOffset;
floatradius;
floatweight;// current radius cubed
intragIndex;
vec3_tvelocityRoot;// I am really tired of recomiling the whole game to add a param here
intragStartTime;
intfirstTime;
intfirstCollisionTime;
intrestTime;
intRagFlags;
intDependentRagIndexMask;
mdxaBone_toriginalTrueBoneMatrix;
mdxaBone_tparentTrueBoneMatrix;// figure I will need this sooner or later
mdxaBone_tparentOriginalTrueBoneMatrix;// figure I will need this sooner or later
vec3_toriginalOrigin;
vec3_toriginalAngles;
vec3_tlastShotDir;
mdxaBone_t*basepose;
mdxaBone_t*baseposeInv;
mdxaBone_t*baseposeParent;
mdxaBone_t*baseposeInvParent;
intparentRawBoneIndex;
mdxaBone_tragOverrideMatrix;// figure I will need this sooner or later
mdxaBone_textraMatrix;// figure I will need this sooner or later
vec3_textraVec1;// I am really tired of recomiling the whole game to add a param here
floatextraFloat1;
intextraInt1;
vec3_tikPosition;
floatikSpeed;
//new ragdoll stuff -rww
vec3_tepVelocity;//velocity factor, can be set, and is also maintained by physics based on gravity, mass, etc.
floatepGravFactor;//gravity factor maintained by bone physics
intsolidCount;//incremented every time we try to move and are in solid - if we get out of solid, it is reset to 0
boolphysicsSettled;//true when the bone is on ground and finished bouncing, etc. but may still be pushed into solid by other bones
boolsnapped;//the bone is broken out of standard constraints
intparentBoneIndex;
floatoffsetRotation;
//user api overrides
floatoverGradSpeed;
vec3_toverGoalSpot;
boolhasOverGoal;
mdxaBone_tanimFrameMatrix;//matrix for the bone in the desired settling pose -rww
inthasAnimFrameMatrix;
intairTime;//base is in air, be more quick and sensitive about collisions
//we save from top to boltUsed here. Don't bother saving the position, it gets rebuilt every frame anyway
structboltInfo_t{
intboneNumber;// bone number bolt attaches to
intsurfaceNumber;// surface number bolt attaches to
intsurfaceType;// if we attach to a surface, this tells us if it is an original surface or a generated one - doesn't go across the network
intboltUsed;// nor does this
boltInfo_t():
boneNumber(-1),
surfaceNumber(-1),
surfaceType(0),
boltUsed(0)
{}
};
#define MAX_GHOUL_COUNT_BITS 8 // bits required to send across the MAX_G2_MODELS inside of the networking - this is the only restriction on ghoul models possible per entity
typedefvector<surfaceInfo_t>surfaceInfo_v;
typedefvector<boneInfo_t>boneInfo_v;
typedefvector<boltInfo_t>boltInfo_v;
typedefvector<mdxaBone_t>mdxaBone_v;
// defines for stuff to go into the mflags
#define GHOUL2_NOCOLLIDE 0x001
#define GHOUL2_NORENDER 0x002
#define GHOUL2_NOMODEL 0x004
#define GHOUL2_NEWORIGIN 0x008
// NOTE order in here matters. We save out from mModelindex to mFlags, but not the STL vectors that are at the top or the bottom.
classCBoneCache;
structmodel_s;
//struct mdxaHeader_t;
#ifdef VV_GHOUL_HACKS
classCRenderableSurface
{
public:
intident;// ident of this surface - required so the materials renderer knows what sort of surface this refers to
CBoneCache*boneCache;// pointer to transformed bone list for this surf
mdxmSurface_t*surfaceData;// pointer to surface data loaded into file - only used by client renderer DO NOT USE IN GAME SIDE - if there is a vid restart this will be out of wack on the game
CRenderableSurface():
ident(8),//SF_MDX
boneCache(0),
surfaceData(0)
{}
CRenderableSurface(constCRenderableSurface&rs):
ident(rs.ident),
boneCache(rs.boneCache),
surfaceData(rs.surfaceData)
{}
};
#endif
classCGhoul2Info
{
public:
surfaceInfo_vmSlist;
boltInfo_vmBltlist;
boneInfo_vmBlist;
// save from here (do not put any ptrs etc within this save block unless you adds special handlers to G2_SaveGhoul2Models / G2_LoadGhoul2Models!!!!!!!!!!!!
#define BSAVE_START_FIELD mModelindex // this is the start point for loadsave, keep it up to date it you change anything
intmModelindex;
intanimModelIndexOffset;
qhandle_tmCustomShader;
qhandle_tmCustomSkin;
intmModelBoltLink;
intmSurfaceRoot;
intmLodBias;
intmNewOrigin;// this contains the bolt index of the new origin for this model
#ifdef _G2_GORE
intmGoreSetTag;
#endif
qhandle_tmModel;// this and the next entries do NOT go across the network. They are for gameside access ONLY
charmFileName[MAX_QPATH];
intmAnimFrameDefault;
intmSkelFrameNum;
intmMeshFrameNum;
intmFlags;// used for determining whether to do full collision detection against this object
// to here
#define BSAVE_END_FIELD mTransformedVertsArray // this is the end point for loadsave, keep it up to date it you change anything
int*mTransformedVertsArray;// used to create an array of pointers to transformed verts per surface for collision detection
CBoneCache*mBoneCache;
intmSkin;
// these occasionally are not valid (like after a vid_restart)
// call the questionably efficient G2_SetupModelPointers(this) to insure validity