MCPcopy Create free account
hub / github.com/JACoders/OpenJK / FX_AddTail

Function FX_AddTail

code/cgame/FxUtil.cpp:669–766  ·  view source on GitHub ↗

------------------------- FX_AddTail -------------------------

Source from the content-addressed store, hash-verified

667// FX_AddTail
668//-------------------------
669CTail *FX_AddTail( int clientID, vec3_t org, vec3_t vel, vec3_t accel,
670 float size1, float size2, float sizeParm,
671 float length1, float length2, float lengthParm,
672 float alpha1, float alpha2, float alphaParm,
673 vec3_t sRGB, vec3_t eRGB, float rgbParm,
674 vec3_t min, vec3_t max, float elasticity,
675 int deathID, int impactID,
676 int killTime, qhandle_t shader, int flags, int modelNum, int boltNum )
677{
678 if ( theFxHelper.mFrameTime < 1 )
679 { // disallow adding effects when the system is paused
680 return 0;
681 }
682
683 CTail *fx = new CTail;
684
685 if ( fx )
686 {
687 if (flags&FX_RELATIVE && clientID>=0)
688 {
689 fx->SetOrigin1( NULL );
690 fx->SetOrgOffset( org );
691 fx->SetClient( clientID, modelNum, boltNum );
692 }
693 else
694 {
695 fx->SetOrigin1( org );
696 }
697 fx->SetVel( vel );
698 fx->SetAccel( accel );
699 // RGB----------------
700 fx->SetRGBStart( sRGB );
701 fx->SetRGBEnd( eRGB );
702
703 if (( flags & FX_RGB_PARM_MASK ) == FX_RGB_WAVE )
704 {
705 fx->SetRGBParm( rgbParm * PI * 0.001f );
706 }
707 else if ( flags & FX_RGB_PARM_MASK )
708 {
709 // rgbParm should be a value from 0-100..
710 fx->SetRGBParm( rgbParm * 0.01f * killTime + theFxHelper.mTime );
711 }
712
713 // Alpha----------------
714 fx->SetAlphaStart( alpha1 );
715 fx->SetAlphaEnd( alpha2 );
716
717 if (( flags & FX_ALPHA_PARM_MASK ) == FX_ALPHA_WAVE )
718 {
719 fx->SetAlphaParm( alphaParm * PI * 0.001f );
720 }
721 else if ( flags & FX_ALPHA_PARM_MASK )
722 {
723 fx->SetAlphaParm( alphaParm * 0.01f * killTime + theFxHelper.mTime );
724 }
725
726 // Size----------------

Callers 1

CreateEffectMethod · 0.70

Calls 15

FX_AddPrimitiveFunction · 0.70
SetOrigin1Method · 0.45
SetOrgOffsetMethod · 0.45
SetClientMethod · 0.45
SetVelMethod · 0.45
SetAccelMethod · 0.45
SetRGBStartMethod · 0.45
SetRGBEndMethod · 0.45
SetRGBParmMethod · 0.45
SetAlphaStartMethod · 0.45
SetAlphaEndMethod · 0.45
SetAlphaParmMethod · 0.45

Tested by

no test coverage detected