SEGS  0.6.1-develop [d2cac982]
Super Entity Game Server
WorldSimulation.h
Go to the documentation of this file.
1 /*
2  * SEGS - Super Entity Game Server
3  * http://www.segs.io/
4  * Copyright (c) 2006 - 2019 SEGS Team (see AUTHORS.md)
5  * This software is licensed under the terms of the 3-clause BSD License. See LICENSE.md for details.
6  */
7 
8 #pragma once
9 #include <glm/matrix.hpp>
10 #include <glm/vec3.hpp>
11 #include <ace/Time_Value.h>
12 
13 #include "MapServer.h"
14 #include "GameData/Entity.h"
15 #include "EntityStorage.h"
16 #include "SceneGraph.h"
17 #include "MapSceneGraph.h"
18 
19 class World
20 {
21 public:
22  World(EntityManager &em, const float player_fade_in, MapInstance *owner_instance)
23  : ref_ent_mager(em), m_player_fade_in(player_fade_in), m_owner_instance(owner_instance) {}
24  void update(const ACE_Time_Value &tick_timer);
25  float time_of_day() const { return m_time_of_day; }
26  float sim_frame_time = 1; // in seconds
28 protected:
29  void physicsStep(Entity *e, uint32_t msec);
30  void effectsStep(Entity *e, uint32_t msec);
31  void checkPowerTimers(Entity *e, uint32_t msec);
32  bool isPlayerDead(Entity *e);
33  void regenHealthEnd(Entity *e, uint32_t msec);
34  void updateEntity(Entity *e, const ACE_Time_Value &dT);
35  void collisionStep(Entity *e, uint32_t msec);
38  float m_time_of_day = 8.0f; // hour of the day in 24h format, start at 8am
39  ACE_Time_Value prev_tick_time;
41 };
Definition: EntityStorage.h:34
EntityManager & ref_ent_mager
Definition: WorldSimulation.h:36
Definition: WorldSimulation.h:19
float time_of_day() const
Definition: WorldSimulation.h:25
void collisionStep(Entity *e, uint32_t msec)
Definition: WorldSimulation.cpp:188
void update(const ACE_Time_Value &tick_timer)
Definition: WorldSimulation.cpp:27
bool isPlayerDead(Entity *e)
Definition: WorldSimulation.cpp:151
Definition: MapInstance.h:132
float accumulated_time
Definition: WorldSimulation.h:27
Definition: Entity.h:134
float m_time_of_day
Definition: WorldSimulation.h:38
World(EntityManager &em, const float player_fade_in, MapInstance *owner_instance)
Definition: WorldSimulation.h:22
float sim_frame_time
Definition: WorldSimulation.h:26
ACE_Time_Value prev_tick_time
Definition: WorldSimulation.h:39
MapInstance * m_owner_instance
Definition: WorldSimulation.h:40
float m_player_fade_in
Definition: WorldSimulation.h:37
void regenHealthEnd(Entity *e, uint32_t msec)
Definition: WorldSimulation.cpp:163
void updateEntity(Entity *e, const ACE_Time_Value &dT)
Definition: WorldSimulation.cpp:212
void checkPowerTimers(Entity *e, uint32_t msec)
Definition: WorldSimulation.cpp:89
void physicsStep(Entity *e, uint32_t msec)
Definition: WorldSimulation.cpp:48
void effectsStep(Entity *e, uint32_t msec)
Definition: WorldSimulation.cpp:72