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-2013 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 | @remarks |
---|
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 | protected: |
---|
57 | mutable Plane mDerivedPlane; |
---|
58 | mutable Vector3 mLastTranslate; |
---|
59 | mutable Quaternion mLastRotate; |
---|
60 | AxisAlignedBox mNullBB; |
---|
61 | mutable bool mDirty; |
---|
62 | static String msMovableType; |
---|
63 | public: |
---|
64 | |
---|
65 | MovablePlane(const String& name); |
---|
66 | MovablePlane (const Plane& rhs); |
---|
67 | /** Construct a plane through a normal, and a distance to move the plane along the normal.*/ |
---|
68 | MovablePlane (const Vector3& rkNormal, Real fConstant); |
---|
69 | MovablePlane (const Vector3& rkNormal, const Vector3& rkPoint); |
---|
70 | MovablePlane (const Vector3& rkPoint0, const Vector3& rkPoint1, |
---|
71 | const Vector3& rkPoint2); |
---|
72 | ~MovablePlane() {} |
---|
73 | /// Overridden from MovableObject |
---|
74 | void _notifyCurrentCamera(Camera*) { /* don't care */ } |
---|
75 | /// Overridden from MovableObject |
---|
76 | const AxisAlignedBox& getBoundingBox(void) const { return mNullBB; } |
---|
77 | /// Overridden from MovableObject |
---|
78 | Real getBoundingRadius(void) const { return 0.0f; } |
---|
79 | /// Overridden from MovableObject |
---|
80 | void _updateRenderQueue(RenderQueue*) { /* do nothing */} |
---|
81 | /// Overridden from MovableObject |
---|
82 | const String& getMovableType(void) const; |
---|
83 | /// Get the derived plane as transformed by its parent node. |
---|
84 | const Plane& _getDerivedPlane(void) const; |
---|
85 | /// @copydoc MovableObject::visitRenderables |
---|
86 | void visitRenderables(Renderable::Visitor* visitor, |
---|
87 | bool debugRenderables = false) |
---|
88 | { |
---|
89 | /* do nothing */ |
---|
90 | (void)visitor; |
---|
91 | (void)debugRenderables; |
---|
92 | } |
---|
93 | |
---|
94 | }; |
---|
95 | /** @} */ |
---|
96 | /** @} */ |
---|
97 | } |
---|
98 | |
---|
99 | #include "OgreHeaderSuffix.h" |
---|
100 | |
---|
101 | #endif |
---|