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 GZ_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;
364 public:
void UpdateAllHeightmaps(Ogre::Camera *_camera);
373 protected:
void UpdateShadowNode();
388 private:
void CreateShadowNodeWithSettings(
389 Ogre::CompositorManager2 *_compositorManager,
391 const Ogre::ShadowNodeHelper::ShadowParamVec &_shadowParams);
406 protected:
unsigned int CreateObjectId()
override;
409 private:
void CreateContext();
412 private:
void CreateRootVisual();
415 private:
void CreateMeshFactory();
418 private:
void CreateStores();
422 public:
void ClearMaterialsCache(
const std::string &_name);
449 protected: Ogre::SceneManager *ogreSceneManager =
nullptr;