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

Function FX_AddEmitter

code/cgame/FxUtil.cpp:880–965  ·  view source on GitHub ↗

------------------------- FX_AddEmitter -------------------------

Source from the content-addressed store, hash-verified

878// FX_AddEmitter
879//-------------------------
880CEmitter *FX_AddEmitter( vec3_t org, vec3_t vel, vec3_t accel,
881 float size1, float size2, float sizeParm,
882 float alpha1, float alpha2, float alphaParm,
883 vec3_t rgb1, vec3_t rgb2, float rgbParm,
884 vec3_t angs, vec3_t deltaAngs,
885 vec3_t min, vec3_t max, float elasticity,
886 int deathID, int impactID, int emitterID,
887 float density, float variance,
888 int killTime, qhandle_t model, int flags )
889{
890 if ( theFxHelper.mFrameTime < 1 )
891 { // disallow adding effects when the system is paused
892 return 0;
893 }
894
895 CEmitter *fx = new CEmitter;
896
897 if ( fx )
898 {
899 fx->SetOrigin1( org );
900 fx->SetVel( vel );
901 fx->SetAccel( accel );
902
903 // RGB----------------
904 fx->SetRGBStart( rgb1 );
905 fx->SetRGBEnd( rgb2 );
906
907 if (( flags & FX_RGB_PARM_MASK ) == FX_RGB_WAVE )
908 {
909 fx->SetRGBParm( rgbParm * PI * 0.001f );
910 }
911 else if ( flags & FX_RGB_PARM_MASK )
912 {
913 // rgbParm should be a value from 0-100..
914 fx->SetRGBParm( rgbParm * 0.01f * killTime + theFxHelper.mTime );
915 }
916
917 // Size----------------
918 fx->SetSizeStart( size1 );
919 fx->SetSizeEnd( size2 );
920
921 if (( flags & FX_SIZE_PARM_MASK ) == FX_SIZE_WAVE )
922 {
923 fx->SetSizeParm( sizeParm * PI * 0.001f );
924 }
925 else if ( flags & FX_SIZE_PARM_MASK )
926 {
927 fx->SetSizeParm( sizeParm * 0.01f * killTime + theFxHelper.mTime );
928 }
929
930 // Alpha----------------
931 fx->SetAlphaStart( alpha1 );
932 fx->SetAlphaEnd( alpha2 );
933
934 if (( flags & FX_ALPHA_PARM_MASK ) == FX_ALPHA_WAVE )
935 {
936 fx->SetAlphaParm( alphaParm * PI * 0.001f );
937 }

Callers 1

CreateEffectMethod · 0.70

Calls 15

FX_AddPrimitiveFunction · 0.70
SetOrigin1Method · 0.45
SetVelMethod · 0.45
SetAccelMethod · 0.45
SetRGBStartMethod · 0.45
SetRGBEndMethod · 0.45
SetRGBParmMethod · 0.45
SetSizeStartMethod · 0.45
SetSizeEndMethod · 0.45
SetSizeParmMethod · 0.45
SetAlphaStartMethod · 0.45
SetAlphaEndMethod · 0.45

Tested by

no test coverage detected