/src/ogre/OgreMain/include/OgreMovablePlane.h
Line | Count | Source |
1 | | /* |
2 | | ----------------------------------------------------------------------------- |
3 | | This source file is part of OGRE |
4 | | (Object-oriented Graphics Rendering Engine) |
5 | | For the latest info, see http://www.ogre3d.org/ |
6 | | |
7 | | Copyright (c) 2000-2014 Torus Knot Software Ltd |
8 | | |
9 | | Permission is hereby granted, free of charge, to any person obtaining a copy |
10 | | of this software and associated documentation files (the "Software"), to deal |
11 | | in the Software without restriction, including without limitation the rights |
12 | | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
13 | | copies of the Software, and to permit persons to whom the Software is |
14 | | furnished to do so, subject to the following conditions: |
15 | | |
16 | | The above copyright notice and this permission notice shall be included in |
17 | | all copies or substantial portions of the Software. |
18 | | |
19 | | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
20 | | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
21 | | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
22 | | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
23 | | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
24 | | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
25 | | THE SOFTWARE. |
26 | | ----------------------------------------------------------------------------- |
27 | | */ |
28 | | #ifndef __MovablePlane_H__ |
29 | | #define __MovablePlane_H__ |
30 | | |
31 | | #include "OgrePrerequisites.h" |
32 | | |
33 | | #include "OgrePlane.h" |
34 | | #include "OgreMovableObject.h" |
35 | | #include "OgreHeaderPrefix.h" |
36 | | |
37 | | namespace Ogre { |
38 | | |
39 | | |
40 | | /** \addtogroup Core |
41 | | * @{ |
42 | | */ |
43 | | /** \addtogroup Scene |
44 | | * @{ |
45 | | */ |
46 | | /** Definition of a Plane that may be attached to a node, and the derived |
47 | | details of it retrieved simply. |
48 | | |
49 | | This plane is not here for rendering purposes, it's to allow you to attach |
50 | | planes to the scene in order to have them move and follow nodes on their |
51 | | own, which is useful if you're using the plane for some kind of calculation, |
52 | | e.g. reflection. |
53 | | */ |
54 | | class _OgreExport MovablePlane : public Plane, public MovableObject |
55 | | { |
56 | | private: |
57 | | mutable Plane mDerivedPlane; |
58 | | mutable Vector3 mLastTranslate; |
59 | | mutable Quaternion mLastRotate; |
60 | | mutable bool mDirty; |
61 | | public: |
62 | | |
63 | | MovablePlane(const String& name); |
64 | | MovablePlane (const Plane& rhs); |
65 | | /** Construct a plane through a normal, and a distance to move the plane along the normal.*/ |
66 | | MovablePlane (const Vector3& rkNormal, Real fConstant); |
67 | | MovablePlane (const Vector3& rkNormal, const Vector3& rkPoint); |
68 | | MovablePlane (const Vector3& rkPoint0, const Vector3& rkPoint1, |
69 | | const Vector3& rkPoint2); |
70 | 0 | ~MovablePlane() {} |
71 | | /// Overridden from MovableObject |
72 | 0 | void _notifyCurrentCamera(Camera*) override { /* don't care */ } |
73 | | /// Overridden from MovableObject |
74 | 0 | const AxisAlignedBox& getBoundingBox(void) const override { return AxisAlignedBox::BOX_NULL; } |
75 | | /// Overridden from MovableObject |
76 | 0 | Real getBoundingRadius(void) const override { return 0.0f; } |
77 | | /// Overridden from MovableObject |
78 | 0 | void _updateRenderQueue(RenderQueue*) override { /* do nothing */} |
79 | | /// Overridden from MovableObject |
80 | | const String& getMovableType(void) const override; |
81 | | /// Get the derived plane as transformed by its parent node. |
82 | | const Plane& _getDerivedPlane(void) const; |
83 | | /// @copydoc MovableObject::visitRenderables |
84 | | void visitRenderables(Renderable::Visitor* visitor, |
85 | | bool debugRenderables = false) override |
86 | 0 | { |
87 | | /* do nothing */ |
88 | 0 | (void)visitor; |
89 | 0 | (void)debugRenderables; |
90 | 0 | } |
91 | | |
92 | | }; |
93 | | /** @} */ |
94 | | /** @} */ |
95 | | } |
96 | | |
97 | | #include "OgreHeaderSuffix.h" |
98 | | |
99 | | #endif |