//------------------------- // FX_AddParticle //------------------------- CParticle *FX_AddParticle( int clientID, const vec3_t org, const vec3_t vel, const vec3_t accel, float gravity, float size1, float size2, float sizeParm, float alpha1, float alpha2, float alphaParm, const vec3_t rgb1, const vec3_t rgb2, float rgbParm, float rotation, float rotationDelta, int killTime, qhandle_t shader, int flags = 0 ) { if ( theFxHelper.mFrameTime < 1 ) { // disallow adding effects when the system is paused return 0; } CParticle *fx = new CParticle; if ( fx ) { fx->SetOrigin1( NULL ); fx->SetOrgOffset( org ); fx->SetVel( vel ); fx->SetAccel( accel ); fx->SetGravity( gravity ); // RGB---------------- fx->SetRGBStart( rgb1 ); fx->SetRGBEnd( rgb2 ); if (( flags & FX_RGB_PARM_MASK ) == FX_RGB_WAVE ) { fx->SetRGBParm( rgbParm * PI * 0.001f ); } else if ( flags & FX_RGB_PARM_MASK ) { // rgbParm should be a value from 0-100.. fx->SetRGBParm( rgbParm * 0.01f * killTime + theFxHelper.mTime ); } // Alpha---------------- fx->SetAlphaStart( alpha1 ); fx->SetAlphaEnd( alpha2 ); if (( flags & FX_ALPHA_PARM_MASK ) == FX_ALPHA_WAVE ) { fx->SetAlphaParm( alphaParm * PI * 0.001f ); } else if ( flags & FX_ALPHA_PARM_MASK ) { fx->SetAlphaParm( alphaParm * 0.01f * killTime + theFxHelper.mTime ); } // Size---------------- fx->SetSizeStart( size1 ); fx->SetSizeEnd( size2 ); if (( flags & FX_SIZE_PARM_MASK ) == FX_SIZE_WAVE ) { fx->SetSizeParm( sizeParm * PI * 0.001f ); } else if ( flags & FX_SIZE_PARM_MASK ) { fx->SetSizeParm( sizeParm * 0.01f * killTime + theFxHelper.mTime ); } fx->SetFlags( flags ); fx->SetShader( shader ); fx->SetRotation( rotation ); fx->SetRotationDelta( rotationDelta ); fx->SetElasticity( 0.0f ); fx->SetMin( NULL ); fx->SetMax( NULL ); fx->SetClient( clientID ); FX_AddPrimitive( (CEffect**)&fx, killTime ); } return fx; }
//------------------------- // FX_AddParticle //------------------------- CParticle *FX_AddParticle( vec3_t org, vec3_t vel, vec3_t accel, float size1, float size2, float sizeParm, float alpha1, float alpha2, float alphaParm, vec3_t sRGB, vec3_t eRGB, float rgbParm, float rotation, float rotationDelta, vec3_t min, vec3_t max, float elasticity, int deathID, int impactID, int killTime, qhandle_t shader, int flags = 0, EMatImpactEffect matImpactFX /*MATIMPACTFX_NONE*/, int fxParm /*-1*/, int iGhoul2/*0*/, int entNum/*-1*/, int modelNum/*-1*/, int boltNum/*-1*/ ) { if ( theFxHelper.mFrameTime < 0 ) { // disallow adding effects when the system is paused return 0; } CParticle *fx = new CParticle; if ( fx ) { if (flags&FX_RELATIVE && iGhoul2>0) { fx->SetOrigin1( NULL ); fx->SetOrgOffset( org ); fx->SetBoltinfo( iGhoul2, entNum, modelNum, boltNum ); } else { fx->SetOrigin1( org ); } fx->SetOrigin1( org ); fx->SetMatImpactFX(matImpactFX); fx->SetMatImpactParm(fxParm); fx->SetVel( vel ); fx->SetAccel( accel ); // RGB---------------- fx->SetRGBStart( sRGB ); fx->SetRGBEnd( eRGB ); if (( flags & FX_RGB_PARM_MASK ) == FX_RGB_WAVE ) { fx->SetRGBParm( rgbParm * PI * 0.001f ); } else if ( flags & FX_RGB_PARM_MASK ) { // rgbParm should be a value from 0-100.. fx->SetRGBParm(rgbParm * 0.01f * killTime + theFxHelper.mTime + theFxHelper.mTimeFraction); } // Alpha---------------- fx->SetAlphaStart( alpha1 ); fx->SetAlphaEnd( alpha2 ); if (( flags & FX_ALPHA_PARM_MASK ) == FX_ALPHA_WAVE ) { fx->SetAlphaParm( alphaParm * PI * 0.001f ); } else if ( flags & FX_ALPHA_PARM_MASK ) { fx->SetAlphaParm(alphaParm * 0.01f * killTime + theFxHelper.mTime + theFxHelper.mTimeFraction); } // Size---------------- fx->SetSizeStart( size1 ); fx->SetSizeEnd( size2 ); if (( flags & FX_SIZE_PARM_MASK ) == FX_SIZE_WAVE ) { fx->SetSizeParm( sizeParm * PI * 0.001f ); } else if ( flags & FX_SIZE_PARM_MASK ) { fx->SetSizeParm(sizeParm * 0.01f * killTime + theFxHelper.mTime + theFxHelper.mTimeFraction); } fx->SetFlags( flags ); fx->SetShader( shader ); fx->SetRotation( rotation ); fx->SetRotationDelta( rotationDelta ); fx->SetElasticity( elasticity ); fx->SetMin( min ); fx->SetMax( max ); fx->SetDeathFxID( deathID ); fx->SetImpactFxID( impactID ); fx->Init(); FX_AddPrimitive( (CEffect**)&fx, killTime ); } return fx; }
//------------------------- // FX_AddParticle //------------------------- CParticle *FX_AddParticle( const vec3_t org, const vec3_t vel, const vec3_t accel, float size1, float size2, float sizeParm, float alpha1, float alpha2, float alphaParm, const vec3_t sRGB, const vec3_t eRGB, float rgbParm, float rotation, float rotationDelta, const vec3_t min, const vec3_t max, float elasticity, int deathID, int impactID, int killTime, qhandle_t shader, int flags = 0 ) { if ( theFxHelper.mFrameTime < 1 ) { // disallow adding effects when the system is paused return 0; } CParticle *fx = new CParticle; if ( fx ) { fx->SetOrigin1( org ); fx->SetVel( vel ); fx->SetAccel( accel ); // RGB---------------- fx->SetRGBStart( sRGB ); fx->SetRGBEnd( eRGB ); if (( flags & FX_RGB_PARM_MASK ) == FX_RGB_WAVE ) { fx->SetRGBParm( rgbParm * PI * 0.001f ); } else if ( flags & FX_RGB_PARM_MASK ) { // rgbParm should be a value from 0-100.. fx->SetRGBParm( rgbParm * 0.01f * killTime + theFxHelper.mTime ); } // Alpha---------------- fx->SetAlphaStart( alpha1 ); fx->SetAlphaEnd( alpha2 ); if (( flags & FX_ALPHA_PARM_MASK ) == FX_ALPHA_WAVE ) { fx->SetAlphaParm( alphaParm * PI * 0.001f ); } else if ( flags & FX_ALPHA_PARM_MASK ) { fx->SetAlphaParm( alphaParm * 0.01f * killTime + theFxHelper.mTime ); } // Size---------------- fx->SetSizeStart( size1 ); fx->SetSizeEnd( size2 ); if (( flags & FX_SIZE_PARM_MASK ) == FX_SIZE_WAVE ) { fx->SetSizeParm( sizeParm * PI * 0.001f ); } else if ( flags & FX_SIZE_PARM_MASK ) { fx->SetSizeParm( sizeParm * 0.01f * killTime + theFxHelper.mTime ); } fx->SetFlags( flags ); fx->SetShader( shader ); fx->SetRotation( rotation ); fx->SetRotationDelta( rotationDelta ); fx->SetElasticity( elasticity ); fx->SetMin( min ); fx->SetMax( max ); fx->SetDeathFxID( deathID ); fx->SetImpactFxID( impactID ); FX_AddPrimitive( (CEffect**)&fx, killTime ); // in the editor, fx may now be NULL } return fx; }