Commit 484e4270 authored by Jan Möbius's avatar Jan Möbius

Extra cc file for the skydome type

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free-Staging@16407 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 3526200b
...@@ -242,9 +242,12 @@ getRenderObjects(ACG::IRenderer* _renderer, ACG::GLState& _state , const ACG::S ...@@ -242,9 +242,12 @@ getRenderObjects(ACG::IRenderer* _renderer, ACG::GLState& _state , const ACG::S
QString filename = dome_.textureFileName(); QString filename = dome_.textureFileName();
// Fallback image // Fallback image
if ( !info.exists() ) if ( !info.exists() ) {
std::cerr << "Did not find image!" << filename.toStdString() << std::endl;
filename = OpenFlipper::Options::iconDirStr() + QDir::separator() + "EmptySkyDome.png"; filename = OpenFlipper::Options::iconDirStr() + QDir::separator() + "EmptySkyDome.png";
}
// Test: Load texture image // Test: Load texture image
QImage texture(filename); QImage texture(filename);
......
...@@ -162,7 +162,11 @@ void SkyDomeObject::setName( QString _name ) { ...@@ -162,7 +162,11 @@ void SkyDomeObject::setName( QString _name ) {
// =============================================================================== // ===============================================================================
void SkyDomeObject::update(UpdateType _type) { void SkyDomeObject::update(UpdateType _type) {
skyDomeNode_->update();
// Only the texture update is relevant. The other updates
// Are uniforms which are required on each draw anyway
if (_type.contains(UPDATE_TEXTURE) )
skyDomeNode_->update();
} }
// =============================================================================== // ===============================================================================
...@@ -191,7 +195,10 @@ QString SkyDomeObject::getObjectinfo() { ...@@ -191,7 +195,10 @@ QString SkyDomeObject::getObjectinfo() {
if ( dataType( DATA_SKYDOME ) ) if ( dataType( DATA_SKYDOME ) )
output += "Object Contains SkyDome : "; output += "Object Contains SkyDome : ";
output += " Horizontal FOV: ( " + QString::number(skyDome_.horizontalFOV()) + ")"; output += " Horizontal FOV: " + QString::number(skyDome_.horizontalFOV());
output += " Vertical FOV: " + QString::number(skyDome_.verticalFOV());
output += " Top Cutoff : " + QString::number(skyDome_.topOffset());
output += " Image File : " + skyDome_.textureFileName();
output += "========================================================================\n"; output += "========================================================================\n";
return output; return output;
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
//============================================================================= //=============================================================================
/** /**
* \file SkyDomeType.c * \file SkyDomeType.cc
* This File contains the implementation for SkyDome * This File contains the implementation for SkyDome
*/ */
...@@ -57,6 +57,8 @@ ...@@ -57,6 +57,8 @@
#include "SkyDomeType.hh" #include "SkyDomeType.hh"
#include <iostream>
//== SkyDome Implementation =============================================== //== SkyDome Implementation ===============================================
...@@ -74,11 +76,11 @@ QString SkyDome::textureFileName() { ...@@ -74,11 +76,11 @@ QString SkyDome::textureFileName() {
return textureFileName_; return textureFileName_;
} }
void SkyDome::setTextureFileName(QString _textureFileName) { void SkyDome::setTextureFileName(const QString& _textureFileName) {
textureFileName_ = _textureFileName; textureFileName_ = _textureFileName;
} }
void SkyDome::setHorizontalFOV( float _value) { void SkyDome::setHorizontalFOV( const float& _value) {
horizontalFOV_ = _value; horizontalFOV_ = _value;
} }
...@@ -86,7 +88,7 @@ float SkyDome::horizontalFOV() { ...@@ -86,7 +88,7 @@ float SkyDome::horizontalFOV() {
return horizontalFOV_; return horizontalFOV_;
} }
void SkyDome::setVerticalFOV( float _value) { void SkyDome::setVerticalFOV( const float& _value) {
verticalFOV_ = _value; verticalFOV_ = _value;
} }
...@@ -94,7 +96,7 @@ float SkyDome::verticalFOV() { ...@@ -94,7 +96,7 @@ float SkyDome::verticalFOV() {
return verticalFOV_; return verticalFOV_;
} }
void SkyDome::setTopOffset( float _value) { void SkyDome::setTopOffset( const float& _value) {
topOffset_ = _value; topOffset_ = _value;
} }
......
...@@ -70,19 +70,20 @@ public: ...@@ -70,19 +70,20 @@ public:
SkyDome(); SkyDome();
/// Defines the texture that will be used /// Defines the texture that will be used
QString textureFileName(); void setTextureFileName(const QString& _textureFileName);
void setTextureFileName(QString _textureFileName); /// Returns the texture that will be used
QString textureFileName();
void setHorizontalFOV( float _value); void setHorizontalFOV( const float& _value);
float horizontalFOV(); float horizontalFOV();
void setVerticalFOV( float _value); void setVerticalFOV( const float& _value);
float verticalFOV(); float verticalFOV();
void setTopOffset( float _value); void setTopOffset( const float& _value);
float topOffset(); float topOffset();
...@@ -99,7 +100,6 @@ private: ...@@ -99,7 +100,6 @@ private:
QString textureFileName_; QString textureFileName_;
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment