Spinning Topp Logo BlackTopp Studios
inc
world.cpp
1 // © Copyright 2010 - 2016 BlackTopp Studios Inc.
2 /* This file is part of The Mezzanine Engine.
3 
4  The Mezzanine Engine 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 3 of the License, or
7  (at your option) any later version.
8 
9  The Mezzanine Engine 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 The Mezzanine Engine. If not, see <http://www.gnu.org/licenses/>.
16 */
17 /* The original authors have included a copy of the license specified above in the
18  'Docs' folder. See 'gpl.txt'
19 */
20 /* We welcome the use of the Mezzanine engine to anyone, including companies who wish to
21  Build professional software and charge for their product.
22 
23  However there are some practical restrictions, so if your project involves
24  any of the following you should contact us and we will try to work something
25  out:
26  - DRM or Copy Protection of any kind(except Copyrights)
27  - Software Patents You Do Not Wish to Freely License
28  - Any Kind of Linking to Non-GPL licensed Works
29  - Are Currently In Violation of Another Copyright Holder's GPL License
30  - If You want to change our code and not add a few hundred MB of stuff to
31  your distribution
32 
33  These and other limitations could cause serious legal problems if you ignore
34  them, so it is best to simply contact us or the Free Software Foundation, if
35  you have any questions.
36 
37  Joseph Toppi - toppij@gmail.com
38  John Blackwood - makoenergy02@gmail.com
39 */
40 
41 #ifndef _world_cpp
42 #define _world_cpp
43 
44 #include "entresol.h"
45 #include "world.h"
46 #include "worldmanager.h"
47 #include "worldmanagerfactory.h"
48 #include "stringtool.h"
49 
50 //#include "pagingmanager.h"
51 #include "actormanager.h"
52 #include "areaeffectmanager.h"
53 #include "debrismanager.h"
54 #include "terrainmanager.h"
55 
56 #include "Audio/soundscapemanager.h"
57 #include "Graphics/scenemanager.h"
58 #include "Physics/physicsmanager.h"
59 
60 // Enabled implementation includes
61 #ifdef ENABLE_OALS_AUDIO_IMPLEMENTATION
62  #include "Audio/OALS/oalssoundscapemanagerfactory.h"
63 #endif // ENABLE_OALS_AUDIO_IMPLEMENTATION
64 
65 namespace Mezzanine
66 {
68 
69  World::World(const String& WorldName) :
70  Name(WorldName)
71  {
73  std::vector <WorldManager*> temp;
74 
75  this->Construct(PhysicsInfo,"DefaultSceneManager",temp);
76  }
77 
78  World::World(const String& WorldName, const WorldManagerContainer& Managers) :
79  Name(WorldName)
80  {
82 
83  this->Construct(PhysicsInfo,"DefaultSceneManager",Managers);
84  }
85 
86  World::World(const String& WorldName, const Physics::ManagerConstructionInfo& PhysicsInfo, const String& SceneType) :
87  Name(WorldName)
88  {
89  std::vector <WorldManager*> temp;
90 
91  this->Construct(PhysicsInfo, SceneType, temp);
92  }
93 
94  World::World(const String& WorldName, const WorldManagerContainer& Managers, const Physics::ManagerConstructionInfo& PhysicsInfo, const String& SceneType) :
95  Name(WorldName)
96  {
97  this->Construct(PhysicsInfo, SceneType, Managers);
98  }
99 
100  World::World(const XML::Node& SelfNode)
101  {
102 
103  }
104 
106  {
107  this->DestroyAllManagers();
108  }
109 
110  void World::Construct(const Physics::ManagerConstructionInfo& PhysicsInfo, const String& SceneType, const WorldManagerContainer& ManagerToBeAdded )
111  {
112  //add each manager that was passed in to the manager list
113  for( ConstWorldManagerIterator iter = ManagerToBeAdded.begin() ; iter!= ManagerToBeAdded.end() ; ++iter )
114  { this->AddManager(*iter); }
115 
116  //Dummy param list so we can use the auto-added manager types if needed
117  NameValuePairList Params;
118  if( this->GetManager(ManagerBase::MT_ActorManager) == 0 ) {
119  this->CreateManager("DefaultActorManager",Params,true);
120  }
121  if( this->GetManager(ManagerBase::MT_AreaEffectManager) == 0 ) {
122  this->CreateManager("DefaultAreaEffectManager",Params,true);
123  }
124  if( this->GetManager(ManagerBase::MT_DebrisManager) == 0 ) {
125  this->CreateManager("DefaultDebrisManager",Params,true);
126  }
127  if( this->GetManager(ManagerBase::MT_SceneManager) == 0 ) {
128  Params.push_back( std::make_pair( String("InternalManagerTypeName"),SceneType ) );
129  this->CreateManager("DefaultSceneManager",Params,true);
130  Params.clear();
131  }
132  if( this->GetManager(ManagerBase::MT_PhysicsManager) == 0 ) {
133  Params.push_back( std::make_pair( String("GeographyUpperBounds"),StringTools::ConvertToString( PhysicsInfo.GeographyUpperBounds ) ) );
134  Params.push_back( std::make_pair( String("GeogrpahyLowerBounds"),StringTools::ConvertToString( PhysicsInfo.GeographyLowerBounds ) ) );
135  Params.push_back( std::make_pair( String("MaxProxies"),StringTools::ConvertToString( PhysicsInfo.MaxProxies ) ) );
136  Params.push_back( std::make_pair( String("Gravity"),StringTools::ConvertToString( PhysicsInfo.Gravity ) ) );
137  Params.push_back( std::make_pair( String("SoftRigidWorld"),StringTools::ConvertToString( Boole(PhysicsInfo.PhysicsFlags & Physics::ManagerConstructionInfo::PCF_SoftRigidWorld) ) ) );
138  Params.push_back( std::make_pair( String("LimitlessWorld"),StringTools::ConvertToString( Boole(PhysicsInfo.PhysicsFlags & Physics::ManagerConstructionInfo::PCF_LimitlessWorld) ) ) );
139  Params.push_back( std::make_pair( String("MultiThreaded"),StringTools::ConvertToString( Boole(PhysicsInfo.PhysicsFlags & Physics::ManagerConstructionInfo::PCF_Multithreaded) ) ) );
140  this->CreateManager("DefaultPhysicsManager",Params,true);
141  Params.clear();
142  }
143 
144  #ifdef ENABLE_OALS_AUDIO_IMPLEMENTATION
145  if( this->GetManager(ManagerBase::MT_SoundScapeManager) == 0 ) {
146  this->CreateManager("OALSSoundScapeManager",Params,true);
147  }
148  #endif //ENABLE_OALS_AUDIO_IMPLEMENTATION
149  }
150 
152  {
153 
154  }
155 
156  ///////////////////////////////////////////////////////////////////////////////
157  // Utility
158 
159  const String& World::GetName() const
160  { return this->Name; }
161 
162  void World::PauseWorld(const Boole Pause)
163  {
164  static_cast<Physics::PhysicsManager*>( this->GetManager(ManagerBase::MT_PhysicsManager) )->PauseSimulation(Pause);
165  }
166 
168  {
169  Physics::PhysicsManager* PhysMan = static_cast<Physics::PhysicsManager*>( this->GetManager(ManagerBase::MT_PhysicsManager) );
170  // Start with constraints and anything else that is linking the objects.
171  // Nuke the metadata while we're at it.
172  if( PhysMan != NULL ) {
173  PhysMan->DestroyAllConstraints();
174  PhysMan->DestroyAllWorldTriggers();
175  PhysMan->ClearPhysicsMetaData();
176  }
177 
178  ActorManager* ActorMan = static_cast<ActorManager*>( this->GetManager(ManagerBase::MT_ActorManager) );
179  AreaEffectManager* AreaEffectMan = static_cast<AreaEffectManager*>( this->GetManager(ManagerBase::MT_AreaEffectManager) );
180  DebrisManager* DebrisMan = static_cast<DebrisManager*>( this->GetManager(ManagerBase::MT_DebrisManager) );
181  // Now get the higher level world objects. They'll take out their bound proxies as they go.
182  if( ActorMan != NULL ) {
183  ActorMan->DestroyAllActors();
184  }
185  if( AreaEffectMan != NULL ) {
186  AreaEffectMan->DestroyAllAreaEffects();
187  }
188  if( DebrisMan != NULL ) {
189  DebrisMan->DestroyAllDebris();
190  }
191 
192  Audio::SoundScapeManager* SoundScapeMan = static_cast<Audio::SoundScapeManager*>( this->GetManager(ManagerBase::MT_SoundScapeManager) );
193  Graphics::SceneManager* SceneMan = static_cast<Graphics::SceneManager*>( this->GetManager(ManagerBase::MT_SceneManager) );
194  // Now deal with any dangling proxies.
195  // Any additional minor cleanup related to these managers can be done after proxy cleanup as well.
196  if( PhysMan != NULL ) {
197  PhysMan->DestroyAllProxies();
198  }
199  if( SceneMan != NULL ) {
200  SceneMan->DestroyAllProxies();
201  SceneMan->DisableSky();
202  }
203  if( SoundScapeMan != NULL ) {
204  SoundScapeMan->DestroyAllProxies();
205  }
206  }
207 
208  ///////////////////////////////////////////////////////////////////////////////
209  // Initialization
210 
212  {
213  for( WorldManagerIterator ManIter = this->WorldManagers.begin() ; ManIter != this->WorldManagers.end() ; ++ManIter )
214  {
215  #ifdef MEZZDEBUG
216  StringStream InitStream;
217  InitStream << "Initializing " << (*ManIter)->GetImplementationTypeName() << " as " << (*ManIter)->GetInterfaceTypeAsString() << "." << std::endl;
218  Entresol::GetSingletonPtr()->_Log( InitStream.str() );
219  #endif
220  (*ManIter)->Initialize();
221  }
222  }
223 
225  {
226  for( WorldManagerIterator ManIter = this->WorldManagers.begin() ; ManIter != this->WorldManagers.end() ; ++ManIter )
227  {
228  #ifdef MEZZDEBUG
229  StringStream DeinitStream;
230  DeinitStream << "Deinitializing " << (*ManIter)->GetImplementationTypeName() << " as " << (*ManIter)->GetInterfaceTypeAsString() << "." << std::endl;
231  Entresol::GetSingletonPtr()->_Log( DeinitStream.str() );
232  #endif
233  (*ManIter)->Deinitialize();
234  }
235  }
236 
238  {
239  static_cast<Physics::PhysicsManager*>( this->GetManager(ManagerBase::MT_PhysicsManager) )->MainLoopInitialize();
240  static_cast<AreaEffectManager*>( this->GetManager(ManagerBase::MT_AreaEffectManager) )->MainLoopInitialize();
241  }
242 
243  ///////////////////////////////////////////////////////////////////////////////
244  // Upper Management
245 
246  WorldManager* World::CreateManager(const String& ManagerImplName, const NameValuePairList& Params, Boole AddToWorld)
247  {
248  ManagerFactoryIterator FactoryIt = World::ManagerFactories.find(ManagerImplName);
249  if( FactoryIt == World::ManagerFactories.end() ) {
250  MEZZ_EXCEPTION(ExceptionBase::II_IDENTITY_NOT_FOUND_EXCEPTION,"Attempting to create manager of type \"" + ManagerImplName + "\", which has no factory registered.");
251  }
252  WorldManager* NewMan = (*FactoryIt).second->CreateManager(this,Params);
253  if(AddToWorld) {
254  this->AddManager(NewMan);
255  }
256  return NewMan;
257  }
258 
259  WorldManager* World::CreateManager(const String& ManagerImplName, const XML::Node& XMLNode, Boole AddToWorld)
260  {
261  ManagerFactoryIterator FactoryIt = World::ManagerFactories.find(ManagerImplName);
262  if( FactoryIt == World::ManagerFactories.end() ) {
263  MEZZ_EXCEPTION(ExceptionBase::II_IDENTITY_NOT_FOUND_EXCEPTION,"Attempting to create manager of type \"" + ManagerImplName + "\", which has no factory registered.");
264  }
265  WorldManager* NewMan = (*FactoryIt).second->CreateManager(this,XMLNode);
266  if(AddToWorld) {
267  this->AddManager(NewMan);
268  }
269  return NewMan;
270  }
271 
272  void World::DestroyManager(WorldManager* ToBeDestroyed)
273  {
274  String ImplName = ToBeDestroyed->GetImplementationTypeName();
275  ManagerFactoryIterator FactoryIt = World::ManagerFactories.find(ImplName);
276  if( FactoryIt == World::ManagerFactories.end() ) {
277  MEZZ_EXCEPTION(ExceptionBase::II_IDENTITY_NOT_FOUND_EXCEPTION,"Attempting to destroy manager of type \"" + ImplName + "\", which has no factory registered.");
278  }
279  this->RemoveManager(ToBeDestroyed);
280  (*FactoryIt).second->DestroyManager(ToBeDestroyed);
281  }
282 
284  {
285  this->Clear();
286  this->Deinitialize();
287  /*std::list<WorldManager*> WorldManagerList(this->WorldManagers.begin(),this->WorldManagers.end());
288  while( !(WorldManagerList.empty()) )
289  {
290  WorldManager* Current = WorldManagerList.front();
291  ManagerFactoryIterator FactoryIt = this->ManagerFactories.find(Current->GetImplementationTypeName());
292  if( FactoryIt == this->ManagerFactories.end() ) {
293  MEZZ_EXCEPTION(ExceptionBase::II_IDENTITY_NOT_FOUND_EXCEPTION,"Attempting to destroy manager of type \"" + Current->GetImplementationTypeName() + "\", which has no factory registered.");
294  }else{
295  (*FactoryIt).second->DestroyManager(Current);
296  }
297  WorldManagerList.pop_front();
298  }// */
299  for( WorldManagerIterator WorldManIt = this->WorldManagers.begin() ; WorldManIt != this->WorldManagers.end() ; ++WorldManIt )
300  {
301  String ImplName = (*WorldManIt)->GetImplementationTypeName();
302  ManagerFactoryIterator FactoryIt = World::ManagerFactories.find(ImplName);
303  if( FactoryIt == World::ManagerFactories.end() ) {
304  MEZZ_EXCEPTION(ExceptionBase::II_IDENTITY_NOT_FOUND_EXCEPTION,"Attempting to destroy manager of type \"" + ImplName + "\", which has no factory registered.");
305  }else{
306  (*FactoryIt).second->DestroyManager( (*WorldManIt) );
307  }
308  }// */
309  this->WorldManagers.clear();
310  }
311 
313  {
314  ManagerBase::ManagerType IType = ManagerToAdd->GetInterfaceType();
315  for( WorldManagerIterator ManIter = this->WorldManagers.begin() ; ManIter != this->WorldManagers.end() ; ++ManIter )
316  {
317  if( (*ManIter)->GetInterfaceType() == IType )
318  return false;
319  }
320  this->WorldManagers.push_back(ManagerToAdd);
321  return true;
322  }
323 
324  WorldManager* World::GetManager(const Whole ManagerToGet)
325  {
326  for( WorldManagerIterator ManIter = this->WorldManagers.begin() ; ManIter != this->WorldManagers.end() ; ++ManIter )
327  {
328  if( (*ManIter)->GetInterfaceType() == ManagerToGet )
329  return *ManIter;
330  }
331  return NULL;
332  }
333 
335  {
336  for( WorldManagerIterator ManIter = this->WorldManagers.begin() ; ManIter != this->WorldManagers.end() ; ++ManIter )
337  {
338  if( (*ManIter) == ToBeRemoved ) {
339  this->WorldManagers.erase(ManIter);
340  return;
341  }
342  }
343  }
344 
345  void World::RemoveManager(const Whole ToBeRemoved)
346  {
347  for( WorldManagerIterator ManIter = this->WorldManagers.begin() ; ManIter != this->WorldManagers.end() ; ++ManIter )
348  {
349  if( (*ManIter)->GetInterfaceType() == ToBeRemoved ) {
350  this->WorldManagers.erase(ManIter);
351  return;
352  }
353  }
354  }
355 
357  {
358  WorldManagers.clear();
359  }
360 
362  {
363  return WorldManagers;
364  }
365 
366  ///////////////////////////////////////////////////////////////////////////////
367  // Factories Management
368 
370  {
371  World::ManagerFactories.insert(std::pair<String,WorldManagerFactory*>(ToBeAdded->GetManagerImplName(),ToBeAdded));
372  }
373 
375  {
377  }
378 
379  void World::RemoveManagerFactory(const String& ImplName)
380  {
381  ManagerFactoryIterator ManIt = World::ManagerFactories.find(ImplName);
382  if( ManIt != World::ManagerFactories.end() )
383  { World::ManagerFactories.erase(ManIt); }
384  }
385 
387  {
389  }
390 
391  void World::DestroyManagerFactory(const String& ImplName)
392  {
393  ManagerFactoryIterator ManIt = World::ManagerFactories.find(ImplName);
394  if( ManIt != World::ManagerFactories.end() ) {
395  delete ManIt->second;
396  World::ManagerFactories.erase(ManIt);
397  }
398  }
399 
401  {
402  for( ManagerFactoryIterator ManIt = World::ManagerFactories.begin() ; ManIt != World::ManagerFactories.end() ; ++ManIt )
403  { delete (*ManIt).second; }
404  World::ManagerFactories.clear();
405  }
406 
408  {
410  //DefaultActorManager
411  ManIt = World::ManagerFactories.find("DefaultActorManager");
412  if( ManIt == World::ManagerFactories.end() ) World::AddManagerFactory(new DefaultActorManagerFactory());
413  //DefaultAreaEffectManager
414  ManIt = World::ManagerFactories.find("DefaultAreaEffectManager");
415  if( ManIt == World::ManagerFactories.end() ) World::AddManagerFactory(new DefaultAreaEffectManagerFactory());
416  //DefaultDebrisManager
417  ManIt = World::ManagerFactories.find("DefaultDebrisManager");
418  if( ManIt == World::ManagerFactories.end() ) World::AddManagerFactory(new DefaultDebrisManagerFactory());
419  //DefaultPhysicsManager
420  ManIt = World::ManagerFactories.find("DefaultPhysicsManager");
421  if( ManIt == World::ManagerFactories.end() ) World::AddManagerFactory(new Physics::DefaultPhysicsManagerFactory());
422  //DefaultSceneManager
423  ManIt = World::ManagerFactories.find("DefaultSceneManager");
424  if( ManIt == World::ManagerFactories.end() ) World::AddManagerFactory(new Graphics::DefaultSceneManagerFactory());
425  //DefaultTerrainManager
426  ManIt = World::ManagerFactories.find("DefaultTerrainManager");
427  if( ManIt == World::ManagerFactories.end() ) World::AddManagerFactory(new DefaultTerrainManagerFactory());
428 
429  #ifdef ENABLE_OALS_AUDIO_IMPLEMENTATION
430  //OALSSoundScapeManager
431  ManIt = World::ManagerFactories.find("OALSSoundScapeManager");
432  if( ManIt == World::ManagerFactories.end() ) World::AddManagerFactory(new Audio::OALS::OALSSoundScapeManagerFactory());
433  #endif //ENABLE_OALS_AUDIO_IMPLEMENTATION
434  }
435 
436  ///////////////////////////////////////////////////////////////////////////////
437  // Serialization
438 
439  void World::ProtoSerialize(XML::Node& ParentNode) const
440  {
441 
442  }
443 
445  {
446 
447  }
448 
449  void World::ProtoDeSerialize(const XML::Node& SelfRoot)
450  {
451 
452  }
453 
455  {
456 
457  }
458 
460  { return World::GetSerializableName(); }
461 
463  { return "World"; }
464 }//Mezzanine
465 
466 #endif
virtual void DestroyAllAreaEffects()
Destroys all actors currently within this manager.
void RemoveManager(WorldManager *ToBeRemoved)
This removes a manager by finding the matching pointer.
Definition: world.cpp:334
static void RemoveManagerFactory(WorldManagerFactory *ToBeRemoved)
Removes a manager factory from the container of registered factories.
Definition: world.cpp:374
A factory responsible for the creation and destruction of the default DebrisManager.
virtual ManagerType GetInterfaceType() const =0
This returns the type of this manager.
virtual void DestroyAllActors()
Destroys all Actors currently within this manager.
WorldManager * GetManager(const Whole ManagerToGet)
This is will find the manager of a given type.
Definition: world.cpp:324
static void DestroyAllManagerFactories()
Destroys all registered manager factories.
Definition: world.cpp:400
static ManagerFactoryMap ManagerFactories
A global container for registered factories for WorldManagers.
Definition: world.h:92
WorldManagerContainer & GetWorldManagers()
This gets the list of managers in the world.
Definition: world.cpp:361
WorldManagerContainer::const_iterator ConstWorldManagerIterator
Const Iterator type for WorldManager instances stored by this class.
Definition: world.h:88
bool Boole
Generally acts a single bit, true or false.
Definition: datatypes.h:173
This class contains utilities and functions to allow the manipulation of the Graphical scene...
Definition: scenemanager.h:85
Vector3 GeographyLowerBounds
The lower limits of the worlds AABB.
A manager responsible for the storage and management of all areaeffects in use.
This file contains the declaration for the manager that manages debris objects in a world...
void Deinitialize()
Deinitializes all managers in this world and unhooks all of it's systems, disabling this world...
Definition: world.cpp:224
ManagerType
A listing of Manager Types.
Definition: managerbase.h:65
WorldManagerContainer WorldManagers
A container storing all the managers belonging to this world.
Definition: world.h:95
void DestroyAllManagers()
Destroys all managers currently in the World.
Definition: world.cpp:283
String ConvertToString(const Vector2 &ToConvert)
Converts a Vector2 into a string.
Definition: stringtool.cpp:291
Thrown when the requested identity could not be found.
Definition: exception.h:94
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
Definition: exception.h:3048
WorldManagerContainer::iterator WorldManagerIterator
Iterator type for WorldManager instances stored by this class.
Definition: world.h:86
void DisableSky()
If any sky is active, disable it.
A factory responsible for the creation and destruction of the default terrainmanager.
Vector3 Gravity
The gravity to set for the world.
Enables multi-threaded acceleration structures.
WorldManager * CreateManager(const String &ManagerImplName, const NameValuePairList &Params, Boole AddToWorld=true)
Creates a new manager.
Definition: world.cpp:246
virtual void ProtoDeSerialize(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite this object with it.
Definition: world.cpp:449
static void AddManagerFactory(WorldManagerFactory *ToBeAdded)
Adds/registers a manager factory for use with World instances.
Definition: world.cpp:369
void _Log(const T &Message)
Runtime event and message logging.
Definition: entresol.h:686
virtual String GetImplementationTypeName() const =0
This Allows any manager name to be sent to a stream. Primarily used for logging.
String Name
Unique string identifier for world.
Definition: world.h:98
Enables support for soft bodies in the simulation.
virtual ~World()
class destructor.
Definition: world.cpp:105
virtual void ProtoSerializeProperties(XML::Node &SelfRoot) const
Convert the properties of this class to an XML::Node ready for serialization.
Definition: world.cpp:444
std::stringstream StringStream
A Datatype used for streaming operations with strings.
Definition: datatypes.h:176
static void DestroyManagerFactory(WorldManagerFactory *ToBeRemoved)
Removes and destroys a manager factory in the container of registered factories.
Definition: world.cpp:386
std::map< String, WorldManagerFactory * > ManagerFactoryMap
Basic container type for factories that construct known manager types.
Definition: world.h:78
virtual void DestroyAllDebris()
Destroys all Debriss currently within this manager.
void ClearPhysicsMetaData()
Clears all data relating to actors and other simulation objects from the physics world.
static Entresol * GetSingletonPtr()
Fetches a pointer to the singleton.
Definition: singleton.h:97
ManagerFactoryMap::iterator ManagerFactoryIterator
Iterator type for manager factories stored by this class.
Definition: world.h:80
A manager responsible for the storage and management of all Debris that exist in a world...
virtual void ProtoDeSerializeProperties(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the properties of this object with it...
Definition: world.cpp:454
A light-weight handle for manipulating nodes in DOM tree.
Definition: node.h:89
void Construct(const Physics::ManagerConstructionInfo &PhysicsInfo, const String &SceneType, const WorldManagerContainer &ManagerToBeAdded)
Helper function used to assist construction.
Definition: world.cpp:110
Whole MaxProxies
The maximum number of Actors and Area Effects you expect to have in the world at one time...
static void AddAllEngineDefaultManagerFactories()
Adds all the default manager factories provided by the engine.
Definition: world.cpp:407
virtual void DestroyAllProxies()=0
Deletes all stored SoundProxy instances.
A factory responsible for the creation and destruction of the default areaeffectmanager.
void Initialize()
Initializes all managers in this world and performs all the necessary hooks to enable this world...
Definition: world.cpp:211
A factory responsible for the creation and destruction of the default physicsmanager.
void DestroyAllProxies()
Deletes all stored RenderableProxy instances.
void DestroyAllConstraints()
Destroys all constraints currently in the manager.
void PauseWorld(const Boole Pause)
Pauses all animations, particles, and object movement throughout the world.
Definition: world.cpp:162
void DestroyAllWorldTriggers()
Destroys all triggers currently in the manager.
void RemoveAllManagers()
This removes all managers from the manager list.
Definition: world.cpp:356
void DestroyAllProxies()
Deletes all stored CollidableProxy instances.
std::list< NameValuePair > NameValuePairList
This is a datatype mostly used for describing settings or parameters that can't be declared in advanc...
Definition: datatypes.h:206
void DestroyManager(WorldManager *ToBeDestroyed)
Destroys a manager.
Definition: world.cpp:272
This is the base class for all managers that belong to a single world instance.
Definition: worldmanager.h:55
This is simply a place for storing all the Physics Related functions.
A factory responsible for the creation and destruction of the default actormanager.
Definition: actormanager.h:243
virtual String GetManagerImplName() const =0
Gets the name of the manager that is created by this factory.
World(const String &WorldName)
Class constructor.
Definition: world.cpp:69
virtual String GetDerivedSerializableName() const
Gets the most derived serializable name of this World.
Definition: world.cpp:459
A factory responsible for the creation and destruction of the default scenemanager.
Definition: scenemanager.h:427
virtual void ProtoSerialize(XML::Node &ParentNode) const
Convert this class to an XML::Node ready for serialization.
Definition: world.cpp:439
static String GetSerializableName()
Get the name of the the XML tag the World class will leave behind as its instances are serialized...
Definition: world.cpp:462
std::vector< WorldManager * > WorldManagerContainer
Basic container type for WorldManager storage by this class.
Definition: world.h:84
Whole PhysicsFlags
The flags to initialize the physics system with.
The bulk of the engine components go in this namspace.
Definition: actor.cpp:56
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
Definition: datatypes.h:151
const String & GetName() const
Gets the name of this world.
Definition: world.cpp:159
This is a base class for factories that construct managers used by the World class.
Vector3 GeographyUpperBounds
The upper limits of the worlds AABB.
Boole AddManager(WorldManager *ManagerToAdd)
This adds a manager, in the correct order, to the list that the world calls on.
Definition: world.cpp:312
std::string String
A datatype used to a series of characters.
Definition: datatypes.h:159
This is the base manager class for audio being played in a 3D environment.
Boole VerifyManagerInitializations()
Checks if all managers currently stored in this World have been initialized.
Definition: world.cpp:151
void PreMainLoopInit()
Initialize any default managers and any added after construction. This should be called before the En...
Definition: world.cpp:237
This is a helper class storing information needed for the construction of a PhysicsManager.
A manager responsible for the storage and management of all actors that exist in a world...
Definition: actormanager.h:94
void Clear()
Clears the world of all objects.
Definition: world.cpp:167