Eric Smith
Thu, 24 Jan 2002 17:00:44 -0800
I'm attaching some sample source code to expose the appropriate server blending interface to the engine.
Like Adrian said, if you're doing custom player model blending on the client, you need to mirror that blending on the server or your hitboxes will not match. -Eric -----Original Message----- From: Adrian Finol [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 24, 2002 9:57 AM To: 'David Flor '; '[EMAIL PROTECTED] ' Subject: RE: [hlcoders] Models and sequences Same way you do on the client, but this time you apply your transformations to the server side partners of the cliet StudioModelRenderer. It's all on animation.cpp. -----Original Message----- From: David Flor To: [EMAIL PROTECTED] Sent: 1/24/02 8:40 AM Subject: RE: [hlcoders] Models and sequences You know, it never dawned on me that that could be the cause of some of the hit detection issues in my mod. OK, so refresh my memory: how do I define the transformations on the SERVER? Tnx & Rgds... David "Nighthawk" Flor ( [EMAIL PROTECTED] ) Lead Programmer, The Persistence Engine - http://www.persistengine.com/ Lead Programmer, "The Opera" - http://opera.redeemedsoft.com/ President, Mach III Enterprises "When Alexander saw the breadth of his domain he wept for there were no more worlds to conquer..." -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Adrian Finol Sent: Wednesday, January 23, 2002 11:31 PM To: Ken Birdwell; ''[EMAIL PROTECTED]' ' Subject: RE: [hlcoders] Models and sequences One thing to remember is that any transformation applied to the model client side has to be duplicated on the server in order to mantain hit detection in order. We had this problem with CS, where the client was doing all the blendings ( 9 to be exact ) while the server had no idea about what was going on. Hence the old CS hitbox problem. _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
// common\r_studioint.h
// server blending
#define SV_BLENDING_INTERFACE_VERSION 1
typedef struct sv_blending_interface_s
{
int version;
void ( *SV_StudioSetupBones )( struct model_s *pModel,
float frame,
int sequence,
const vec3_t angles,
const vec3_t origin,
const byte *pcontroller,
const byte *pblending,
int iBone,
const edict_t *pEdict );
} sv_blending_interface_t;
// dlls\animation.cpp
#include "com_model.h"
#include "r_studioint.h"
void SV_StudioSetupBones( struct model_s *pModel, float frame, int sequence, const
vec3_t angles, const vec3_t origin, const byte *pcontroller, const byte *pblending,
int iBone, const edict_t *pEdict );
// The simple blending interface we'll pass back to the engine
sv_blending_interface_t svBlending =
{
SV_BLENDING_INTERFACE_VERSION,
SV_StudioSetupBones
};
// Global engine <-> studio model code interface
server_studio_api_t IEngineStudio;
studiohdr_t *g_pstudiohdr;
float (*g_pRotationMatrix)[3][4];
float (*g_pBoneTransform)[MAXSTUDIOBONES][3][4];
/*
====================
Server_GetBlendingInterface
Export this function for the engine to use the blending code to blend models
====================
*/
#ifdef _WIN32
extern "C" int __declspec( dllexport ) Server_GetBlendingInterface( int version,
struct sv_blending_interface_s **ppinterface, struct engine_studio_api_s *pstudio,
float (*rotationmatrix)[3][4], float (*bonetransform)[MAXSTUDIOBONES][3][4] )
#else
extern "C" int Server_GetBlendingInterface( int version, struct
sv_blending_interface_s **ppinterface, struct engine_studio_api_s *pstudio, float
(*rotationmatrix)[3][4], float (*bonetransform)[MAXSTUDIOBONES][3][4] )
#endif
{
if ( version != SV_BLENDING_INTERFACE_VERSION )
return 0;
// Point the engine to our callback
*ppinterface = &svBlending;
// Copy in engine helper functions
memcpy( &IEngineStudio, pstudio, sizeof( IEngineStudio ) );
g_pRotationMatrix = rotationmatrix;
g_pBoneTransform = bonetransform;
// Success
return 1;
}
.
.
.
// blending function used by the server to blend the models (for hitbox purposes)
void SV_StudioSetupBones( struct model_s *pModel, float frame, int sequence, const
vec3_t angles, const vec3_t origin, const byte *pcontroller, const byte *pblending,
int iBone, const edict_t *pEdict )
{
// your blending code here...
.
.
.
}