7 #include <unordered_map>
8 #include <unordered_set>
24 using std::make_unique;
28 using std::unique_ptr;
29 using std::unordered_map;
30 using std::unordered_set;
55 vector<unique_ptr<SceneLight>>
lights;
158 if (i < 0 || i >=
lights.size())
return nullptr;
167 lights.push_back(make_unique<SceneLight>(
static_cast<int>(
lights.size())));
177 if (i < 0 || i >=
lights.size())
return false;
284 if (idx < 0 || idx >=
entities.size())
return nullptr;
314 bool renameEntity(
const string&
id,
const string& newId);
373 return &postProcessingShaderParametersIt->second;
TDME2 engine entity shader parameters.
Representation of a 3D model.
Represents rotation orders of a model.
Axis aligned bounding box used for frustum, this is not directly connectable with physics engine.
Scene prototype library definition.
map< string, SceneEntity * > entitiesById
bool removeEntity(const string &id)
Removes an entity from scene.
const Vector3 & getDimension()
void setFileName(const string &fileName)
Set up scene file name including relative path.
void replacePrototypeByIds(int searchPrototypeId, int newPrototypeId)
Replace prototype of given search prototype with new prototype.
virtual ~Scene()
Destructor.
RotationOrder * getRotationOrder()
const string & getFileName()
void removeEntitiesByPrototypeId(int prototypeId)
Remove entities with given prototype id.
EntityShaderParameters skyShaderParameters
bool isPostProcessingShaderEnabled(const string &shaderId)
Is post processing shader enabled.
vector< unique_ptr< SceneLight > > lights
UniquePtrSequenceIterator< SceneLight > getLights()
const EntityShaderParameters & getSkyShaderParameters()
Get sky shader parameters.
BoundingBox * getBoundingBox()
void setRotationOrder(RotationOrder *rotationOrder)
Set rotation order.
void setGUIFileName(const string &fileName)
Set up scene GUI file name including relative path.
void getEntitiesByPrototypeId(int prototypeId, vector< string > &entitiesByPrototypeId)
Get entities with given prototype id.
UniquePtrSequenceIterator< SceneEntity > getEntities()
RotationOrder * rotationOrder
set< string > getEnvironmentMappingIds()
SceneLight * addLight()
Add light.
const string & getApplicationRootPathName()
unique_ptr< SceneLibrary > library
void setEntityIdx(int entityIdx)
Set entity idx.
unordered_map< string, EntityShaderParameters > postProcessingShaderParameters
void setApplicationRootPathName(const string &applicationRootPathName)
Set application root path name.
bool renameEntity(const string &id, const string &newId)
Rename an entity from scene.
unordered_set< string > enabledPostProcessingShaders
SceneLight * getLightAt(int i)
Get light at given index.
bool removeLightAt(int i)
Remove light at given index i.
const string & getGUIFileName()
Scene(const string &name, const string &description)
Public constructor.
SceneEntity * getEntity(const string &id)
Returns scene entity by id.
void setPostProcessingShaderParameters(const string &shaderId, const EntityShaderParameters ¶meters)
Set post processing shader parameters.
void enablePostProcessingShader(const string &shaderId)
Enable post processing shader.
void addEntity(SceneEntity *entity)
Adds an entity to scene.
set< string > environmentMappingIds
string applicationRootPathName
SceneLibrary * getLibrary()
void update()
Update scene dimension, bounding box, center.
void setSkyShaderParameters(EntityShaderParameters ¶meters)
Set sky shader parameters.
vector< unique_ptr< SceneEntity > > entities
void clearEntities()
Clears all scene entities.
SceneEntity * getEntityAt(int idx)
Returns entity at given index.
void disablePostProcessingShader(const string &shaderId)
Disable post processing shader.
const Vector3 & getCenter()
unordered_set< string > getEnabledPostProcessingShader()
Return enabled processing shader.
const EntityShaderParameters * getPostProcessingShaderParameters(const string &shaderId)
Get post processing shader parameters.
void computeBoundingBox()
Computes scene bounding box.
Vector3 class representing vector3 mathematical structure and operations with x, y,...
unique_ptr sequence iterator