intsurface;// index into array held inside the model definition of pointers to the actual surface data loaded in - used by both client and game
floatgenBarycentricJ;// point 0 barycentric coors
floatgenBarycentricI;// point 1 barycentric coors - point 2 is 1 - point0 - point1
intgenPolySurfaceIndex;// used to point back to the original surface and poly if this is a generated surface
intgenLod;// used to determine original lod of original surface and poly hit location
surfaceInfo_t():
offFlags(0),
surface(0),
genBarycentricJ(0),
genBarycentricI(0),
genPolySurfaceIndex(0),
genLod(0)
{}
};
#define MDXABONEDEF // used in the mdxformat.h file to stop redefinitions of the bone struct.
// 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
intlastTime;// this does not go across the network
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;
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
mdxaBone_tposition;// this does not go across the network
boltInfo_t():
boneNumber(-1),
surfaceNumber(-1),
surfaceType(0),
boltUsed(0)
{}
};
#ifdef _SOF2
typedefenum
{
PGORE_NONE,
PGORE_ARMOR,
PGORE_BULLETSMALL,
PGORE_BULLETMED,
PGORE_BULLETBIG,
PGORE_HEGRENADE,
PGORE_COUNT
}goreEnum_t;
structgoreEnumShader_t
{
goreEnum_tshaderEnum;
charshaderName[MAX_QPATH];
};
structSSkinGoreData
{
vec3_tangles;
vec3_tposition;
intcurrentTime;
intentNum;
vec3_trayDirection;// in world space
vec3_thitLocation;// in world space
vec3_tscale;
floatSSize;// size of splotch in the S texture direction in world units
floatTSize;// size of splotch in the T texture direction in world units
floattheta;// angle to rotate the splotch
// qhandle_t shader; // handle to shader for gore, this better be rendered after the shader of the underlying surface
// this shader should also have "clamp" mode, not tiled.
goreEnum_tshaderEnum;// enum that'll get switched over to the shader's actual handle
};
#endif // _SOF2
#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<pair<int,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
//for transform optimization -rww
#define GHOUL2_ZONETRANSALLOC 0x2000
classCBoneCache;
// 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.
classCGhoul2Info
{
public:
surfaceInfo_vmSlist;
boltInfo_vmBltlist;
boneInfo_vmBlist;
// save from here
intmModelindex;
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
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