Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.4 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //===========================================================================//
  7. #ifndef C_ENTITY_DISSOLVE_H
  8. #define C_ENTITY_DISSOLVE_H
  9. #include "cbase.h"
  10. //-----------------------------------------------------------------------------
  11. // Entity Dissolve, client-side implementation
  12. //-----------------------------------------------------------------------------
  13. class C_EntityDissolve : public C_BaseEntity, public IMotionEvent
  14. {
  15. public:
  16. DECLARE_CLIENTCLASS();
  17. DECLARE_CLASS( C_EntityDissolve, C_BaseEntity );
  18. C_EntityDissolve( void );
  19. // Inherited from C_BaseEntity
  20. virtual void GetRenderBounds( Vector& theMins, Vector& theMaxs );
  21. virtual int DrawModel( int flags, const RenderableInstance_t &instance );
  22. virtual bool ShouldDraw() { return true; }
  23. virtual void OnDataChanged( DataUpdateType_t updateType );
  24. virtual void UpdateOnRemove( void );
  25. // Inherited from IMotionEvent
  26. virtual simresult_e Simulate( IPhysicsMotionController *pController, IPhysicsObject *pObject, float deltaTime, Vector &linear, AngularImpulse &angular );
  27. void SetupEmitter( void );
  28. void ClientThink( void );
  29. void SetServerLinkState( bool state ) { m_bLinkedToServerEnt = state; }
  30. float m_flStartTime;
  31. float m_flFadeOutStart;
  32. float m_flFadeOutLength;
  33. float m_flFadeOutModelStart;
  34. float m_flFadeOutModelLength;
  35. float m_flFadeInStart;
  36. float m_flFadeInLength;
  37. int m_nDissolveType;
  38. float m_flNextSparkTime;
  39. Vector m_vDissolverOrigin;
  40. int m_nMagnitude;
  41. bool m_bCoreExplode;
  42. protected:
  43. float GetFadeInPercentage( void ); // Fade in amount (entity fading to black)
  44. float GetFadeOutPercentage( void ); // Fade out amount (particles fading away)
  45. float GetModelFadeOutPercentage( void );// Mode fade out amount
  46. // Compute the bounding box's center, size, and basis
  47. void ComputeRenderInfo( mstudiobbox_t *pHitBox, const matrix3x4_t &hitboxToWorld,
  48. Vector *pVecAbsOrigin, Vector *pXVec, Vector *pYVec );
  49. void BuildTeslaEffect( mstudiobbox_t *pHitBox, const matrix3x4_t &hitboxToWorld, bool bRandom, float flYawOffset );
  50. void DoSparks( mstudiohitboxset_t *set, matrix3x4_t *hitboxbones[MAXSTUDIOBONES] );
  51. private:
  52. CSmartPtr<CSimpleEmitter> m_pEmitter;
  53. bool m_bLinkedToServerEnt;
  54. IPhysicsMotionController *m_pController;
  55. };
  56. #endif // C_ENTITY_DISSOLVE_H