1 /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */
2 
3 #ifndef LASER_PROJECTILE_H
4 #define LASER_PROJECTILE_H
5 
6 #include "WeaponProjectile.h"
7 #include "Sim/Misc/DamageArray.h"
8 
9 class CLaserProjectile : public CWeaponProjectile
10 {
11 	CR_DECLARE(CLaserProjectile)
12 public:
13 	CLaserProjectile(const ProjectileParams& params);
14 
15 	void Draw();
16 	void Update();
17 	void Collision(CUnit* unit);
18 	void Collision(CFeature* feature);
19 	void Collision();
20 	int ShieldRepulse(CPlasmaRepulser* shield, float3 shieldPos, float shieldForce, float shieldMaxSpeed);
21 
22 private:
23 	void UpdateIntensity();
24 	void UpdateLength();
25 	void UpdatePos(const float4& oldSpeed);
26 	void CollisionCommon(const float3& oldPos);
27 
28 private:
29 	float speedf;
30 
31 	float maxLength;
32 	float curLength;
33 	float intensity;
34 	float intensityFalloff;
35 	float midtexx;
36 
37 	/**
38 	 * Number of frames the laser had left to expand
39 	 * if it impacted before reaching full length.
40 	 */
41 	int stayTime;
42 
43 	float3 color;
44 	float3 color2;
45 };
46 
47 #endif /* LASER_PROJECTILE_H */
48