Changeset View
Changeset View
Standalone View
Standalone View
source/gameengine/Converter/BlenderWorldInfo.cpp
| Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | |||||
| /* end of blender include block */ | /* end of blender include block */ | ||||
| BlenderWorldInfo::BlenderWorldInfo(struct Scene *blenderscene, struct World *blenderworld) | BlenderWorldInfo::BlenderWorldInfo(struct Scene *blenderscene, struct World *blenderworld) | ||||
| { | { | ||||
| if (blenderworld) { | if (blenderworld) { | ||||
| m_hasworld = true; | m_hasworld = true; | ||||
| m_hasmist = ((blenderworld->mode) & WO_MIST ? true : false); | m_hasmist = ((blenderworld->mode) & WO_MIST ? true : false); | ||||
| m_misttype = blenderworld->mistype; | |||||
| m_miststart = blenderworld->miststa; | m_miststart = blenderworld->miststa; | ||||
| m_mistdistance = blenderworld->mistdist; | m_mistdistance = blenderworld->mistdist; | ||||
| m_mistintensity = blenderworld->misi; | |||||
| copy_v3_v3(m_mistcolor, &blenderworld->horr); | copy_v3_v3(m_mistcolor, &blenderworld->horr); | ||||
| copy_v3_v3(m_backgroundcolor, &blenderworld->horr); | copy_v3_v3(m_backgroundcolor, &blenderworld->horr); | ||||
| copy_v3_v3(m_ambientcolor, &blenderworld->ambr); | copy_v3_v3(m_ambientcolor, &blenderworld->ambr); | ||||
| if (BKE_scene_check_color_management_enabled(blenderscene)) { | if (BKE_scene_check_color_management_enabled(blenderscene)) { | ||||
| linearrgb_to_srgb_v3_v3(m_mistcolor, m_mistcolor); | linearrgb_to_srgb_v3_v3(m_mistcolor, m_mistcolor); | ||||
| linearrgb_to_srgb_v3_v3(m_backgroundcolor, m_backgroundcolor); | linearrgb_to_srgb_v3_v3(m_backgroundcolor, m_backgroundcolor); | ||||
| linearrgb_to_srgb_v3_v3(m_ambientcolor, m_ambientcolor); | linearrgb_to_srgb_v3_v3(m_ambientcolor, m_ambientcolor); | ||||
| ▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | float BlenderWorldInfo::getAmbientColorGreen() | ||||
| return m_ambientcolor[1]; | return m_ambientcolor[1]; | ||||
| } | } | ||||
| float BlenderWorldInfo::getAmbientColorBlue() | float BlenderWorldInfo::getAmbientColorBlue() | ||||
| { | { | ||||
| return m_ambientcolor[2]; | return m_ambientcolor[2]; | ||||
| } | } | ||||
| short BlenderWorldInfo::getMistType() | |||||
| { | |||||
| return m_misttype; | |||||
| } | |||||
| float BlenderWorldInfo::getMistStart() | float BlenderWorldInfo::getMistStart() | ||||
| { | { | ||||
| return m_miststart; | return m_miststart; | ||||
| } | } | ||||
| float BlenderWorldInfo::getMistDistance() | float BlenderWorldInfo::getMistDistance() | ||||
| { | { | ||||
| return m_mistdistance; | return m_mistdistance; | ||||
| } | } | ||||
| float BlenderWorldInfo::getMistIntensity() | |||||
| { | |||||
| return m_mistintensity; | |||||
| } | |||||
| float BlenderWorldInfo::getMistColorRed() | float BlenderWorldInfo::getMistColorRed() | ||||
| { | { | ||||
| return m_mistcolor[0]; | return m_mistcolor[0]; | ||||
| } | } | ||||
| float BlenderWorldInfo::getMistColorGreen() | float BlenderWorldInfo::getMistColorGreen() | ||||
| { | { | ||||
| return m_mistcolor[1]; | return m_mistcolor[1]; | ||||
| } | } | ||||
| float BlenderWorldInfo::getMistColorBlue() | float BlenderWorldInfo::getMistColorBlue() | ||||
| { | { | ||||
| return m_mistcolor[2]; | return m_mistcolor[2]; | ||||
| } | } | ||||
| void BlenderWorldInfo::setBackColor(float r, float g, float b) | void BlenderWorldInfo::setBackColor(float r, float g, float b) | ||||
| { | { | ||||
| m_backgroundcolor[0] = r; | m_backgroundcolor[0] = r; | ||||
| m_backgroundcolor[1] = g; | m_backgroundcolor[1] = g; | ||||
| m_backgroundcolor[2] = b; | m_backgroundcolor[2] = b; | ||||
| } | } | ||||
| void BlenderWorldInfo::setMistType(short type) | |||||
| { | |||||
| m_misttype = type; | |||||
| } | |||||
| void BlenderWorldInfo::setUseMist(bool enable) | void BlenderWorldInfo::setUseMist(bool enable) | ||||
| { | { | ||||
| m_hasmist = enable; | m_hasmist = enable; | ||||
| } | } | ||||
| void BlenderWorldInfo::setMistStart(float d) | void BlenderWorldInfo::setMistStart(float d) | ||||
| { | { | ||||
| m_miststart = d; | m_miststart = d; | ||||
| } | } | ||||
| void BlenderWorldInfo::setMistDistance(float d) | void BlenderWorldInfo::setMistDistance(float d) | ||||
| { | { | ||||
| m_mistdistance = d; | m_mistdistance = d; | ||||
| } | } | ||||
| void BlenderWorldInfo::setMistIntensity(float intensity) | |||||
| { | |||||
| m_mistintensity = intensity; | |||||
| } | |||||
| void BlenderWorldInfo::setMistColor(float r, float g, float b) | void BlenderWorldInfo::setMistColor(float r, float g, float b) | ||||
| { | { | ||||
| m_mistcolor[0] = r; | m_mistcolor[0] = r; | ||||
| m_mistcolor[1] = g; | m_mistcolor[1] = g; | ||||
| m_mistcolor[2] = b; | m_mistcolor[2] = b; | ||||
| } | } | ||||
| void BlenderWorldInfo::setAmbientColor(float r, float g, float b) | void BlenderWorldInfo::setAmbientColor(float r, float g, float b) | ||||
| { | { | ||||
| m_ambientcolor[0] = r; | m_ambientcolor[0] = r; | ||||
| m_ambientcolor[1] = g; | m_ambientcolor[1] = g; | ||||
| m_ambientcolor[2] = b; | m_ambientcolor[2] = b; | ||||
| } | } | ||||