SEGS  0.4.2
Super Entity Game Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 - 2018 SEGS Team (see Authors.txt)
5  * This software is licensed! (See License.txt 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 "NetStructures/Entity.h"
14 #include "EntityStorage.h"
15 #include "SceneGraph.h"
16 
17 class World
18 {
19 public:
21  void addPlayer(Entity *ent);
22  void update(const ACE_Time_Value &tick_timer);
23  float time_of_day() const { return m_time_of_day; }
24  float sim_frame_time = 1; // in seconds
25 protected:
26  void physicsStep(Entity *e, uint32_t msec);
27  void effectsStep(Entity *e, uint32_t msec);
28  void updateEntity(Entity *e, const ACE_Time_Value &dT);
30  float m_time_of_day = 8.0f; // hour of the day in 24h format, start at 8am
31  ACE_Time_Value prev_tick_time;
32 };
Definition: EntityStorage.h:34
EntityManager & ref_ent_mager
Definition: WorldSimulation.h:29
Definition: WorldSimulation.h:17
float time_of_day() const
Definition: WorldSimulation.h:23
void update(const ACE_Time_Value &tick_timer)
Definition: WorldSimulation.cpp:28
Definition: Entity.h:221
float m_time_of_day
Definition: WorldSimulation.h:30
World(EntityManager &em)
Definition: WorldSimulation.h:20
float sim_frame_time
Definition: WorldSimulation.h:24
ACE_Time_Value prev_tick_time
Definition: WorldSimulation.h:31
void updateEntity(Entity *e, const ACE_Time_Value &dT)
Definition: WorldSimulation.cpp:95
void physicsStep(Entity *e, uint32_t msec)
Definition: WorldSimulation.cpp:51
void effectsStep(Entity *e, uint32_t msec)
Definition: WorldSimulation.cpp:78
void addPlayer(Entity *ent)
Definition: WorldSimulation.cpp:115