OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgrePCZSceneNode.h
Go to the documentation of this file.
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 PCZSceneNode.h - Node Zone Info header file.
28 The PCZSceneNode is an extension used to store zone information and provide
29 additional functionality for a given Ogre::SceneNode. A PCZSceneNode contains
30 a pointer to the home zone for the node and a list of all zones being visited by
31 the node. The PCZSceneManager contains a STD::MAP of PCZSceneNodes which are
32 keyed by the name of each node (each PCZSceneNode has an identical name to the
33 scene node which it is associated with). This allows quick lookup of
34 a given scenenode's PCZSceneNode by the scene manager.
35 -----------------------------------------------------------------------------
36 begin : Sat Mar 24 2007
37 author : Eric Cha
38 email : ericc@xenopi.com
39 Code Style Update :
40 -----------------------------------------------------------------------------
41 */
42 
43 #ifndef PCZ_SCENE_NODE_H
44 #define PCZ_SCENE_NODE_H
45 
46 #include "OgrePCZPrerequisites.h"
47 #include "OgreSceneNode.h"
48 #include "OgreSceneManager.h"
49 
50 namespace Ogre
51 {
52  // forward declarations
53  class PCZone;
54  class ZoneData;
55  class PCZCamera;
58 
60  {
61  public:
63  PCZSceneNode( SceneManager* creator );
65  PCZSceneNode( SceneManager* creator, const String& name );
67  ~PCZSceneNode();
68  void _update(bool updateChildren, bool parentHasChanged);
69  void updateFromParentImpl() const;
70 
77  virtual SceneNode* createChildSceneNode(
78  const Vector3& translate = Vector3::ZERO,
79  const Quaternion& rotate = Quaternion::IDENTITY );
80 
90  virtual SceneNode* createChildSceneNode(const String& name, const Vector3& translate = Vector3::ZERO, const Quaternion& rotate = Quaternion::IDENTITY);
91 
92 
93  PCZone* getHomeZone(void);
94  void setHomeZone(PCZone * zone);
95  void anchorToHomeZone(PCZone * zone);
96  bool isAnchored(void) {return mAnchored;}
97  void allowToVisit(bool yesno) {mAllowedToVisit = yesno;}
98  bool allowedToVisit(void) {return mAllowedToVisit;}
99  void addZoneToVisitingZonesMap(PCZone * zone);
100  void clearVisitingZonesMap(void);
101  void clearNodeFromVisitedZones( void );
102  void removeReferencesToZone(PCZone * zone);
103  bool isVisitingZone(PCZone * zone);
104  void _addToRenderQueue( Camera* cam,
105  RenderQueue *queue,
106  bool onlyShadowCasters,
107  VisibleObjectsBoundsInfo* visibleBounds );
108  void savePrevPosition(void);
109  Vector3& getPrevPosition(void) {return mPrevPosition;}
110  unsigned long getLastVisibleFrame(void) {return mLastVisibleFrame;}
111  void setLastVisibleFrame(unsigned long newLVF) {mLastVisibleFrame = newLVF;}
112  void setLastVisibleFromCamera(PCZCamera * camera) {mLastVisibleFromCamera = camera;}
113  PCZCamera* getLastVisibleFromCamera() {return mLastVisibleFromCamera;}
114  void setZoneData(PCZone * zone, ZoneData * zoneData);
115  ZoneData* getZoneData(PCZone * zone);
116  void updateZoneData(void);
117  void enable(bool yesno) {mEnabled = yesno;}
118  bool isEnabled(void) {return mEnabled;}
119  bool isMoved(void) {return mMoved;}
120  void setMoved(bool value) {mMoved = value;}
121  protected:
124  bool mAnchored;
128  unsigned long mLastVisibleFrame;
131  bool mEnabled;
132  mutable bool mMoved;
133  };
134 }
135 
136 #endif // PCZ_SCENE_NODE_H
void setLastVisibleFrame(unsigned long newLVF)
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:82
Manages the organisation and rendering of a 'scene' i.e.
static const Vector3 ZERO
Definition: OgreVector3.h:807
map< String, ZoneData * >::type ZoneDataMap
Class representing a node in the scene graph.
Definition: OgreSceneNode.h:53
Vector3 & getPrevPosition(void)
Implementation of a Quaternion, i.e.
void enable(bool yesno)
static const Quaternion IDENTITY
bool allowedToVisit(void)
unsigned long getLastVisibleFrame(void)
#define _OgrePCZPluginExport
void setLastVisibleFromCamera(PCZCamera *camera)
Standard 3-dimensional vector.
Definition: OgreVector3.h:50
PCZCamera * mLastVisibleFromCamera
std::map< String, PCZone *, P, A > type
unsigned long mLastVisibleFrame
void setMoved(bool value)
Class to manage the scene object rendering queue.
void allowToVisit(bool yesno)
Portal-Connected Zone datastructure for managing scene nodes.
Definition: OgrePCZone.h:81
_StringBase String
Definition: OgreCommon.h:53
PCZCamera * getLastVisibleFromCamera()
map< String, PCZone * >::type ZoneMap
Definition: OgrePCZone.h:67
Specialized viewpoint from which an PCZone Scene can be rendered.
Definition: OgrePCZCamera.h:52