51 #include "../../idlib/precompiled.h"
54 #include "../Game_local.h"
103 const char *headModel;
106 idVec3 origin, modelOffset;
129 bounds[ 0 ].Set( size.
x * -0.5f, size.
y * -0.5f, 0.0f );
130 bounds[ 1 ].Set( size.
x * 0.5f, size.
y * 0.5f, size.
z );
139 if ( headModel[ 0 ] ) {
531 if ( args.
Argc() < 2 ) {
538 name = args.
Argv( 1 );
540 if ( strstr( name,
".ma" ) || strstr( name,
".mb" ) ) {
546 if ( md5anims[ 0 ] ) {
597 if ( args.
Argc() < 4 ) {
671 if ( args.
Argc() < 2 ) {
677 name = args.
Argv( 1 );
705 if ( args.
Argc() != 3 ) {
706 common->
Printf(
"USAGE: testShaderParm <parmNum> <float | \"time\">\n" );
710 int parm = atoi( args.
Argv( 1 ) );
720 value = atof( args.
Argv( 2 ) );
752 if ( args.
Argc() < 2 ) {
756 name = args.
Argv( 1 );
763 dict.
Set(
"model", name );
767 if ( name[ 0 ] !=
'_' ) {
773 if ( strstr( name,
".ma" ) || strstr( name,
".mb" ) ) {
784 dict.
Set(
"model", name );
805 for ( i = 0; i <
num; i++ ) {
809 for ( i = 0; i <
num; i++ ) {
virtual const idVec3 & GetOrigin(int id=0) const =0
idPlayer * GetLocalPlayer() const
renderEntity_t renderEntity
bool GetJointTransform(jointHandle_t jointHandle, int currenttime, idVec3 &offset, idMat3 &axis)
GLsizei const GLfloat * value
void SetCycleCount(int count)
idStr & SetFileExtension(const char *extension)
void SetContents(int contents, int id=-1)
const idDict * FindEntityDefDict(const char *name, bool makeDefault=true) const
virtual idAnimator * GetAnimator(void)
const idMat3 & GetAxis(int id=0) const
void Printf(const char *fmt,...) const id_attribute((format(printf
idAnimator * headAnimator
void BindToJoint(idEntity *master, const char *jointname, bool orientated)
void SetAngularExtrapolation(extrapolation_t type, int time, int duration, const idAngles &base, const idAngles &speed, const idAngles &baseSpeed)
type * GetEntity(void) const
void SetShaderParm(int parmnum, float value)
virtual void SetClipBox(const idBounds &bounds, float density)
float GetFloat(void) const
const idStr & GetKey(void) const
idMat3 Transpose(void) const
void SetAxis(const idMat3 &axis)
const int ANIMCHANNEL_ALL
const int ANIM_MaxSyncedAnims
void TestAnim(const idCmdArgs &args)
const idMat3 & GetAxis(void) const
const idKeyValue * MatchPrefix(const char *prefix, const idKeyValue *lastMatch=NULL) const
void PlayAnim(int channelNum, int animnum, int currenttime, int blendTime)
jointHandle_t GetJointHandle(const char *name) const
const char * GetName(void) const
idAngles ang_zero(0.0f, 0.0f, 0.0f)
bool ExportAnim(const char *anim)
static void TestModelNextFrame_f(const idCmdArgs &args)
virtual const char * Name() const =0
void SetJointPos(jointHandle_t jointnum, jointModTransform_t transform_type, const idVec3 &pos)
static void TestModelPrevAnim_f(const idCmdArgs &args)
static void TestModelNextAnim_f(const idCmdArgs &args)
idStr & DefaultFileExtension(const char *extension)
void Set(const char *key, const char *value)
idCVar g_testModelAnimate("g_testModelAnimate","0", CVAR_GAME|CVAR_INTEGER,"test model animation,\n""0 = cycle anim with origin reset\n""1 = cycle anim with fixed origin\n""2 = cycle anim with continuous origin\n""3 = frame by frame with continuous origin\n""4 = play anim once", 0, 4, idCmdSystem::ArgCompletion_Integer< 0, 4 >)
void SetAnim(const idDeclModelDef *modelDef, const char *sourcename, const char *animname, int num, const idMD5Anim *md5anims[ANIM_MaxSyncedAnims])
virtual void SetModel(const char *modelname)
int Icmp(const char *text) const
static void TestBlend_f(const idCmdArgs &args)
#define EVENT(event, function)
void SetAxis(const idMat3 &newAxis, int id=-1)
const int MAX_ENTITY_SHADER_PARMS
static void TestParticleStopTime_f(const idCmdArgs &args)
void SetJointAxis(jointHandle_t jointnum, jointModTransform_t transform_type, const idMat3 &mat)
idCVar g_testModelRotate("g_testModelRotate","0", CVAR_GAME,"test model rotation speed")
static void TestAnim_f(const idCmdArgs &args)
idCVar g_testModelBlend("g_testModelBlend","0", CVAR_GAME|CVAR_INTEGER,"number of frames to blend")
idEntity * SpawnEntityType(const idTypeInfo &classdef, const idDict *args=NULL, bool bIsClientReadSnapshot=false)
void void void Warning(const char *fmt,...) const id_attribute((format(printf
void PrevFrame(const idCmdArgs &args)
int GetFrameNumber(int currenttime) const
void SetSelf(idEntity *e)
virtual void ArgCompletion_FolderExtension(const idCmdArgs &args, void(*callback)(const char *s), const char *folder, bool stripFolder,...)=0
static void ArgCompletion_TestModel(const idCmdArgs &args, void(*callback)(const char *s))
const idEventDef EV_FootstepLeft("leftFoot")
void RemoveOriginOffset(bool remove)
static void TestModel_f(const idCmdArgs &args)
idPhysics * GetPhysics(void) const
idMD5Anim * GetAnim(const char *name)
void SetSkin(const idDeclSkin *skin)
const char * GetString(const char *key, const char *defaultString="") const
idVec3 ToForward(void) const
bool StartSound(const char *soundName, const s_channelType channel, int soundShaderFlags, bool broadcast, int *length)
void Restore(idRestoreGame *savefile)
void SetOrigin(const idVec3 &newOrigin, int id=-1)
void SetPhysics(idPhysics *phys)
idEntityPtr< idEntity > head
void Event_Footstep(void)
void ClearAllAnims(int currentTime, int cleartime)
idAnimBlend * CurrentAnim(int channelNum)
virtual const idDecl * FindType(declType_t type, const char *name, bool makeDefault=true)=0
void Save(idSaveGame *savefile)
int GetInteger(void) const
idVec3 GetVector(const char *key, const char *defaultString=NULL) const
bool GetJointLocalTransform(jointHandle_t jointHandle, int currentTime, idVec3 &offset, idMat3 &axis)
const idAnim * GetAnim(int index) const
void CycleAnim(int channelNum, int animnum, int currenttime, int blendtime)
void GetAngles(idAngles &curAngles) const
static void TestModelPrevFrame_f(const idCmdArgs &args)
bool ExportModel(const char *model)
const idStr & GetValue(void) const
virtual const idMat3 & GetAxis(int id=0) const =0
virtual idAnimator * GetAnimator(void)
const idDeclModelDef * ModelDef(void) const
static void TestShaderParm_f(const idCmdArgs &args)
const int SHADERPARM_TIMEOFFSET
virtual void Printf(const char *fmt,...) id_attribute((format(printf
const idVec3 & GetVisualOffset(void) const
idClipModel * GetClipModel(int id=0) const
static void ArgCompletion_TestAnim(const idCmdArgs &args, void(*callback)(const char *s))
const char * ToString(int precision=2) const
virtual void Present(void)
virtual bool ShouldConstructScriptObjectAtSpawn(void) const
idDeclManager * declManager
virtual int GetNumDecls(declType_t type)=0
int AnimLength(int animnum) const
int Append(const type &obj)
idRenderModelManager * renderModelManager
virtual bool IsDefaultModel() const =0
const char * AnimFullName(int animnum) const
void NextAnim(const idCmdArgs &args)
virtual const idDecl * DeclByIndex(declType_t type, int index, bool forceParse=true)=0
void BlendAnim(const idCmdArgs &args)
idCVar g_showTestModelFrame("g_showTestModelFrame","0", CVAR_GAME|CVAR_BOOL,"displays the current animation and frame # for testmodels")
const idEventDef EV_FootstepRight("rightFoot")
idList< copyJoints_t > copyJoints
bool GetJointWorldTransform(jointHandle_t jointHandle, int currentTime, idVec3 &offset, idMat3 &axis)
#define CLASS_DECLARATION(nameofsuperclass, nameofclass)
static void TestSkin_f(const idCmdArgs &args)
void UpdateAnimation(void)
idAnimManager animationLib
const char * c_str(void) const
int NumFrames(int animnum) const
ID_INLINE int FRAME2MS(int framenum)
const char * GetJointName(jointHandle_t handle) const
void BecomeActive(int flags)
const idEventDef EV_Remove("<immediateremove>", NULL)
void SetFrame(int channelNum, int animnum, int frame, int currenttime, int blendtime)
const char * Argv(int arg) const
virtual const idDeclSkin * FindSkin(const char *name, bool makeDefault=true)=0
bool CheatsOk(bool requirePlayer=true)
int NumFrames(void) const
int GetStartTime(void) const
virtual idRenderModel * CheckModel(const char *modelName)=0
char * va(const char *fmt,...)
void SetOrigin(const idVec3 &org)
bool PostEventMS(const idEventDef *ev, int time)
void PrevAnim(const idCmdArgs &args)
float shaderParms[MAX_ENTITY_SHADER_PARMS]
void NextFrame(const idCmdArgs &args)
void StopSound(const s_channelType channel, bool broadcast)
bool StripLeadingOnce(const char *string)
idPhysics_Parametric physicsObj
static void KeepTestModel_f(const idCmdArgs &args)
const int SHADERPARM_PARTICLE_STOPTIME