OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
effect.hpp
Go to the documentation of this file.
1 /*
2  OpenMW - The completely unofficial reimplementation of Morrowind
3  Copyright (C) 2008-2010 Nicolay Korslund
4  Email: < korslund@gmail.com >
5  WWW: http://openmw.sourceforge.net/
6 
7  This file (effect.h) is part of the OpenMW package.
8 
9  OpenMW is distributed as free software: you can redistribute it
10  and/or modify it under the terms of the GNU General Public License
11  version 3, as published by the Free Software Foundation.
12 
13  This program is distributed in the hope that it will be useful, but
14  WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  version 3 along with this program. If not, see
20  http://www.gnu.org/licenses/ .
21 
22  */
23 
24 #ifndef OPENMW_COMPONENTS_NIF_EFFECT_HPP
25 #define OPENMW_COMPONENTS_NIF_EFFECT_HPP
26 
27 #include "node.hpp"
28 
29 namespace Nif
30 {
31 
32 struct NiDynamicEffect : public Node
33 {
34  void read(NIFStream *nif)
35  {
36  Node::read(nif);
37  unsigned int numAffectedNodes = nif->getUInt();
38  for (unsigned int i=0; i<numAffectedNodes; ++i)
39  nif->getUInt(); // ref to another Node
40  }
41 };
42 
43 // Used as base for NiAmbientLight, NiDirectionalLight, NiPointLight and NiSpotLight.
45 {
46  float dimmer;
47  osg::Vec3f ambient;
48  osg::Vec3f diffuse;
49  osg::Vec3f specular;
50 
51  void read(NIFStream *nif);
52 };
53 
54 struct NiPointLight : public NiLight
55 {
59 
60  void read(NIFStream *nif);
61 };
62 
63 struct NiSpotLight : public NiPointLight
64 {
65  float cutoff;
66  float exponent;
67  void read(NIFStream *nif);
68 };
69 
71 {
73  unsigned int clamp;
74 
76  {
80  Fog_Map = 3
81  };
83 
85  {
91  };
93 
94  void read(NIFStream *nif);
95  void post(NIFFile *nif);
96 };
97 
98 } // Namespace
99 #endif
Definition: niffile.hpp:17
Definition: effect.hpp:88
float quadraticAttenuation
Definition: effect.hpp:58
Definition: effect.hpp:32
void read(NIFStream *nif)
Parses the record from file.
Definition: effect.cpp:18
void read(NIFStream *nif)
Parses the record from file.
Definition: effect.cpp:8
osg::Vec3f diffuse
Definition: effect.hpp:48
osg::Vec3f ambient
Definition: effect.hpp:47
CoordGenType
Definition: effect.hpp:84
Definition: effect.hpp:77
void read(NIFStream *nif)
Parses the record from file.
Definition: node.hpp:38
float constantAttenuation
Definition: effect.hpp:56
Definition: effect.hpp:54
float dimmer
Definition: effect.hpp:46
float cutoff
Definition: effect.hpp:65
float exponent
Definition: effect.hpp:66
CoordGenType coordGenType
Definition: effect.hpp:92
void read(NIFStream *nif)
Parses the record from file.
Definition: effect.cpp:55
void read(NIFStream *nif)
Parses the record from file.
Definition: effect.cpp:64
TextureType
Definition: effect.hpp:75
unsigned int clamp
Definition: effect.hpp:73
Definition: effect.hpp:79
Definition: node.hpp:23
Definition: effect.hpp:70
void post(NIFFile *nif)
Does post-processing, after the entire tree is loaded.
Definition: effect.cpp:49
float linearAttenuation
Definition: effect.hpp:57
Definition: effect.hpp:86
Definition: effect.hpp:80
Definition: nifstream.hpp:26
unsigned int getUInt()
Definition: nifstream.hpp:48
Definition: effect.hpp:63
void read(NIFStream *nif)
Parses the record from file.
Definition: effect.hpp:34
NiSourceTexturePtr texture
Definition: effect.hpp:72
Definition: effect.hpp:44
TextureType textureType
Definition: effect.hpp:82
osg::Vec3f specular
Definition: effect.hpp:49