AnnGameObjectManager.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "systemMacro.h"
4 #include "AnnSubsystem.hpp"
5 #include "AnnTypes.h"
6 
7 #include <OgreMesh.h>
8 #include <OgreMesh2.h>
9 
10 #include <memory>
11 
12 #include <Ogre_glTF.hpp>
13 
14 namespace Annwvyn
15 {
16  class AnnEngine;
17  class AnnGameObject;
18 
21  {
22  public:
24 
26  void update() override;
27 
29  Ogre::MeshPtr getAndConvertFromV1Mesh(const char* meshName, Ogre::v1::MeshPtr& v1Mesh, Ogre::MeshPtr& v2Mesh) const;
30 
34  std::shared_ptr<AnnGameObject> createGameObject(const std::string& mesh, std::string identifier = "",
35  std::shared_ptr<AnnGameObject> object = std::make_shared<AnnGameObject>()); //object factory
36 
39  void removeGameObject(std::shared_ptr<AnnGameObject> object);
40 
42  std::shared_ptr<AnnGameObject> getFromNode(Ogre::SceneNode* node);
43 
46  void removeLightObject(std::shared_ptr<AnnLightObject> light);
47 
49  std::shared_ptr<AnnLightObject> createLightObject(std::string identifier = "");
50 
52  std::shared_ptr<AnnTriggerObject> createTriggerObject(std::string identifier = ""); //object factory
53 
55  void removeTriggerObject(std::shared_ptr<AnnTriggerObject> trigger);
56 
58  std::shared_ptr<AnnGameObject> playerLookingAt(unsigned short limit = 5); //physics
59 
61  std::shared_ptr<AnnGameObject> getGameObject(std::string gameObjectName);
62 
64  std::shared_ptr<AnnLightObject> getLightObject(std::string lightObjectName);
65 
67  std::shared_ptr<AnnTriggerObject> getTriggerObject(std::string triggerObjectName);
68 
70  void setImportParameter(bool halfPosition, bool halfTextureCoord, bool qTangents);
71 
72  private:
73  friend class AnnEngine;
74 
81 
84 
87 
90 
92  uID nextID();
93 
94  bool halfPos, halfTexCoord, qTan;
95 
96  Ogre_glTF::glTFLoaderInterface* glTFLoader = nullptr;
97  };
98 
100 }
std::unordered_map< std::string, std::shared_ptr< AnnGameObject > > identifiedObjects
objects mapped to ID strings
file for defining macros used for symbol export regarding the way the OS does things.
Main engine class. Creating an instance of this class make the engine start.
Definition: AnnEngine.hpp:70
Namespace containing the totality of Annwvyn components.
Definition: AnnGetter.cpp:8
std::unordered_map< std::string, std::shared_ptr< AnnLightObject > > identifiedLights
lights mapped to ID strings
unsigned long long uID
Definition: AnnTypes.h:39
AnnGameObjectList Objects
Dynamic container for Game objects present in engine.
std::unordered_map< std::string, std::shared_ptr< AnnTriggerObject > > identifiedTriggerObjects
triggers identified to ID string
Parent class of all Annwvyn SubSystem.
Game object manager. Create, destroy and keep track of objects, lights and other movable stuff...
class AnnDllExport AnnGameObjectManager
Data types definition for Annwvyn.
#define AnnDllExport
Definition: systemMacro.h:24
AnnLightList Lights
Dynamic container for lights objects present in engine.
AnnTriggerObjectList Triggers
Dynamic container for triggers objects present in engine.