Pyrogenesis  trunk
ICmpProjectileManager.h
Go to the documentation of this file.
1 /* Copyright (C) 2010 Wildfire Games.
2  * This file is part of 0 A.D.
3  *
4  * 0 A.D. is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * 0 A.D. is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef INCLUDED_ICMPPROJECTILEMANAGER
19 #define INCLUDED_ICMPPROJECTILEMANAGER
20 
22 
23 #include "maths/Fixed.h"
24 #include "maths/FixedVector3D.h"
25 
26 /**
27  * Projectile manager. This deals with the rendering and the graphical motion of projectiles.
28  * (The gameplay effects of projectiles are not handled here - the simulation code does that
29  * with timers, this just does the visual aspects, because it's simpler to keep the parts separated.)
30  */
32 {
33 public:
34 
35  /**
36  * Launch a projectile from entity @p source to point @p target.
37  * @param source source entity; the projectile will determined from the "projectile" prop in its actor
38  * @param target target point
39  * @param speed horizontal speed in m/s
40  * @param gravity gravitational acceleration in m/s^2 (determines the height of the ballistic curve)
41  * @return id of the created projectile
42  */
43  virtual uint32_t LaunchProjectileAtPoint(entity_id_t source, const CFixedVector3D& target, fixed speed, fixed gravity) = 0;
44 
45  /**
46  * Removes a projectile, used when the projectile has hit a target
47  * @param id of the projectile to remove
48  */
49  virtual void RemoveProjectile(uint32_t id) = 0;
50 
51  DECLARE_INTERFACE_TYPE(ProjectileManager)
52 };
53 
54 #endif // INCLUDED_ICMPPROJECTILEMANAGER
Definition: IComponent.h:33
A simple fixed-point number class.
Definition: Fixed.h:115
Projectile manager.
Definition: ICmpProjectileManager.h:31
virtual uint32_t LaunchProjectileAtPoint(entity_id_t source, const CFixedVector3D &target, fixed speed, fixed gravity)=0
Launch a projectile from entity source to point target.
Definition: FixedVector3D.h:24
virtual void RemoveProjectile(uint32_t id)=0
Removes a projectile, used when the projectile has hit a target.
#define DECLARE_INTERFACE_TYPE(iname)
Definition: Interface.h:23
unsigned int uint32_t
Definition: wposix_types.h:53
u32 entity_id_t
Entity ID type.
Definition: Entity.h:23