TrueReality  v0.1.1912
SkyBoxNode.h
Go to the documentation of this file.
1 /*
2 * True Reality Open Source Game and Simulation Engine
3 * Copyright © 2021 Acid Rain Studios LLC
4 *
5 * This library is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU Lesser General Public License as published by the Free
7 * Software Foundation; either version 3.0 of the License, or (at your option)
8 * any later version.
9 *
10 * This library is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this library; if not, write to the Free Software Foundation, Inc.,
17 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * @author Maxim Serebrennik
20 */
21 
22 #pragma once
23 
24 #include <trCore/Export.h>
25 
26 #include <trBase/SmrtPtr.h>
27 
28 #include <osg/Matrix>
29 #include <osg/Node>
30 #include <osg/NodeVisitor>
31 #include <osg/Transform>
32 
33 namespace trCore::SceneObjects
34 {
35 
44  class TR_CORE_EXPORT SkyBoxNode : public osg::Transform
45  {
46  public:
47 
48  using BaseClass = osg::Transform;
49 
55  SkyBoxNode();
56 
67  virtual bool computeLocalToWorldMatrix(osg::Matrix& matrix, osg::NodeVisitor* nv) const override;
68 
79  virtual bool computeWorldToLocalMatrix(osg::Matrix& matrix, osg::NodeVisitor* nv) const override;
80 
90  bool LoadFile(std::string fileName);
91 
92  protected:
93 
94  trBase::SmrtPtr<osg::Node> mNode = nullptr;
95 
101  ~SkyBoxNode();
102  };
103 }
#define TR_CORE_EXPORT
Definition: trCore/Export.h:33
Namespace that contains controls for sample scene objects.
Matrixf Matrix
Definition: Matrix.h:33
A sky box class that creates an object that is always positioned around the camera. This class can load any geometry, box or dome...
Definition: SkyBoxNode.h:44