OpenGothic
Open source reimplementation of Gothic I and II
Loading...
Searching...
No Matches
worldlight.cpp
Go to the documentation of this file.
1#include "worldlight.h"
2
3#include "world.h"
4
5WorldLight::WorldLight(Vob* parent, World& world, const zenkit::VLight& vob, Flags flags)
6 : Vob(parent,world,vob,flags) {
7 light = world.addLight(vob);
8 if(!vob.is_static && !vob.on) {
9 light.setEnabled(false);
10 return;
11 }
12
13 if(vob.is_static && !vob.on) {
14 //light.setEnabled(false);
15 //return;
16 }
17
18 if(vob.is_static &&
19 (vob.preset=="NW_STANDART_DARKBLUE" ||
20 vob.preset=="DEFAULTLIGHT_DARKBLUE" || vob.preset=="INROOM_DARKBLUE")) {
21 // ambient light-spam in many caves/houses
22 light.setEnabled(false);
23 }
24 if(vob.is_static && vob.preset.find("AMBIENCE_")==0) {
25 light.setEnabled(false);
26 }
27 if(vob.is_static && vob.preset.find("_STATIC")!=std::string::npos) {
28 //light.setEnabled(false);
29 }
30 if(vob.is_static && vob.preset=="SCHMUTZ") {
31 light.setEnabled(false);
32 }
33 if(vob.is_static && vob.range>3000.0) {
34 // unmotivated light blobs in old-mine ("MINE_DARK"/"MINE_DARKLIGHT")
35 light.setEnabled(false);
36 }
37 }
38
39void WorldLight::moveEvent() {
40 light.setPosition(position());
41 }
void setEnabled(bool e)
void setPosition(float x, float y, float z)
Definition vob.h:11
Flags
Definition vob.h:13
World & world
Definition vob.h:45
Tempest::Vec3 position() const
Definition vob.cpp:57
WorldLight(Vob *parent, World &world, const zenkit::VLight &vob, Flags flags)
Definition worldlight.cpp:5
Definition world.h:31
LightGroup::Light addLight(const zenkit::VLight &vob)
Definition world.cpp:283