Voxellancer  0.3
A game about voxels in space
 All Classes Functions Pages
enginetrailgenerator.h
1 #pragma once
2 
3 #include <memory>
4 
5 #include <glm/glm.hpp>
6 
7 #include "property/property.h"
8 
9 class Engine;
10 class WorldObject;
12 
14 {
15 public:
16  EngineTrailGenerator(Engine& engine, const WorldObject& creator);
17  virtual ~EngineTrailGenerator();
18 
19  void setLifetime(float lifetime);
20  void setColor(int color);
21  void setEmissiveness(float emissiveness);
22 
23  void update(float deltaSec);
24 
25 
26 protected:
27  const WorldObject& m_creator;
28  const Engine& m_engine;
29  std::unique_ptr<VoxelExplosionGenerator> m_generator;
30 
31  glm::vec3 m_lastSpawnPoint;
32  bool m_lastValid;
33  float m_stepRest;
34  double m_timeSinceLastSpawn;
35  float m_spawnOffset;
36 
37  Property<float> prop_stepDistance;
38  Property<float> prop_idleTime;
39  void spawnTrail();
40  void updateTrailSettings();
41  glm::vec3 calculateSpawnPosition();
42  void spawnAt(glm::vec3 position);
43 };
44 
Definition: enginetrailgenerator.h:13
Definition: worldobject.h:43
Definition: voxelexplosiongenerator.h:10
Definition: engine.h:19