/**
* Adds models to the map
* @author: Herwin 'harSens' van Welbergen
* @version: 21-6-2001
*/
class CEnvModel: public CBaseMonster
{	
public: 
    /**
	 * Spawns the env model
	 */
	void Spawn( ); 

	/**
	 * Precaches the env model
	 */
    void Precache( );	

	/**
	 * touch 
	 * @param pOther: touched entity
	 */
	void EXPORT EnvTouch(CBaseEntity *pOther);

	/**
	 * particle explosion
	 * @param pOther: touched entity
	 */
	void EXPORT ExplodeTouch(CBaseEntity *pOther);

	/**
	 * selects the right animations
	 */
	void EXPORT AnimateThink();

	/**
	 * rotate according to owners angles
	 */
	void EXPORT RotateThink();
	
	/**
	 * respawn
	 */	
	void EXPORT RespawnThink();
	/**
	 * Keyvalue
	 * @param pkvd keyvaluedata
	 */
	virtual void KeyValue( KeyValueData* pkvd );

	/**
	 * Takedamage
	 * makes the envmodel wiggle
	 * @param pevInflictor damageinflictor
	 * @param pevAttacker attacker
	 * @param flDamage damage to take
	 * @param bitsDamageType type of damage
	 */
	int TakeDamage(entvars_t *pevInflictor,entvars_t *pevAttacker, float flDamage, int bitsDamageType);

	/**
	 * Shoots the envmodel
	 * @param direction the direction of the shot
	 * @param charge the amount of charge 0..1
	 * @param param power the relative power of the owner
	 */
	void Shoot(Vector direction,float charge,float power);

	/**
	 * Lifts the envmodel
	 * @param pevOwner the owner
	 * @param flRaiseSpeed the raise speed
	 * @param flRaiseTime
	 */
	void Lift(entvars_t *pevOwner,float flRaiseSpeed,float flRaiseTime);

	/**
	 * Drops a lifted envmodel
	 */
	void Drop();
	
	/**
	 * Reset
	 */
	void Reset();

	int m_fLift;

	virtual	BOOL	IsEnvModel( void ) { return TRUE; }

	float m_flSize;
private:
	/**
	 * Set the correct rotated boundingbox
	 */
	void SetBoundingBox();

	/**
	 * Sets the idle or idle2 animation
	 */
	void SetIdleAnimation();

	float m_flMaxZ,m_flMinZ,m_flMaxXY,m_flMinXY;
	short m_sRockGibs;
	int m_fBoundingBox;
	Vector m_vecStart;
	Vector m_vecBBMin;
	Vector m_vecBBMax;
	Vector m_vecSpawnAngles;
};
