Leviathan  0.8.0.0
Leviathan game engine
Leviathan::ObjectLoader Class Reference

Class to collect all entity creations to one class. More...

#include <ObjectLoader.h>

Public Member Functions

 ObjectLoader ()=delete
 

Static Public Member Functions

template<class TWorldClass >
static ObjectID LoadCamera (TWorldClass &world, const Float3 &initialposition, const Float4 &initialrotation)
 Creates a full camera entity that can be usedas the primary world camera and sound listener. More...
 
template<class TWorldClass >
static ObjectID LoadPlane (TWorldClass &world, const Float3 &initialposition, const Float4 &initialrotation, const std::string &materialname, const Ogre::Plane &plane, const Float2 &planesize)
 Creates a plane that has a material applied to it. More...
 

Detailed Description

Class to collect all entity creations to one class.

Note
All created objects are added to the world so that they are broadcast on the network (if this is a server)
Todo:
Allow objects to be created that will be sent to clients only after the caller has had the chance to create constraints etc.

Definition at line 16 of file ObjectLoader.h.

Constructor & Destructor Documentation

◆ ObjectLoader()

Leviathan::ObjectLoader::ObjectLoader ( )
delete

Member Function Documentation

◆ LoadCamera()

template<class TWorldClass >
static ObjectID Leviathan::ObjectLoader::LoadCamera ( TWorldClass &  world,
const Float3 initialposition,
const Float4 initialrotation 
)
inlinestatic

Creates a full camera entity that can be usedas the primary world camera and sound listener.

Definition at line 23 of file ObjectLoader.h.

25  {
26  ObjectID newEntity = world.CreateEntity();
27 
28  world.Create_Position(newEntity, initialposition, initialrotation);
29 
30  world.Create_Camera(newEntity);
31 
32  return newEntity;
33  }
int32_t ObjectID
Definition: EntityCommon.h:11

◆ LoadPlane()

template<class TWorldClass >
static ObjectID Leviathan::ObjectLoader::LoadPlane ( TWorldClass &  world,
const Float3 initialposition,
const Float4 initialrotation,
const std::string &  materialname,
const Ogre::Plane plane,
const Float2 planesize 
)
inlinestatic

Creates a plane that has a material applied to it.

Definition at line 37 of file ObjectLoader.h.

40  {
41  ObjectID newEntity = world.CreateEntity();
42 
43  world.Create_Position(newEntity, initialposition, initialrotation);
44 
45  RenderNode& node = world.Create_RenderNode(newEntity);
46 
47  world.Create_Plane(newEntity, node.Node, materialname, plane, planesize);
48 
49  return newEntity;
50  }
int32_t ObjectID
Definition: EntityCommon.h:11

The documentation for this class was generated from the following file: