OGRE  1.8
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgrePCZLight.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 PCZLight.h - description
28 -----------------------------------------------------------------------------
29 begin : Wed May 23 2007
30 author : Eric Cha
31 email : ericc@xenopi.com
32 Code Style Update :
33 -----------------------------------------------------------------------------
34 */
35 
36 #ifndef PCZLIGHT_H
37 #define PCZLIGHT_H
38 
39 #include <OgreLight.h>
40 #include "OgrePCZPrerequisites.h"
41 #include "OgrePCZone.h"
42 
43 namespace Ogre
44 {
45 
47 
53  {
54  public:
57  PCZLight();
58 
61  PCZLight(const String& name);
62 
65  ~PCZLight();
66 
68  const String& getMovableType(void) const;
69 
72  void clearAffectedZones(void);
73 
76  void addZoneToAffectedZonesList(PCZone * zone);
77 
80  bool affectsZone(PCZone * zone);
81 
85  bool affectsVisibleZone(void) {return mAffectsVisibleZone;}
86 
88  void setAffectsVisibleZone(bool affects) { mAffectsVisibleZone = affects; }
89 
92  void updateZones(PCZone * defaultZone, unsigned long frameCount);
93 
94  void removeZoneFromAffectedZonesList(PCZone * zone); // manually remove a zone from the affected list
95 
96  // MovableObject notified when SceneNode changes
97  virtual void _notifyMoved(void);
98 
99  // clear update flag
100  void clearNeedsUpdate(void) { mNeedsUpdate = false; }
101 
102  // get status of need for update. this checks all affected zones
103  bool getNeedsUpdate(void);
104 
105  protected:
110 
114 
115  // flag recording if light has moved, therefore affected list needs updating
117  };
118 
121  {
122  protected:
123  MovableObject* createInstanceImpl( const String& name, const NameValuePairList* params);
124  public:
127 
129 
130  const String& getType(void) const;
131  void destroyInstance( MovableObject* obj);
132 
133  };
134 
135 
136 } // Namespace
137 #endif
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
Definition: OgreCommon.h:553
list< PCZone * >::type ZoneList
Definition: OgrePCZLight.h:46
ZoneList affectedZonesList
List of PCZones which are affected by the light.
Definition: OgrePCZLight.h:113
Interface definition for a factory class which produces a certain kind of MovableObject, and can be registered with Root in order to allow all clients to produce new instances of this object, integrated with the standard Ogre processing.
bool affectsVisibleZone(void)
returns flag indicating if the light affects a zone which is visible in the current frame ...
Definition: OgrePCZLight.h:85
void clearNeedsUpdate(void)
Definition: OgrePCZLight.h:100
Abstract class defining a movable object in a scene.
Representation of a dynamic light source in the scene.
Definition: OgreLight.h:73
void setAffectsVisibleZone(bool affects)
Marks a light as affecting a visible zone.
Definition: OgrePCZLight.h:88
bool mAffectsVisibleZone
flag indicating if any of the zones in the affectedZonesList is visible in the current frame ...
Definition: OgrePCZLight.h:109
Specialized version of Ogre::Light which caches which zones the light affects.
Definition: OgrePCZLight.h:52
Factory object for creating PCZLight instances.
Definition: OgrePCZLight.h:120
#define _OgrePCZPluginExport
static String FACTORY_TYPE_NAME
Definition: OgrePCZLight.h:128
Portal-Connected Zone datastructure for managing scene nodes.
Definition: OgrePCZone.h:82
_StringBase String