IMeshSceneNode.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Copyright (C) 2002-2012 Nikolaus Gebhardt
  2. // This file is part of the "Irrlicht Engine".
  3. // For conditions of distribution and use, see copyright notice in irrlicht.h
  4. #pragma once
  5. #include "ISceneNode.h"
  6. namespace irr
  7. {
  8. namespace scene
  9. {
  10. class IMesh;
  11. //! A scene node displaying a static mesh
  12. class IMeshSceneNode : public ISceneNode
  13. {
  14. public:
  15. //! Constructor
  16. /** Use setMesh() to set the mesh to display.
  17. */
  18. IMeshSceneNode(ISceneNode *parent, ISceneManager *mgr, s32 id,
  19. const core::vector3df &position = core::vector3df(0, 0, 0),
  20. const core::vector3df &rotation = core::vector3df(0, 0, 0),
  21. const core::vector3df &scale = core::vector3df(1, 1, 1)) :
  22. ISceneNode(parent, mgr, id, position, rotation, scale) {}
  23. //! Sets a new mesh to display
  24. /** \param mesh Mesh to display. */
  25. virtual void setMesh(IMesh *mesh) = 0;
  26. //! Get the currently defined mesh for display.
  27. /** \return Pointer to mesh which is displayed by this node. */
  28. virtual IMesh *getMesh(void) = 0;
  29. //! Sets if the scene node should not copy the materials of the mesh but use them in a read only style.
  30. /** In this way it is possible to change the materials of a mesh
  31. causing all mesh scene nodes referencing this mesh to change, too.
  32. \param readonly Flag if the materials shall be read-only. */
  33. virtual void setReadOnlyMaterials(bool readonly) = 0;
  34. //! Check if the scene node should not copy the materials of the mesh but use them in a read only style
  35. /** This flag can be set by setReadOnlyMaterials().
  36. \return Whether the materials are read-only. */
  37. virtual bool isReadOnlyMaterials() const = 0;
  38. };
  39. } // end namespace scene
  40. } // end namespace irr