SuperTuxKart
per_camera_node.hpp
1 // SuperTuxKart - a fun racing game with go-kart
2 // Copyright (C) 2011-2015 Marianne Gagnon
3 // based on code Copyright 2002-2010 Nikolaus Gebhardt
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 3
8 // of the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 
19 #ifndef HEADER_PER_CAMERA_HPP
20 #define HEADER_PER_CAMERA_HPP
21 
22 #include <matrix4.h>
23 #include <aabbox3d.h>
24 #include <IDummyTransformationSceneNode.h>
25 #include <ESceneNodeTypes.h>
26 namespace irr
27 {
28  namespace scene { class ICameraSceneNode; class ISceneNode; class ISceneManager; class IMesh; }
29 }
30 using namespace irr;
31 
32 
33 namespace irr
34 {
35  namespace scene
36  {
37  const int ESNT_PER_CAMERA_NODE = MAKE_IRR_ID('p','c','a','m');
38  }
39 }
40 
45 class PerCameraNode : public scene::IDummyTransformationSceneNode
46 {
47 private:
48  core::matrix4 RelativeTransformationMatrix;
49  core::aabbox3d<f32> Box;
50 
51  scene::ICameraSceneNode* m_camera;
52  scene::ISceneNode* m_child;
53 
54 public:
55 
56  PerCameraNode(scene::ISceneNode* parent, scene::ISceneManager* mgr, s32 id,
57  scene::ICameraSceneNode* camera, scene::ISceneNode* node);
58  virtual ~PerCameraNode();
59 
61  virtual const core::aabbox3d<f32>& getBoundingBox() const { return Box; }
62 
66  virtual core::matrix4& getRelativeTransformationMatrix() { return RelativeTransformationMatrix; }
67 
69  virtual core::matrix4 getRelativeTransformation() const { return RelativeTransformationMatrix; }
70 
71  void setCamera(scene::ICameraSceneNode* camera);
72 
73  virtual void OnRegisterSceneNode();
74  virtual void render();
75 
76  virtual scene::ESCENE_NODE_TYPE getType() const { return (scene::ESCENE_NODE_TYPE)scene::ESNT_PER_CAMERA_NODE; }
77 
78  scene::ISceneNode* getChild() { return m_child; }
79 };
80 
81 #endif
82 
virtual core::matrix4 & getRelativeTransformationMatrix()
Returns a reference to the current relative transformation matrix.
Definition: per_camera_node.hpp:66
virtual const core::aabbox3d< f32 > & getBoundingBox() const
returns the axis aligned bounding box of this node
Definition: per_camera_node.hpp:61
virtual core::matrix4 getRelativeTransformation() const
Returns the relative transformation of the scene node.
Definition: per_camera_node.hpp:69
manages smoke particle effects
Definition: per_camera_node.hpp:45