OGRE  1.9
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgrePortal.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 Portal.h - Portals are special constructs which which are used to connect
28  two Zones in a PCZScene. Portals are defined by 4 coplanr
29  corners and a direction. Portals are contained within Zones and
30  are essentially "one way" connectors. Objects and entities can
31  use them to travel to other Zones, but to return, there must be
32  a corresponding Portal which connects back to the original zone
33  from the new zone.
34 
35 -----------------------------------------------------------------------------
36 begin : Thu Feb 22 2007
37 author : Eric Cha
38 email : ericc@xenopi.com
39 Code Style Update : Apr 5, 2007
40 -----------------------------------------------------------------------------
41 */
42 
43 #ifndef PORTAL_H
44 #define PORTAL_H
45 
46 #include "OgrePortalBase.h"
47 
48 namespace Ogre
49 {
52  {
53  public:
54  Portal(const String &name, const PORTAL_TYPE type = PORTAL_TYPE_QUAD);
55  virtual ~Portal();
56 
57  void setTargetZone(PCZone* zone);
59  void setTargetPortal(Portal* portal);
60 
62  PCZone* getTargetZone() {return mTargetZone;}
64  Portal* getTargetPortal() {return mTargetPortal;}
65 
67  const String& getMovableType() const;
68 
69  protected:
76  };
77 
80  {
81  protected:
82  MovableObject* createInstanceImpl(const String& name, const NameValuePairList* params);
83  public:
86 
88  static unsigned long FACTORY_TYPE_FLAG;
89 
90  const String& getType() const
91  { return FACTORY_TYPE_NAME; }
92 
93  void destroyInstance(MovableObject* obj);
94 
96  bool requestTypeFlags() const
97  { return true; }
98 
99  };
100 
101 }
102 
103 #endif
104 
105 
106 
Factory object for creating Portal instances.
Definition: OgrePortal.h:79
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
Definition: OgreCommon.h:550
PCZone * mTargetZone
connected Zone
Definition: OgrePortal.h:71
PortalBase - Base class to Portal and AntiPortal classes.
Abstract class defining a movable object in a scene.
Portal * getTargetPortal()
Get the connected portal (if any)
Definition: OgrePortal.h:64
PCZone * getTargetZone()
Get the Zone the Portal connects to.
Definition: OgrePortal.h:62
Portal datastructure for connecting zones.
Definition: OgrePortal.h:51
const String & getType() const
Get the type of the object to be created.
Definition: OgrePortal.h:90
Portal * mTargetPortal
Matching Portal in the target zone (usually in same world space as this portal, but pointing the oppo...
Definition: OgrePortal.h:75
#define _OgrePCZPluginExport
static String FACTORY_TYPE_NAME
Definition: OgrePortal.h:87
bool requestTypeFlags() const
Return true here as we want to get a unique type flag.
Definition: OgrePortal.h:96
Portal-Connected Zone datastructure for managing scene nodes.
Definition: OgrePCZone.h:81
static unsigned long FACTORY_TYPE_FLAG
Definition: OgrePortal.h:88
_StringBase String
Factory object for creating Portal instances.