29 #include "../../idlib/precompiled.h"
32 #include "../Game_local.h"
35 "all",
"torso",
"legs",
"head",
"eyelids"
120 assert( ( num > 0 ) && ( num <= ANIM_MaxSyncedAnims ) );
125 for( i = 0; i <
num; i++ ) {
235 if ( !
anims[ animNum ] ) {
250 if ( !
anims[ animNum ] ) {
251 rotation.
Set( 0.0
f, 0.0
f, 0.0
f, 1.0
f );
265 if ( !
anims[ animNum ] ) {
291 if ( ( framenum < 1 ) || ( framenum >
anims[ 0 ]->
NumFrames() ) ) {
292 return va(
"Frame %d out of range", framenum );
298 memset( &fc, 0,
sizeof( fc ) );
301 return "Unexpected end of line";
303 if ( token ==
"call" ) {
305 return "Unexpected end of line";
310 return va(
"Function '%s' not found", token.
c_str() );
312 }
else if ( token ==
"object_call" ) {
314 return "Unexpected end of line";
318 }
else if ( token ==
"event" ) {
320 return "Unexpected end of line";
325 return va(
"Event '%s' not found", token.
c_str() );
328 return va(
"Event '%s' has arguments", token.
c_str() );
331 }
else if ( token ==
"sound" ) {
333 return "Unexpected end of line";
336 if ( !token.
Cmpn(
"snd_", 4 ) ) {
344 }
else if ( token ==
"sound_voice" ) {
346 return "Unexpected end of line";
349 if ( !token.
Cmpn(
"snd_", 4 ) ) {
357 }
else if ( token ==
"sound_voice2" ) {
359 return "Unexpected end of line";
362 if ( !token.
Cmpn(
"snd_", 4 ) ) {
370 }
else if ( token ==
"sound_body" ) {
372 return "Unexpected end of line";
375 if ( !token.
Cmpn(
"snd_", 4 ) ) {
383 }
else if ( token ==
"sound_body2" ) {
385 return "Unexpected end of line";
388 if ( !token.
Cmpn(
"snd_", 4 ) ) {
396 }
else if ( token ==
"sound_body3" ) {
398 return "Unexpected end of line";
401 if ( !token.
Cmpn(
"snd_", 4 ) ) {
409 }
else if ( token ==
"sound_weapon" ) {
411 return "Unexpected end of line";
414 if ( !token.
Cmpn(
"snd_", 4 ) ) {
422 }
else if ( token ==
"sound_global" ) {
424 return "Unexpected end of line";
427 if ( !token.
Cmpn(
"snd_", 4 ) ) {
435 }
else if ( token ==
"sound_item" ) {
437 return "Unexpected end of line";
440 if ( !token.
Cmpn(
"snd_", 4 ) ) {
448 }
else if ( token ==
"sound_chatter" ) {
450 return "Unexpected end of line";
453 if ( !token.
Cmpn(
"snd_", 4 ) ) {
461 }
else if ( token ==
"skin" ) {
463 return "Unexpected end of line";
466 if ( token ==
"none" ) {
471 return va(
"Skin '%s' not found", token.
c_str() );
474 }
else if ( token ==
"fx" ) {
476 return "Unexpected end of line";
480 return va(
"fx '%s' not found", token.
c_str() );
483 }
else if ( token ==
"trigger" ) {
485 return "Unexpected end of line";
489 }
else if ( token ==
"triggerSmokeParticle" ) {
491 return "Unexpected end of line";
495 }
else if ( token ==
"melee" ) {
497 return "Unexpected end of line";
501 return va(
"Unknown entityDef '%s'", token.
c_str() );
504 }
else if ( token ==
"direct_damage" ) {
506 return "Unexpected end of line";
510 return va(
"Unknown entityDef '%s'", token.
c_str() );
513 }
else if ( token ==
"attack_begin" ) {
515 return "Unexpected end of line";
519 return va(
"Unknown entityDef '%s'", token.
c_str() );
522 }
else if ( token ==
"attack_end" ) {
524 }
else if ( token ==
"muzzle_flash" ) {
526 return "Unexpected end of line";
528 if ( ( token !=
"" ) && !modelDef->
FindJoint( token ) ) {
529 return va(
"Joint '%s' not found", token.
c_str() );
533 }
else if ( token ==
"muzzle_flash" ) {
536 }
else if ( token ==
"create_missile" ) {
538 return "Unexpected end of line";
541 return va(
"Joint '%s' not found", token.
c_str() );
545 }
else if ( token ==
"launch_missile" ) {
547 return "Unexpected end of line";
550 return va(
"Joint '%s' not found", token.
c_str() );
554 }
else if ( token ==
"fire_missile_at_target" ) {
556 return "Unexpected end of line";
558 jointInfo = modelDef->
FindJoint( token );
560 return va(
"Joint '%s' not found", token.
c_str() );
563 return "Unexpected end of line";
569 }
else if ( token ==
"launch_projectile" ) {
571 return "Unexpected end of line";
574 return "Unknown projectile def";
576 fc.
type = FC_LAUNCH_PROJECTILE;
578 }
else if ( token ==
"trigger_fx" ) {
581 return "Unexpected end of line";
583 jointInfo = modelDef->
FindJoint( token );
585 return va(
"Joint '%s' not found", token.
c_str() );
588 return "Unexpected end of line";
591 return "Unknown FX def";
594 fc.
type = FC_TRIGGER_FX;
598 }
else if ( token ==
"start_emitter" ) {
602 return "Unexpected end of line";
607 return "Unexpected end of line";
609 jointInfo = modelDef->
FindJoint( token );
611 return va(
"Joint '%s' not found", token.
c_str() );
614 return "Unexpected end of line";
617 fc.
type = FC_START_EMITTER;
621 }
else if ( token ==
"stop_emitter" ) {
624 return "Unexpected end of line";
626 fc.
type = FC_STOP_EMITTER;
629 }
else if ( token ==
"footstep" ) {
631 }
else if ( token ==
"leftfoot" ) {
633 }
else if ( token ==
"rightfoot" ) {
635 }
else if ( token ==
"enableEyeFocus" ) {
637 }
else if ( token ==
"disableEyeFocus" ) {
639 }
else if ( token ==
"disableGravity" ) {
641 }
else if ( token ==
"enableGravity" ) {
643 }
else if ( token ==
"jump" ) {
645 }
else if ( token ==
"enableClip" ) {
647 }
else if ( token ==
"disableClip" ) {
649 }
else if ( token ==
"enableWalkIK" ) {
651 }
else if ( token ==
"disableWalkIK" ) {
653 }
else if ( token ==
"enableLegIK" ) {
655 return "Unexpected end of line";
658 fc.
index = atoi( token );
659 }
else if ( token ==
"disableLegIK" ) {
661 return "Unexpected end of line";
664 fc.
index = atoi( token );
665 }
else if ( token ==
"recordDemo" ) {
670 }
else if ( token ==
"aviGame" ) {
676 return va(
"Unknown command '%s'", token.
c_str() );
730 while( frame != to ) {
732 if ( frame >= numframes ) {
738 while( index < end ) {
740 switch( command.
type ) {
757 gameLocal.
Warning(
"Framecommand 'sound' on entity '%s', anim '%s', frame %d: Could not find sound '%s'",
768 gameLocal.
Warning(
"Framecommand 'sound_voice' on entity '%s', anim '%s', frame %d: Could not find sound '%s'",
779 gameLocal.
Warning(
"Framecommand 'sound_voice2' on entity '%s', anim '%s', frame %d: Could not find sound '%s'",
790 gameLocal.
Warning(
"Framecommand 'sound_body' on entity '%s', anim '%s', frame %d: Could not find sound '%s'",
801 gameLocal.
Warning(
"Framecommand 'sound_body2' on entity '%s', anim '%s', frame %d: Could not find sound '%s'",
812 gameLocal.
Warning(
"Framecommand 'sound_body3' on entity '%s', anim '%s', frame %d: Could not find sound '%s'",
823 gameLocal.
Warning(
"Framecommand 'sound_weapon' on entity '%s', anim '%s', frame %d: Could not find sound '%s'",
834 gameLocal.
Warning(
"Framecommand 'sound_global' on entity '%s', anim '%s', frame %d: Could not find sound '%s'",
845 gameLocal.
Warning(
"Framecommand 'sound_item' on entity '%s', anim '%s', frame %d: Could not find sound '%s'",
857 gameLocal.
Warning(
"Framecommand 'sound_chatter' on entity '%s', anim '%s', frame %d: Could not find sound '%s'",
880 SetTimeState ts(target->timeGroup);
886 gameLocal.
Warning(
"Framecommand 'trigger' on entity '%s', anim '%s', frame %d: Could not find entity '%s'",
928 case FC_LAUNCH_PROJECTILE: {
932 case FC_TRIGGER_FX: {
936 case FC_START_EMITTER: {
945 case FC_STOP_EMITTER: {
1042 for( frame = 0; frame < numframes; frame++ ) {
1044 for( index =
frameLookup[ frame ].firstCommand; index <
end; index++ ) {
1224 return anim->
Name();
1266 if ( timeDelta <= 0 ) {
1299 endtime = currentTime + blendTime;
1328 if ( ( num < 0 ) || ( num > anim->
NumAnims() ) ) {
1538 }
else if (
cycle == 0 ) {
1542 if (
rate == 1.0
f ) {
1544 }
else if (
rate != 0.0
f ) {
1551 if (
rate == 1.0
f ) {
1553 }
else if (
rate != 0.0
f ) {
1570 if (
rate == newRate ) {
1574 animTime =
AnimTime( currentTime );
1575 if ( newRate == 1.0
f ) {
1709 if (
rate == 1.0
f ) {
1718 if ( (
cycle < 0 ) && ( length > 0 ) ) {
1753 animTime =
AnimTime( currentTime );
1756 return frameinfo.
frame1 + 1;
1786 fromFrameTime =
AnimTime( fromtime );
1788 if ( toFrameTime < fromFrameTime ) {
1789 toFrameTime += anim->
Length();
1796 if ( fromFrameTime <= 0 ) {
1809 bool idAnimBlend::BlendAnim(
int currentTime,
int channel,
int numJoints,
idJointQuat *blendFrame,
float &blendWeight,
bool removeOriginOffset,
bool overrideBlend,
bool printInfo )
const {
1826 float weight =
GetWeight( currentTime );
1827 if ( blendWeight > 0.0
f ) {
1834 if ( overrideBlend ) {
1835 blendWeight = 1.0f - weight;
1841 jointFrame = blendFrame;
1844 jointFrame = (
idJointQuat * )_alloca16( numJoints *
sizeof( *jointFrame ) );
1850 if ( numAnims == 1 ) {
1863 mixFrame = (
idJointQuat * )_alloca16( numJoints *
sizeof( *jointFrame ) );
1871 for( i = 0; i < numAnims; i++ ) {
1883 if ( ptr != jointFrame ) {
1896 if ( removeOriginOffset ) {
1898 #ifdef VELOCITY_MOVE
1899 jointFrame[ 0 ].
t.
x = 0.0f;
1901 jointFrame[ 0 ].
t.
Zero();
1906 jointFrame[ 0 ].
q.
Set( -0.70710677
f, 0.0
f, 0.0
f, 0.70710677
f );
1910 if ( !blendWeight ) {
1911 blendWeight = weight;
1915 for( i = 0; i <
num; i++ ) {
1917 blendFrame[
j].
t = jointFrame[
j].
t;
1918 blendFrame[
j].
q = jointFrame[
j].
q;
1922 blendWeight += weight;
1923 lerp = weight / blendWeight;
1960 if (
allowMove && removeOriginOffset ) {
1964 float weight =
GetWeight( currentTime );
1973 for( i = 0; i <
num; i++ ) {
1978 if ( !blendWeight ) {
1980 blendWeight = weight;
1982 lerp = weight / ( blendWeight + weight );
1983 blendPos += lerp * ( pos - blendPos );
1984 blendWeight += weight;
2020 if ( time2 < time1 ) {
2028 for( i = 0; i <
num; i++ ) {
2033 pos2 += animpos * animWeights[
i ];
2036 delta = pos2 - pos1;
2037 if ( !blendWeight ) {
2039 blendWeight = weight;
2041 lerp = weight / ( blendWeight + weight );
2042 blendDelta += lerp * ( delta - blendDelta );
2043 blendWeight += weight;
2079 if ( time2 < time1 ) {
2083 q1.
Set( 0.0
f, 0.0
f, 0.0
f, 1.0
f );
2084 q2.
Set( 0.0
f, 0.0
f, 0.0
f, 1.0
f );
2088 for( i = 0; i <
num; i++ ) {
2097 q1.
Slerp( q1, q3, lerp );
2100 q2.
Slerp( q1, q3, lerp );
2106 if ( !blendWeight ) {
2108 blendWeight = weight;
2110 lerp = weight / ( blendWeight + weight );
2111 blendDelta.
Slerp( blendDelta, q3, lerp );
2112 blendWeight += weight;
2138 float weight =
GetWeight( currentTime );
2146 addorigin = !
allowMove || !removeOriginOffset;
2147 for( i = 0; i <
num; i++ ) {
2213 for( i = 0; i <
anims.
Num(); i++ ) {
2266 for( i = 0; i <
joints.
Num(); i++, joint++ ) {
2311 while( ( *pos != 0 ) && isspace( *pos ) ) {
2323 if ( *pos ==
'-' ) {
2330 if ( *pos ==
'*' ) {
2334 getChildren =
false;
2337 while( ( *pos != 0 ) && !isspace( *pos ) ) {
2354 if ( getChildren ) {
2357 for( i = joint->
num + 1; i < num; i++, child++ ) {
2417 (*jointList) =
NULL;
2418 frameBounds.
Clear();
2437 if ( removeOriginOffset ) {
2438 #ifdef VELOCITY_MOVE
2475 memset( md5anims, 0,
sizeof( md5anims ) );
2478 src.
Warning(
"Unexpected end of file" );
2484 for( i = 0; i <
anims.
Num(); i++ ) {
2485 if ( !
strcmp(
anims[ i ]->FullName(), realname ) ) {
2490 if ( ( i <
anims.
Num() ) && ( i >= numDefaultAnims ) ) {
2491 src.
Warning(
"Duplicate anim '%s'", realname.
c_str() );
2496 if ( i < numDefaultAnims ) {
2506 for( i = len - 1; i > 0; i-- ) {
2507 if ( !isdigit( alias[ i ] ) ) {
2514 src.
Warning(
"Invalid animation name '%s'", alias.
c_str() );
2525 src.
Warning(
"Unexpected end of file" );
2533 src.
Warning(
"Couldn't load anim '%s'", token.
c_str() );
2540 if ( numAnims > 0 ) {
2543 src.
Warning(
"Anim '%s' does not match length of anim '%s'", md5anim->
Name(), md5anims[ 0 ]->
Name() );
2556 md5anims[ numAnims ] = md5anim;
2561 src.
Warning(
"No animation specified" );
2566 anim->
SetAnim(
this, realname, alias, numAnims, md5anims );
2567 memset( &flags, 0,
sizeof( flags ) );
2573 src.
Warning(
"Unexpected end of file" );
2577 if ( token ==
"}" ) {
2579 }
else if ( token ==
"prevent_idle_override" ) {
2581 }
else if ( token ==
"random_cycle_start" ) {
2583 }
else if ( token ==
"ai_no_turn" ) {
2585 }
else if ( token ==
"anim_turn" ) {
2587 }
else if ( token ==
"frame" ) {
2594 src.
Warning(
"Missing frame # after 'frame'" );
2599 src.
Warning(
"Invalid frame # after 'frame'" );
2603 src.
Error(
"expected integer value, found '%s'", token.
c_str() );
2648 int numDefaultAnims;
2654 numDefaultAnims = 0;
2660 if ( !token.
Icmp(
"}" ) ) {
2664 if ( token ==
"inherit" ) {
2666 src.
Warning(
"Unexpected end of file" );
2682 }
else if ( token ==
"skin" ) {
2684 src.
Warning(
"Unexpected end of file" );
2694 }
else if ( token ==
"mesh" ) {
2696 src.
Warning(
"Unexpected end of file" );
2703 src.
Warning(
"Invalid model for MD5 mesh" );
2709 src.
Warning(
"Model '%s' not found", filename.
c_str() );
2715 src.
Warning(
"Model '%s' defaulted", filename.
c_str() );
2723 src.
Warning(
"Model '%s' has no joints", filename.
c_str() );
2732 md5joint = md5joints;
2733 for( i = 0; i <
num; i++, md5joint++ ) {
2736 if ( md5joint->
parent ) {
2744 }
else if ( token ==
"remove" ) {
2747 src.
Warning(
"Unexpected end of file" );
2752 for( i = 0; i <
anims.
Num(); i++ ) {
2753 if ( ( token2 ==
anims[ i ]->Name() ) || ( token2 ==
anims[
i ]->FullName() ) ) {
2756 if ( i >= numDefaultAnims ) {
2757 src.
Warning(
"Anim '%s' was not inherited. Anim should be removed from the model def.", token2.
c_str() );
2768 src.
Warning(
"Couldn't find anim '%s' to remove", token2.
c_str() );
2772 }
else if ( token ==
"anim" ) {
2774 src.
Warning(
"Must specify mesh before defining anims" );
2778 if ( !
ParseAnim( src, numDefaultAnims ) ) {
2782 }
else if ( token ==
"offset" ) {
2784 src.
Warning(
"Expected vector following 'offset'" );
2788 }
else if ( token ==
"channel" ) {
2790 src.
Warning(
"Must specify mesh before defining channels" );
2797 src.
Warning(
"Unexpected end of file" );
2802 src.
Warning(
"Expected { after '%s'\n", token2.
c_str() );
2808 if ( !
idStr::Icmp( channelNames[ i ], token2 ) ) {
2813 if ( i >= ANIM_NumAnimChannels ) {
2824 src.
Warning(
"Unexpected end of file" );
2828 jointnames += token2;
2829 if ( ( token2 !=
"*" ) && ( token2 !=
"-" ) ) {
2837 for( num = i = 0; i < jointList.
Num(); i++ ) {
2838 jointnum = jointList[
i ];
2843 joints[ jointnum ].channel = channel;
2870 for( i = 0; i <
anims.
Num(); i++ ) {
2899 for( i = 0; i <
anims.
Num(); i++ ) {
2915 if ( ( index < 1 ) || ( index >
anims.
Num() ) ) {
2919 return anims[ index - 1 ];
2930 const int MAX_ANIMS = 64;
2931 int animList[ MAX_ANIMS ];
2935 len = strlen( name );
2943 for( i = 0; i <
anims.
Num(); i++ ) {
2945 animList[ numAnims++ ] =
i;
2946 if ( numAnims >= MAX_ANIMS ) {
2959 return animList[ which ] + 1;
3017 if ( ( jointHandle < 0 ) || ( jointHandle >
joints.
Num() ) ) {
3018 gameLocal.
Error(
"idDeclModelDef::GetJoint : joint handle out of range" );
3020 return &
joints[ jointHandle ];
3035 if ( ( jointHandle < 0 ) || ( jointHandle >
joints.
Num() ) ) {
3036 gameLocal.
Error(
"idDeclModelDef::GetJointName : joint handle out of range" );
3040 return joint[ jointHandle ].
name.
c_str();
3050 gameLocal.
Error(
"idDeclModelDef::NumJointsOnChannel : channel out of range" );
3062 gameLocal.
Error(
"idDeclModelDef::GetChannelJoints : channel out of range" );
3162 for ( j = 0; j < 12; j++ ) {
3224 for( i = 0; i <
num; i++ ) {
3237 for ( j = 0; j < 12; j++ ) {
3327 if ( !channel[ 0 ].GetWeight( currentTime ) || ( channel[ 0 ].starttime == currentTime ) ) {
3332 channel[
i ] = channel[ i - 1 ];
3336 channel[ 1 ].
Clear( currentTime, blendTime );
3351 if ( !modelname || !*modelname ) {
3361 if ( !renderModel ) {
3528 gameLocal.
Error(
"idAnimator::CurrentAnim : channel out of range" );
3531 return &
channels[ channelNum ][ 0 ];
3549 blend->
Clear( currentTime, cleartime );
3561 gameLocal.
Error(
"idAnimator::SetFrame : channel out of range" );
3568 PushAnims( channelNum, currentTime, blendTime );
3582 gameLocal.
Error(
"idAnimator::CycleAnim : channel out of range" );
3589 PushAnims( channelNum, currentTime, blendTime );
3603 gameLocal.
Error(
"idAnimator::PlayAnim : channel out of range" );
3610 PushAnims( channelNum, currentTime, blendTime );
3624 gameLocal.
Error(
"idAnimator::SyncToChannel : channel out of range" );
3632 PushAnims( channelNum, currentTime, blendTime );
3633 toBlend = fromBlend;
3637 toBlend.
SetWeight( weight, currentTime - 1, blendTime );
3662 if (
jointMods[ i ]->jointnum == jointnum ) {
3665 }
else if (
jointMods[ i ]->jointnum > jointnum ) {
3678 jointMod->
pos = pos;
3702 if (
jointMods[ i ]->jointnum == jointnum ) {
3705 }
else if (
jointMods[ i ]->jointnum > jointnum ) {
3718 jointMod->
mat = mat;
3740 if (
jointMods[ i ]->jointnum == jointnum ) {
3745 }
else if (
jointMods[ i ]->jointnum > jointnum ) {
3772 Clear( i, currentTime, cleartime );
3799 blend->
BlendDelta( fromtime, totime, delta, blendWeight );
3805 blend->
BlendDelta( fromtime, totime, delta, blendWeight );
3826 q.
Set( 0.0
f, 0.0
f, 0.0
f, 1.0
f );
3841 if ( blendWeight > 0.0
f ) {
3927 if ( bounds[1][0] - bounds[0][0] > 2048 || bounds[1][1] - bounds[0][1] > 2048 ) {
3985 const int * jointParent;
4004 if ( numJoints != md5anim->
NumJoints() ) {
4013 #ifdef VELOCITY_MOVE
4014 jointFrame[ 0 ].
t.
x = 0.0f;
4016 jointFrame[ 0 ].
t.
Zero();
4058 parentNum = jointParent[
i];
4063 joints[
i].
SetTranslation( joints[parentNum].ToVec3() + joints[i].ToVec3() * joints[parentNum].ToMat3() );
4067 joints[
i].
SetRotation( joints[i].ToMat3() * joints[parentNum].ToMat3() );
4089 bool *blendJoints = (
bool *) _alloca16( numJoints *
sizeof(
bool ) );
4090 memset( blendJoints, 0, numJoints *
sizeof(
bool ) );
4095 blendJoints[jointNum] =
true;
4102 if ( blendJoints[i] ) {
4207 if ( !blend->
IsDone( currentTime ) ) {
4264 const int * jointParent;
4306 if ( !defaultPose ) {
4323 if ( baseBlend >= 1.0
f ) {
4330 if ( baseBlend < 1.0
f ) {
4339 blendWeight = baseBlend;
4344 if ( blendWeight >= 1.0
f ) {
4360 blendWeight = baseBlend;
4364 if ( blendWeight >= 1.0
f ) {
4440 parentNum = jointParent[
i];
4545 if ( ( jointHandle < 0 ) || ( jointHandle >= modelJoints.
Num() ) ) {
4552 if ( jointHandle > 0 ) {
4554 m /=
joints[ modelJoints[ jointHandle ].parentNum ];
4601 if ( ( joint < 0 ) || ( joint >=
numJoints ) ) {
4602 gameLocal.
Error(
"idAnimator::GetChannelForJoint: invalid joint num (%d)", joint );
4636 for( i = 0; i <
num; i++, joint++ ) {
4651 *jointsPtr = this->
joints;
4667 memset( &result, 0,
sizeof( result ) );
4707 return anim->
Name();
4874 const char *modelname;
4886 animNum = modelDef->
GetAnim( animname );
4888 anim = modelDef->
GetAnim( animNum );
4903 const char *modelname;
4920 const char *modelname;
4982 if ( numJoints != model->
NumJoints() ) {
4983 gameLocal.
Error(
"ANIM_CreateAnimFrame: different # of joints in renderEntity_t than in model (%s)", model->
Name() );
4992 gameLocal.
Error(
"ANIM_CreateAnimFrame: NULL joint frame pointer on model (%s)", model->
Name() );
4997 for( i = 0; i < numJoints; i++ ) {
5005 index = (
int * )_alloca16( numJoints *
sizeof(
int ) );
5006 for ( i = 0; i < numJoints; i++ ) {
5019 if ( remove_origin_offset ) {
5027 for( i = 1; i < numJoints; i++ ) {
5028 joints[
i] *= joints[ md5joints[
i].
parent - md5joints ];
5059 memset( &ent, 0,
sizeof( ent ) );
5066 animNum = modelDef->
GetAnim( animname );
5070 anim = modelDef->
GetAnim( animNum );
5078 filename = animname;
5080 if ( !extension.
Length() ) {
5081 animname = args->
GetString(
va(
"anim %s", animname ) );
int GetLineNum(void) const
GLdouble GLdouble GLdouble GLdouble q
const idEventDef AI_DisableEyeFocus("disableEyeFocus")
int CheckTokenString(const char *string)
const idEventDef AI_DirectDamage
int NumJoints(void) const
idBounds & TranslateSelf(const idVec3 &translation)
bool ParseAnim(idLexer &src, int numDefaultAnims)
int GetChannelForJoint(jointHandle_t joint) const
virtual void VPCALL ConvertJointQuatsToJointMats(idJointMat *jointMats, const idJointQuat *jointQuats, const int numJoints)=0
bool AddBounds(const idBounds &a)
bool GetJointTransform(jointHandle_t jointHandle, int currenttime, idVec3 &offset, idMat3 &axis)
bool GetBounds(int currentTime, idBounds &bounds)
void SetCycleCount(int count)
virtual idRenderModel * InstantiateDynamicModel(const struct renderEntity_s *ent, const struct viewDef_s *view, idRenderModel *cachedModel)=0
void Save(idSaveGame *savefile) const
assert(prefInfo.fullscreenBtn)
virtual const idSoundShader * FindSound(const char *name, bool makeDefault=true)=0
const idDict * FindEntityDefDict(const char *name, bool makeDefault=true) const
void SyncAnimChannels(int channelNum, int fromChannelNum, int currenttime, int blendTime)
bool IsAnimating(int currentTime) const
jointHandle_t GetFirstChild(jointHandle_t jointnum) const
void FinishAFPose(int animnum, const idBounds &bounds, const int time)
idMat3 mat3_identity(idVec3(1, 0, 0), idVec3(0, 1, 0), idVec3(0, 0, 1))
void SetAnimFlags(const animFlags_t &animflags)
void WriteObject(const idClass *obj)
const idEventDef AI_BeginAttack
const char * GetFileName(void) const
virtual bool Parse(const char *text, const int textLength)
const int * JointParents(void) const
const int DECL_LEXER_FLAGS
const jointInfo_t * FindJoint(const char *name) const
void Printf(const char *fmt,...) const id_attribute((format(printf
void Clear(int currentTime, int clearTime)
const idEventDef AI_EnableEyeFocus("enableEyeFocus")
virtual idRenderModel * ANIM_CreateMeshForAnim(idRenderModel *model, const char *classname, const char *animname, int frame, bool remove_origin_offset)
idRenderModel * modelHandle
const idVec3 & TotalMovementDelta(void) const
void SetFrame(const idDeclModelDef *modelDef, int animnum, int frame, int currenttime, int blendtime)
virtual size_t Size(void) const
virtual int ANIM_GetNumAnimsFromEntityDef(const idDict *args)
void SetNum(int newnum, bool resize=true)
bool SetSyncedAnimWeight(int num, float weight)
idMat3 ToMat3(void) const
const idEventDef EV_Activate("activate","e")
idRenderModel * ModelHandle(void) const
void void void void void Error(const char *fmt,...) const id_attribute((format(printf
const int ANIMCHANNEL_ALL
int NumJoints(void) const
void GetBounds(idBounds &bounds, int currentTime, int cyclecount) const
const int ANIM_MaxSyncedAnims
const idEventDef AI_MuzzleFlash
int Parse1DMatrix(int x, float *m)
const idEventDef AI_DisableGravity
idEntity * FindEntity(const char *name) const
bool AddBounds(int currentTime, idBounds &bounds, bool removeOriginOffset) const
float GetWeight(int currenttime) const
void AllowFrameCommands(bool allow)
const idEventDef AI_FireMissileAtTarget
int AnimTime(int currenttime) const
virtual void FreeData(void)
const int ANIMCHANNEL_EYELIDS
const idEventDef AI_JumpFrame
bool ProcessEvent(const idEventDef *ev)
void PlayAnim(int channelNum, int animnum, int currenttime, int blendTime)
float GetPlaybackRate(void) const
void SetGranularity(int newgranularity)
bool CreateFrame(int animtime, bool force)
const idEventDef EV_EnableLegIK("EnableLegIK","d")
int FindFrameForFrameCommand(frameCommandType_t framecommand, const frameCommand_t **command) const
jointHandle_t GetJointHandle(const char *name) const
int NumSyncedAnims(int animnum) const
const class idDeclModelDef * modelDef
const char * GetName(void) const
void ReadBool(bool &value)
void BlendDelta(int fromtime, int totime, idVec3 &blendDelta, float &blendWeight) const
const char * AnimName(int animnum) const
const char * Left(int len, idStr &result) const
bool FrameHasChanged(int currentTime) const
virtual const char * Name() const =0
idCVar r_showSkel("r_showSkel","0", CVAR_RENDERER|CVAR_INTEGER,"draw the skeleton when model animates, 1 = draw model with skeleton, 2 = draw skeleton only", 0, 2, idCmdSystem::ArgCompletion_Integer< 0, 2 >)
GLuint GLuint GLsizei GLenum type
const idDeclSkin * GetSkin(void) const
void GetOrigin(int currentTime, idVec3 &pos) const
void SetJointPos(jointHandle_t jointnum, jointModTransform_t transform_type, const idVec3 &pos)
const idEventDef AI_EnableClip
void GetOrigin(idVec3 &offset, int currentTime, int cyclecount) const
int NumJointsOnChannel(int channel) const
const idDeclModelDef * modelDef
bool BlendAnim(int currentTime, int channel, int numJoints, idJointQuat *blendFrame, float &blendWeight, bool removeOrigin, bool overrideBlend, bool printInfo) const
int ReadTokenOnLine(idToken *token)
void IncreaseRefs(void) const
idQuat & Slerp(const idQuat &from, const idQuat &to, float t)
bool HasFrameCommands(void) const
void CheckModelHierarchy(const idRenderModel *model) const
void SetStartTime(int startTime)
const idVec3 & TotalMovementDelta(int animnum) const
const char * GetJointName(int jointHandle) const
int Cmpn(const char *text, int n) const
void SetAnim(const idDeclModelDef *modelDef, const char *sourcename, const char *animname, int num, const idMD5Anim *md5anims[ANIM_MaxSyncedAnims])
bool FrameHasChanged(int animtime) const
void Restore(idRestoreGame *savefile)
void WriteVec3(const idVec3 &vec)
void SetTranslation(const idVec3 &t)
const idEventDef AI_DisableClip
idList< int > channelJoints[ANIM_NumAnimChannels]
bool stoppedAnimatingUpdate
const jointInfo_t * GetJoint(int jointHandle) const
virtual void ANIM_CreateAnimFrame(const idRenderModel *model, const idMD5Anim *anim, int numJoints, idJointMat *frame, int time, const idVec3 &offset, bool remove_origin_offset)
void Reset(const idDeclModelDef *_modelDef)
void Set(float x, float y, float z, float w)
const idEventDef EV_EnableWalkIK("EnableWalkIK")
int Icmp(const char *text) const
idList< int > AFPoseJoints
bool GetBounds(idBounds &bounds, int animNum, int time, int cyclecount) const
void SetJointAxis(jointHandle_t jointnum, jointModTransform_t transform_type, const idMat3 &mat)
virtual const char * ANIM_GetAnimNameFromEntityDef(const idDict *args, int animNum)
virtual void VPCALL ConvertJointMatsToJointQuats(idJointQuat *jointQuats, const idJointMat *jointMats, const int numJoints)=0
void SetRotation(const idMat3 &m)
void WriteBool(const bool value)
static bool CharIsNumeric(int c)
void void void Warning(const char *fmt,...) const id_attribute((format(printf
virtual const idMD5Joint * GetJoints(void) const =0
const idEventDef EV_DisableWalkIK("DisableWalkIK")
const char * AnimName(void) const
virtual void BufferCommandText(cmdExecution_t exec, const char *text)=0
bool StartSoundShader(const idSoundShader *shader, const s_channelType channel, int soundShaderFlags, bool broadcast, int *length)
idList< frameCommand_t > frameCommands
void ClearAllJoints(void)
const char * AnimFullName(void) const
int GetFrameNumber(int currenttime) const
void Error(const char *str,...) id_attribute((format(printf
idRenderModel * SetModel(const char *modelname)
void GetDelta(int fromtime, int totime, idVec3 &delta) const
void CallFrameCommand(idEntity *ent, const function_t *frameCommand)
virtual const char * GetJointName(jointHandle_t handle) const =0
GLuint GLuint GLsizei count
void WriteShort(const short value)
static const idEventDef * FindEvent(const char *name)
const idEventDef EV_FootstepLeft("leftFoot")
void RemoveOriginOffset(bool remove)
int PlayLength(void) const
const int ANIM_MaxAnimsPerChannel
idMD5Anim * GetAnim(const char *name)
const idDeclModelDef * ANIM_GetModelDefFromEntityDef(const idDict *args)
void SetSkin(const idDeclSkin *skin)
const char * GetString(const char *key, const char *defaultString="") const
GLubyte GLubyte GLubyte GLubyte w
void ReadFloat(float &value)
bool StartSound(const char *soundName, const s_channelType channel, int soundShaderFlags, bool broadcast, int *length)
idVec3 vec3_origin(0.0f, 0.0f, 0.0f)
virtual void VPCALL BlendJoints(idJointQuat *joints, const idJointQuat *blendJoints, const float lerp, const int *index, const int numJoints)=0
void SetupJoints(int *numJoints, idJointMat **jointList, idBounds &frameBounds, bool removeOriginOffset) const
const idList< jointInfo_t > & Joints(void) const
const animFlags_t & GetAnimFlags(void) const
idVec3 ToVec3(void) const
void WriteFloat(const float value)
void ClearAllAnims(int currentTime, int cleartime)
const idMD5Anim * MD5Anim(int num) const
const idMD5Joint * parent
idAnimBlend * CurrentAnim(int channelNum)
const idDeclSkin * customSkin
virtual idRenderModel * FindModel(const char *modelName)=0
void ReadModelDef(const idDeclModelDef *&modelDef)
virtual const idDecl * FindType(declType_t type, const char *name, bool makeDefault=true)=0
idCVar g_debugBounds("g_debugBounds","0", CVAR_GAME|CVAR_BOOL,"checks for models with bounds > 2048")
GLsizei GLsizei GLenum GLenum const GLvoid * data
int GetInteger(void) const
bool GetJointLocalTransform(jointHandle_t jointHandle, int currentTime, idVec3 &offset, idMat3 &axis)
void * Mem_Alloc16(const int size)
const idAnim * GetAnim(int index) const
idList< jointMod_t * > jointMods
void CycleAnim(int channelNum, int animnum, int currenttime, int blendtime)
idList< idJointQuat > AFPoseJointFrame
const idEventDef EV_DisableLegIK("DisableLegIK","d")
const int ANIM_NumAnimChannels
const float * ToFloatPtr(void) const
void GetJointList(const char *jointnames, idList< jointHandle_t > &jointList) const
void GetInterpolatedFrame(frameBlend_t &frame, idJointQuat *joints, const int *index, int numIndexes) const
const idEventDef AI_AttackMissile
bool GetOrigin(idVec3 &offset, int animNum, int time, int cyclecount) const
const char * FullName(void) const
virtual const idJointQuat * GetDefaultPose(void) const =0
void GetJointList(const char *jointnames, idList< jointHandle_t > &jointList) const
virtual idRenderModel * ANIM_GetModelFromName(const char *modelName)
int NumFrames(void) const
const char * Name(void) const
size_t Allocated(void) const
virtual int ANIM_GetNumFrames(const idMD5Anim *anim)
void DeleteContents(bool clear)
float GetFinalWeight(void) const
const char * Right(int len, idStr &result) const
void ServiceAnims(int fromtime, int totime)
const idDeclModelDef * ModelDef(void) const
int Find(const char c, int start=0, int end=-1) const
void CycleAnim(const idDeclModelDef *modelDef, int animnum, int currenttime, int blendtime)
void SetWeight(float newweight, int currenttime, int blendtime)
const animFlags_t GetAnimFlags(int animnum) const
const idEventDef EV_Footstep("footstep")
int GetCycleCount(void) const
void PushAnims(int channel, int currentTime, int blendTime)
void GetJoints(int *numJoints, idJointMat **jointsPtr)
const idVec3 & GetVisualOffset(void) const
const char * Name(void) const
const idDeclSkin * GetDefaultSkin(void) const
int LoadMemory(const char *ptr, int length, const char *name, int startLine=1)
idList< idAFPoseJointMod > AFPoseJointMods
virtual idBounds Bounds(const struct renderEntity_s *ent=NULL) const =0
void ClearForceUpdate(void)
virtual const idMD5Anim * ANIM_GetAnimFromEntityDef(const char *classname, const char *animname)
int GetNumArgs(void) const
void Save(idSaveGame *savefile) const
void ReadBounds(idBounds &bounds)
const class idDeclModelDef * modelDef
const idSoundShader * soundShader
int NumJoints(void) const
void WriteInt(const int value)
const char * GetModelName(void) const
virtual void VPCALL Memcpy(void *dst, const void *src, const int count)=0
idDeclManager * declManager
void WriteMat3(const idMat3 &mat)
virtual void VPCALL UntransformJoints(idJointMat *jointMats, const int *parents, const int firstJoint, const int lastJoint)=0
bool IsDone(int currentTime) const
const idDeclModelDef * ModelDef(void) const
bool GetDeltaRotation(int fromtime, int totime, idMat3 &delta) const
void ReadMat3(idMat3 &mat)
idMat3 ToMat3(void) const
jointModTransform_t transform_pos
const idEventDef AI_CreateMissile
virtual void VPCALL TransformJoints(idJointMat *jointMats, const int *parents, const int firstJoint, const int lastJoint)=0
int AnimLength(int animnum) const
int Insert(const type &obj, int index=0)
void CallObjectFrameCommand(idEntity *ent, const char *frameCommand)
int Append(const type &obj)
void void Warning(const char *str,...) id_attribute((format(printf
bool HasAnim(const char *name) const
const idEventDef AI_TriggerParticles
virtual jointHandle_t GetJointHandle(const char *name) const =0
idRenderModelManager * renderModelManager
static WindowRef ValidModeCallbackProc inCallback OSStatus err
void DecreaseRefs(void) const
virtual const idDecl * FindDeclWithoutParsing(declType_t type, const char *name, bool makeDefault=true)=0
virtual bool IsDefaultModel() const =0
virtual const char * DefaultDefinition(void) const
int AddUnique(const type &obj)
jointModTransform_t transform_axis
const char * AnimFullName(int animnum) const
void BlendDeltaRotation(int fromtime, int totime, idQuat &blendDelta, float &blendWeight) const
bool GetOriginRotation(idQuat &rotation, int animNum, int currentTime, int cyclecount) const
void PlayAnim(const idDeclModelDef *modelDef, int animnum, int currenttime, int blendtime)
bool IsCleared(void) const
idAnimBlend channels[ANIM_NumAnimChannels][ANIM_MaxAnimsPerChannel]
const idEventDef EV_FootstepRight("rightFoot")
idList< jointInfo_t > joints
virtual bool CanPlayChatterSounds(void) const
bool RemoveIndex(int index)
const idEventDef AI_EndAttack
void ReadShort(short &value)
declState_t GetState(void) const
const char * AddFrameCommand(const class idDeclModelDef *modelDef, int framenum, idLexer &src, const idDict *def)
virtual int ANIM_GetLength(const idMD5Anim *anim)
void Signal(signalNum_t signalnum)
idList< frameLookup_t > frameLookup
idList< int > jointParents
const idVec3 & TotalMovementDelta(void) const
void Mem_Free16(void *ptr)
bool BlendAFPose(idJointQuat *blendFrame) const
void AllowMovement(bool allow)
GLsizei const GLcharARB const GLint * length
const char * GetName(void) const
virtual const idVec3 & ANIM_GetModelOffsetFromEntityDef(const char *classname)
void ReadVec3(idVec3 &vec)
idAnimManager animationLib
int suppressSurfaceInViewID
const char * c_str(void) const
int SkipUntilString(const char *string)
void CallFrameCommands(idEntity *ent, int fromtime, int totime) const
void SetAFPoseBlendWeight(float blendWeight)
void Clear(int channelNum, int currentTime, int cleartime)
int NumFrames(int animnum) const
const idAnim * GetAnim(int index) const
const idEventDef AI_AttackMelee
ID_INLINE int FRAME2MS(int framenum)
virtual const idMD5Anim * ANIM_GetAnim(const char *fileName)
const char * GetJointName(jointHandle_t handle) const
void BecomeActive(int flags)
virtual int NumJoints(void) const =0
void CallFrameCommands(idEntity *ent, int from, int to) const
void WriteBounds(const idBounds &bounds)
function_t * FindFunction(const char *name) const
int GetEndTime(void) const
void SetFrame(int channelNum, int animnum, int frame, int currenttime, int blendtime)
idCVar g_debugAnim("g_debugAnim","-1", CVAR_GAME|CVAR_INTEGER,"displays information on which animations are playing on the specified entity number. set to -1 to disable.")
const idAnim * Anim(void) const
virtual const idDeclSkin * FindSkin(const char *name, bool makeDefault=true)=0
void WriteModelDef(const class idDeclModelDef *modelDef)
int NumFrames(void) const
idRenderModel * ModelHandle(void) const
bool prevent_idle_override
void GetSingleFrame(int framenum, idJointQuat *joints, const int *index, int numIndexes) const
int GetStartTime(void) const
void GetOriginRotation(idQuat &rotation, int time, int cyclecount) const
void BlendOrigin(int currentTime, idVec3 &blendPos, float &blendWeight, bool removeOriginOffset) const
const int * GetChannelJoints(int channel) const
const idDeclEntityDef * FindEntityDef(const char *name, bool makeDefault=true) const
idQuat Inverse(void) const
void CopyDecl(const idDeclModelDef *decl)
char * va(const char *fmt,...)
void ExtractFileExtension(idStr &dest) const
static idEntityFx * StartFx(const char *fx, const idVec3 *useOrigin, const idMat3 *useAxis, idEntity *ent, bool bind)
int GetSpecificAnim(const char *name) const
bool HasAnim(const char *name) const
virtual idRenderModel * ANIM_GetModelFromEntityDef(const char *classname)
float animWeights[ANIM_MaxSyncedAnims]
idEntity * GetEntity(void) const
virtual void virtual void Warning(const char *fmt,...) id_attribute((format(printf
size_t Allocated(void) const
void Restore(idRestoreGame *savefile, const idDeclModelDef *modelDef)
void SetAFPoseJointMod(const jointHandle_t jointNum, const AFJointModType_t mod, const idMat3 &axis, const idVec3 &origin)
void BecomeInactive(int flags)
const idJointQuat * GetDefaultPose(void) const
const function_t * function
int ReadToken(idToken *token)
bool Remove(const type &obj)
void ConvertTimeToFrame(int time, int cyclecount, frameBlend_t &frame) const
void ClearJoint(jointHandle_t jointnum)
void SetEntity(idEntity *ent)
const idMD5Anim * anims[ANIM_MaxSyncedAnims]
void ReadObject(idClass *&obj)
int NumSyncedAnims(void) const
const idEventDef AI_EnableGravity
size_t MemoryUsed(void) const
int NumFrames(void) const
bool RemoveOrigin(void) const
void SetPlaybackRate(int currentTime, float newRate)
idSIMDProcessor * SIMDProcessor