OGRE  1.8
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-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 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 <OgreSceneNode.h>
47 #include "OgrePCZPrerequisites.h"
48 
49 namespace Ogre
50 {
51  // forward declarations
52  class PCZone;
53  class ZoneData;
54  class PCZCamera;
57 
59  {
60  public:
62  PCZSceneNode( SceneManager* creator );
64  PCZSceneNode( SceneManager* creator, const String& name );
66  ~PCZSceneNode();
67  void _update(bool updateChildren, bool parentHasChanged);
68  void updateFromParentImpl() const;
69 
76  virtual SceneNode* createChildSceneNode(
77  const Vector3& translate = Vector3::ZERO,
78  const Quaternion& rotate = Quaternion::IDENTITY );
79 
89  virtual SceneNode* createChildSceneNode(const String& name, const Vector3& translate = Vector3::ZERO, const Quaternion& rotate = Quaternion::IDENTITY);
90 
91 
92  PCZone* getHomeZone(void);
93  void setHomeZone(PCZone * zone);
94  void anchorToHomeZone(PCZone * zone);
95  bool isAnchored(void) {return mAnchored;}
96  void allowToVisit(bool yesno) {mAllowedToVisit = yesno;}
97  bool allowedToVisit(void) {return mAllowedToVisit;}
98  void addZoneToVisitingZonesMap(PCZone * zone);
99  void clearVisitingZonesMap(void);
100  void clearNodeFromVisitedZones( void );
101  void removeReferencesToZone(PCZone * zone);
102  bool isVisitingZone(PCZone * zone);
103  void _addToRenderQueue( Camera* cam,
104  RenderQueue *queue,
105  bool onlyShadowCasters,
106  VisibleObjectsBoundsInfo* visibleBounds );
107  void savePrevPosition(void);
108  Vector3& getPrevPosition(void) {return mPrevPosition;}
109  unsigned long getLastVisibleFrame(void) {return mLastVisibleFrame;}
110  void setLastVisibleFrame(unsigned long newLVF) {mLastVisibleFrame = newLVF;}
111  void setLastVisibleFromCamera(PCZCamera * camera) {mLastVisibleFromCamera = camera;}
112  PCZCamera* getLastVisibleFromCamera() {return mLastVisibleFromCamera;}
113  void setZoneData(PCZone * zone, ZoneData * zoneData);
114  ZoneData* getZoneData(PCZone * zone);
115  void updateZoneData(void);
116  void enable(bool yesno) {mEnabled = yesno;}
117  bool isEnabled(void) {return mEnabled;}
118  bool isMoved(void) {return mMoved;}
119  void setMoved(bool value) {mMoved = value;}
120  protected:
123  bool mAnchored;
127  unsigned long mLastVisibleFrame;
130  bool mEnabled;
131  mutable bool mMoved;
132  };
133 }
134 
135 #endif // PCZ_SCENE_NODE_H
void setLastVisibleFrame(unsigned long newLVF)
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:86
Manages the organisation and rendering of a 'scene' i.e.
static const Vector3 ZERO
Definition: OgreVector3.h:796
map< String, ZoneData * >::type ZoneDataMap
Class representing a node in the scene graph.
Definition: OgreSceneNode.h:58
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:51
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:82
_StringBase String
Structure collecting together information about the visible objects that have been discovered in a sc...
PCZCamera * getLastVisibleFromCamera()
map< String, PCZone * >::type ZoneMap
Definition: OgrePCZone.h:67
Specialized viewpoint from which an PCZone Scene can be rendered.
Definition: OgrePCZCamera.h:56