Go to the documentation of this file.
17 #ifndef GZ_RENDERING_OGRE2_OGRE2SCENE_HH_
18 #define GZ_RENDERING_OGRE2_OGRE2SCENE_HH_
28 #include "gz/rendering/ogre2/Export.hh"
32 #pragma GCC system_header
34 #pragma warning(push, 0)
36 #include <Compositor/OgreCompositorShadowNode.h>
51 inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
54 class Ogre2ScenePrivate;
69 public:
virtual void Fini()
override;
75 public:
virtual VisualPtr RootVisual()
const override;
78 public:
virtual void SetTime(
79 const std::chrono::steady_clock::duration &_time)
override;
82 public:
virtual math::Color AmbientLight()
const override;
85 public:
virtual void SetAmbientLight(
const math::Color &_color)
override;
88 public:
virtual void PreRender()
override;
91 public:
virtual void Clear()
override;
94 public:
virtual void Destroy()
override;
97 public:
virtual void SetSkyEnabled(
bool _enabled)
override;
100 public:
virtual bool SkyEnabled()
const override;
103 public:
virtual void SetCameraPassCountPerGpuFlush(
104 uint8_t _numPass)
override;
107 public:
virtual uint8_t CameraPassCountPerGpuFlush()
const override;
110 public:
virtual bool LegacyAutoGpuFlush()
const override;
114 public:
virtual Ogre::SceneManager *OgreSceneManager()
const;
117 public:
virtual void PostRender()
override;
131 public:
void StartForcedRender();
137 public:
void EndForcedRender();
148 public:
void StartRendering(Ogre::Camera *_camera);
161 public:
void FlushGpuCommandsAndStartNewFrame(uint8_t _numPasses,
162 bool _startNewFrame);
166 protected:
void FlushGpuCommandsOnly();
180 protected:
void EndFrame();
187 public:
void SetShadowsDirty(
bool _dirty);
193 public:
bool ShadowsDirty()
const;
197 protected:
virtual bool LoadImpl()
override;
200 protected:
virtual bool InitImpl()
override;
203 protected:
virtual COMVisualPtr CreateCOMVisualImpl(
unsigned int _id,
208 unsigned int _id,
const std::string &_name)
override;
211 protected:
virtual JointVisualPtr CreateJointVisualImpl(
unsigned int _id,
215 protected:
virtual LightVisualPtr CreateLightVisualImpl(
unsigned int _id,
220 unsigned int _id,
const std::string &_name)
override;
223 protected:
virtual PointLightPtr CreatePointLightImpl(
unsigned int _id,
227 protected:
virtual SpotLightPtr CreateSpotLightImpl(
unsigned int _id,
231 protected:
virtual CameraPtr CreateCameraImpl(
unsigned int _id,
235 protected:
virtual DepthCameraPtr CreateDepthCameraImpl(
unsigned int _id,
240 unsigned int _id,
const std::string &_name)
override;
244 unsigned int _id,
const std::string &_name)
override;
248 unsigned int _id,
const std::string &_name)
override;
251 protected:
virtual GpuRaysPtr CreateGpuRaysImpl(
unsigned int _id,
255 protected:
virtual VisualPtr CreateVisualImpl(
unsigned int _id,
259 protected:
virtual ArrowVisualPtr CreateArrowVisualImpl(
unsigned int _id,
263 protected:
virtual AxisVisualPtr CreateAxisVisualImpl(
unsigned int _id,
267 protected:
virtual GizmoVisualPtr CreateGizmoVisualImpl(
unsigned int _id,
271 protected:
virtual GeometryPtr CreateBoxImpl(
unsigned int _id,
275 protected:
virtual GeometryPtr CreateConeImpl(
unsigned int _id,
279 protected:
virtual GeometryPtr CreateCylinderImpl(
unsigned int _id,
283 protected:
virtual GeometryPtr CreatePlaneImpl(
unsigned int _id,
287 protected:
virtual GeometryPtr CreateSphereImpl(
unsigned int _id,
294 protected:
virtual MeshPtr CreateMeshImpl(
unsigned int _id,
298 protected:
virtual MeshPtr CreateMeshImpl(
unsigned int _id,
303 protected:
virtual CapsulePtr CreateCapsuleImpl(
unsigned int _id,
306 protected:
virtual HeightmapPtr CreateHeightmapImpl(
unsigned int _id,
311 protected:
virtual GridPtr CreateGridImpl(
unsigned int _id,
315 protected:
virtual MarkerPtr CreateMarkerImpl(
unsigned int _id,
319 protected:
virtual LidarVisualPtr CreateLidarVisualImpl(
unsigned int _id,
323 protected:
virtual WireBoxPtr CreateWireBoxImpl(
unsigned int _id,
327 protected:
virtual TextPtr CreateTextImpl(
unsigned int _id,
330 protected:
virtual MaterialPtr CreateMaterialImpl(
unsigned int _id,
334 unsigned int _id,
const std::string &_name)
override;
338 unsigned int _id,
const std::string &_name)
override;
342 unsigned int _id,
const std::string &_name)
override;
346 unsigned int _id,
const std::string &_name)
override;
359 public:
void UpdateAllHeightmaps(Ogre::Camera *_camera);
368 protected:
void UpdateShadowNode();
383 private:
void CreateShadowNodeWithSettings(
384 Ogre::CompositorManager2 *_compositorManager,
386 const Ogre::ShadowNodeHelper::ShadowParamVec &_shadowParams);
401 private:
void CreateContext();
404 private:
void CreateRootVisual();
407 private:
void CreateMeshFactory();
410 private:
void CreateStores();
414 public:
void ClearMaterialsCache(
const std::string &_name);
441 protected: Ogre::SceneManager *ogreSceneManager =
nullptr;
Definition: gz/rendering/ogre/OgreCamera.hh:27
Describes how a Heightmap should be loaded.
Definition: gz/rendering/HeightmapDescriptor.hh:146
Describes how a Mesh should be loaded.
Definition: gz/rendering/MeshDescriptor.hh:44
Ogre2LightStorePtr lights
A list of ogre lights.
Definition: gz/rendering/ogre2/Ogre2Scene.hh:432
std::vector< std::weak_ptr< Ogre2Heightmap > > heightmaps
A list of ogre heightmaps.
Definition: gz/rendering/ogre2/Ogre2Scene.hh:438
Ogre2VisualStorePtr visuals
A list of ogre visuals.
Definition: gz/rendering/ogre2/Ogre2Scene.hh:429
Ogre2 render engine class. A singleton class that manages the underlying ogre2 render engine,...
Definition: gz/rendering/ogre2/Ogre2RenderEngine.hh:80
Ogre2SensorStorePtr sensors
A list of ogre sensors, e.g. cameras.
Definition: gz/rendering/ogre2/Ogre2Scene.hh:426
Ogre2.x implementation of the scene class.
Definition: gz/rendering/ogre2/Ogre2Scene.hh:57
Ogre2MeshFactoryPtr meshFactory
Mesh factory for generating ogre meshes.
Definition: gz/rendering/ogre2/Ogre2Scene.hh:423
Ogre2VisualPtr rootVisual
Root visual in the scene.
Definition: gz/rendering/ogre2/Ogre2Scene.hh:420
Definition: gz/rendering/base/BaseScene.hh:37
An abstract interface to a concrete render-engine. A RenderEngine is responsible for initializing a r...
Definition: gz/rendering/RenderEngine.hh:36
Ogre2MaterialMapPtr materials
A list of ogre materials.
Definition: gz/rendering/ogre2/Ogre2Scene.hh:435