CDummyTransformationSceneNode.cpp 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. #include "CDummyTransformationSceneNode.h"
  5. #include "os.h"
  6. namespace irr
  7. {
  8. namespace scene
  9. {
  10. //! constructor
  11. CDummyTransformationSceneNode::CDummyTransformationSceneNode(
  12. ISceneNode *parent, ISceneManager *mgr, s32 id) :
  13. IDummyTransformationSceneNode(parent, mgr, id)
  14. {
  15. setAutomaticCulling(scene::EAC_OFF);
  16. }
  17. //! returns the axis aligned bounding box of this node
  18. const core::aabbox3d<f32> &CDummyTransformationSceneNode::getBoundingBox() const
  19. {
  20. return Box;
  21. }
  22. //! Returns a reference to the current relative transformation matrix.
  23. //! This is the matrix, this scene node uses instead of scale, translation
  24. //! and rotation.
  25. core::matrix4 &CDummyTransformationSceneNode::getRelativeTransformationMatrix()
  26. {
  27. return RelativeTransformationMatrix;
  28. }
  29. //! Returns the relative transformation of the scene node.
  30. core::matrix4 CDummyTransformationSceneNode::getRelativeTransformation() const
  31. {
  32. return RelativeTransformationMatrix;
  33. }
  34. //! Creates a clone of this scene node and its children.
  35. ISceneNode *CDummyTransformationSceneNode::clone(ISceneNode *newParent, ISceneManager *newManager)
  36. {
  37. if (!newParent)
  38. newParent = Parent;
  39. if (!newManager)
  40. newManager = SceneManager;
  41. CDummyTransformationSceneNode *nb = new CDummyTransformationSceneNode(newParent,
  42. newManager, ID);
  43. nb->cloneMembers(this, newManager);
  44. nb->RelativeTransformationMatrix = RelativeTransformationMatrix;
  45. nb->Box = Box;
  46. if (newParent)
  47. nb->drop();
  48. return nb;
  49. }
  50. const core::vector3df &CDummyTransformationSceneNode::getScale() const
  51. {
  52. os::Printer::log("CDummyTransformationSceneNode::getScale() does not contain the relative transformation.", ELL_DEBUG);
  53. return RelativeScale;
  54. }
  55. void CDummyTransformationSceneNode::setScale(const core::vector3df &scale)
  56. {
  57. os::Printer::log("CDummyTransformationSceneNode::setScale() does not affect the relative transformation.", ELL_DEBUG);
  58. RelativeScale = scale;
  59. }
  60. const core::vector3df &CDummyTransformationSceneNode::getRotation() const
  61. {
  62. os::Printer::log("CDummyTransformationSceneNode::getRotation() does not contain the relative transformation.", ELL_DEBUG);
  63. return RelativeRotation;
  64. }
  65. void CDummyTransformationSceneNode::setRotation(const core::vector3df &rotation)
  66. {
  67. os::Printer::log("CDummyTransformationSceneNode::setRotation() does not affect the relative transformation.", ELL_DEBUG);
  68. RelativeRotation = rotation;
  69. }
  70. const core::vector3df &CDummyTransformationSceneNode::getPosition() const
  71. {
  72. os::Printer::log("CDummyTransformationSceneNode::getPosition() does not contain the relative transformation.", ELL_DEBUG);
  73. return RelativeTranslation;
  74. }
  75. void CDummyTransformationSceneNode::setPosition(const core::vector3df &newpos)
  76. {
  77. os::Printer::log("CDummyTransformationSceneNode::setPosition() does not affect the relative transformation.", ELL_DEBUG);
  78. RelativeTranslation = newpos;
  79. }
  80. } // end namespace scene
  81. } // end namespace irr