Correct updateintervall

This commit is contained in:
Sebastian Piwell
2016-04-05 17:09:45 -04:00
parent 7a0d880299
commit bea3a1b89b
7 changed files with 15 additions and 24 deletions
+4 -4
View File
@@ -148,10 +148,10 @@ void DataPlane::update(){
_time = Time::ref().currentTime();
_stateMatrix = SpiceManager::ref().positionTransformMatrix("GALACTIC", _data->frame, _time);
_openSpaceUpdateInterval = Time::ref().deltaTime()*_updateInterval;
if(_openSpaceUpdateInterval){
if((_time-_lastUpdateTime) >= _openSpaceUpdateInterval){
float openSpaceUpdateInterval = abs(Time::ref().deltaTime()*_updateInterval);
if(openSpaceUpdateInterval){
if(abs(_time-_lastUpdateTime) >= openSpaceUpdateInterval){
updateTexture();
_lastUpdateTime = _time;
}
-1
View File
@@ -78,7 +78,6 @@ protected:
double _time;
double _lastUpdateTime = 0;
float _openSpaceUpdateInterval;
int _id;
};
+4 -3
View File
@@ -133,9 +133,10 @@ void ScreenSpaceCygnet::render(){
void ScreenSpaceCygnet::update(){
_time = Time::ref().currentTime();
_openSpaceUpdateInterval = abs(Time::ref().deltaTime()*_updateInterval);
if(_openSpaceUpdateInterval){
if(abs(_time-_lastUpdateTime) >= _updateInterval){
float openSpaceUpdateInterval = abs(Time::ref().deltaTime()*_updateInterval);
if(openSpaceUpdateInterval){
if(abs(_time-_lastUpdateTime) >= openSpaceUpdateInterval){
updateTexture();
_lastUpdateTime = _time;
}
@@ -56,8 +56,6 @@ private:
float _lastUpdateTime = 0.0f;
std::shared_ptr<DownloadManager::FileFuture> _futureTexture;
float _openSpaceUpdateInterval;
std::string _fileExtension;
int _id;
+3 -5
View File
@@ -123,10 +123,9 @@ void TexturePlane::update(){
_time = Time::ref().currentTime();
_stateMatrix = SpiceManager::ref().positionTransformMatrix("GALACTIC", _data->frame, _time);
_openSpaceUpdateInterval = Time::ref().deltaTime()*_updateInterval;
if(_openSpaceUpdateInterval){
if((_time-_lastUpdateTime) >= _openSpaceUpdateInterval){
float openSpaceUpdateInterval = abs(Time::ref().deltaTime()*_updateInterval);
if(openSpaceUpdateInterval){
if(abs(_time-_lastUpdateTime) >= openSpaceUpdateInterval){
updateTexture();
_lastUpdateTime = _time;
}
@@ -134,7 +133,6 @@ void TexturePlane::update(){
if(_futureTexture && _futureTexture->isFinished){
loadTexture();
_futureTexture = nullptr;
}
}
+2 -2
View File
@@ -56,7 +56,7 @@ namespace openspace{
ISWAManager::~ISWAManager(){}
std::shared_ptr<ISWACygnet> ISWAManager::createISWACygnet(std::shared_ptr<Metadata> metadata){
std::cout << "createISWACygnet " << metadata->id << std::endl;
LDEBUG("Creating ISWACygnet with id " << metadata->id);
if(metadata->path != ""){
const std::string& extension = ghoul::filesystem::File(absPath(metadata->path)).fileExtension();
std::shared_ptr<ISWACygnet> cygnet;
@@ -119,7 +119,7 @@ namespace openspace{
path,
true,
[path](const DownloadManager::FileFuture& f){
std::cout<<"download finished: " << path <<std::endl;
LDEBUG("Download finished: " << path);
}
);
}
+2 -7
View File
@@ -241,7 +241,7 @@ float* KameleonWrapper::getUniformSampledValues(
if (rPh < _xMin || rPh > _xMax || thetaPh < _yMin ||
thetaPh > _yMax || phiPh < _zMin || phiPh > _zMax) {
if (phiPh > _zMax) {
std::cout << "Warning: There might be a gap in the data\n";
LWARNING("Warning: There might be a gap in the data");
}
// Leave values at zero if outside domain
} else { // if inside
@@ -410,7 +410,7 @@ float* KameleonWrapper::getUniformSliceValues(
if (rPh < _xMin || rPh > _xMax || thetaPh < _yMin ||
thetaPh > _yMax || phiPh < _zMin || phiPh > _zMax) {
if (phiPh > _zMax) {
std::cout << "Warning: There might be a gap in the data\n";
LWARNING("Warning: There might be a gap in the data");
}
// Leave values at zero if outside domain
} else { // if inside
@@ -468,7 +468,6 @@ float* KameleonWrapper::getUniformSliceValues(
// data[i] = 1;
// std::cout << minValue << ", " << maxValue << ", " << doubleData[i] << ", " << normalizedVal << ", " << data[i] << std::endl;
}
std::cout << std::endl << std::endl;
delete[] doubleData;
return data;
@@ -661,10 +660,6 @@ glm::vec3 KameleonWrapper::getModelBarycenterOffset() {
offset.x = _xMin+(std::abs(_xMin)+std::abs(_xMax))/2.0f;
offset.y = _yMin+(std::abs(_yMin)+std::abs(_yMax))/2.0f;
offset.z = _zMin+(std::abs(_zMin)+std::abs(_zMax))/2.0f;
std::cout << "_x_Min: " << _xMin << ", _xMax:" << _xMax << std::endl;
std::cout << "_y_Min: " << _yMin << ", _yMax:" << _yMax << std::endl;
std::cout << "_z_Min: " << _zMin << ", _zMax:" << _zMax << std::endl;
std::cout << "offset: " << offset.x << ", " << offset.y << ", " << offset.z << std::endl;
return offset;
}