3 * ***** BEGIN GPL LICENSE BLOCK *****
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
20 * All rights reserved.
22 * The Original Code is: all of this file.
24 * Contributor(s): none yet.
26 * ***** END GPL LICENSE BLOCK *****
29 #include <stdio.h> // printf()
31 #include "BlenderWorldInfo.h"
32 #include "KX_BlenderGL.h"
34 /* This little block needed for linking to Blender... */
36 #include "BLI_winstuff.h"
39 /* This list includes only data type definitions */
40 #include "DNA_object_types.h"
41 #include "DNA_material_types.h"
42 #include "DNA_image_types.h"
43 #include "DNA_lamp_types.h"
44 #include "DNA_group_types.h"
45 #include "DNA_scene_types.h"
46 #include "DNA_camera_types.h"
47 #include "DNA_property_types.h"
48 #include "DNA_text_types.h"
49 #include "DNA_sensor_types.h"
50 #include "DNA_controller_types.h"
51 #include "DNA_actuator_types.h"
52 #include "DNA_mesh_types.h"
53 #include "DNA_meshdata_types.h"
54 #include "DNA_view3d_types.h"
55 #include "DNA_world_types.h"
56 #include "DNA_screen_types.h"
58 #include "BKE_global.h"
59 /* end of blender include block */
62 BlenderWorldInfo::BlenderWorldInfo(struct World* blenderworld)
69 if ((blenderworld->mode) & WO_MIST)
72 m_miststart = blenderworld->miststa;
73 m_mistdistance = blenderworld->mistdist;
74 m_mistred = blenderworld->horr;
75 m_mistgreen = blenderworld->horg;
76 m_mistblue = blenderworld->horb;
88 m_backgroundred = blenderworld->horr;
89 m_backgroundgreen = blenderworld->horg;
90 m_backgroundblue = blenderworld->horb;
92 m_ambientred = blenderworld->ambr;
93 m_ambientgreen = blenderworld->ambg;
94 m_ambientblue = blenderworld->ambb;
104 BlenderWorldInfo::~BlenderWorldInfo()
110 bool BlenderWorldInfo::hasWorld()
117 bool BlenderWorldInfo::hasMist()
124 float BlenderWorldInfo::getBackColorRed()
126 return m_backgroundred;
131 float BlenderWorldInfo::getBackColorGreen()
133 return m_backgroundgreen;
138 float BlenderWorldInfo::getBackColorBlue()
140 return m_backgroundblue;
144 float BlenderWorldInfo::getAmbientColorRed()
149 float BlenderWorldInfo::getAmbientColorGreen()
151 return m_ambientgreen;
154 float BlenderWorldInfo::getAmbientColorBlue()
156 return m_ambientblue;
159 float BlenderWorldInfo::getMistStart()
166 float BlenderWorldInfo::getMistDistance()
168 return m_mistdistance;
173 float BlenderWorldInfo::getMistColorRed()
180 float BlenderWorldInfo::getMistColorGreen()
187 float BlenderWorldInfo::getMistColorBlue()
194 BlenderWorldInfo::setMistStart(
202 BlenderWorldInfo::setMistDistance(
210 BlenderWorldInfo::setMistColorRed(
218 BlenderWorldInfo::setMistColorGreen(
226 BlenderWorldInfo::setMistColorBlue(