Started some warning cleanup

This commit is contained in:
Alexander Bock
2017-07-14 14:21:01 -04:00
parent 2e4f31ded8
commit 6a198c5d93
30 changed files with 109 additions and 103 deletions
+1 -1
View File
@@ -104,7 +104,7 @@ RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary)
"RenderablePlane"
);
_size = dictionary.value<double>(KeySize);
_size = static_cast<float>(dictionary.value<double>(KeySize));
if (dictionary.hasKey(KeyBillboard)) {
_billboard = dictionary.value<bool>(KeyBillboard);
+1 -1
View File
@@ -108,7 +108,7 @@ RenderableSphere::RenderableSphere(const ghoul::Dictionary& dictionary)
"RenderableSphere"
);
_size = dictionary.value<double>(KeySize);
_size = static_cast<float>(dictionary.value<double>(KeySize));
_segments = static_cast<int>(dictionary.value<double>(KeySegments));
_texturePath = absPath(dictionary.value<std::string>(KeyTexture));
@@ -49,7 +49,7 @@ RenderableDebugPlane::RenderableDebugPlane(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _texture("texture", "Texture", -1, -1, 255)
, _billboard("billboard", "Billboard", false)
, _size("size", "Size", 10, 0, std::pow(10, 25))
, _size("size", "Size", 10.f, 0.f, std::pow(10.f, 25.f))
, _origin(Origin::Center)
, _shader(nullptr)
, _quad(0)
+1 -1
View File
@@ -45,7 +45,7 @@ namespace ghoul {
namespace openspace {
struct RenderData;
class RaycastData;
struct RaycastData;
class GalaxyRaycaster : public VolumeRaycaster {
public:
@@ -186,8 +186,6 @@ bool RenderableGalaxy::initialize() {
float maxdist = 0;
float x, y, z, r, g, b, a;
for (size_t i = 0; i < _nPoints; ++i) {
float x = pointData[i * 7 + 0];
float y = pointData[i * 7 + 1];
+6 -3
View File
@@ -80,11 +80,14 @@ MemoryAwareTileCache::MemoryAwareTileCache()
setSizeEstimated(_tileCacheSize * 1024 * 1024);
});
_cpuAllocatedTileData.setMaxValue(
CpuCap.installedMainMemory() * 0.25);
static_cast<int>(CpuCap.installedMainMemory() * 0.25)
);
_gpuAllocatedTileData.setMaxValue(
CpuCap.installedMainMemory() * 0.25);
static_cast<int>(CpuCap.installedMainMemory() * 0.25)
);
_tileCacheSize.setMaxValue(
CpuCap.installedMainMemory() * 0.25);
static_cast<int>(CpuCap.installedMainMemory() * 0.25)
);
setSizeEstimated(_tileCacheSize * 1024 * 1024);
+1 -1
View File
@@ -64,7 +64,7 @@ bool Chunk::isVisible() const {
Chunk::Status Chunk::update(const RenderData& data) {
const auto& savedCamera = _owner.savedCamera();
const Camera& camRef = savedCamera != nullptr ? *savedCamera : data.camera;
RenderData myRenderData = { camRef, data.position, data.doPerformanceMeasurement, data.doPerformanceMeasurement, data.renderBinMask, data.modelTransform };
RenderData myRenderData = { camRef, data.position, data.time, data.doPerformanceMeasurement, data.renderBinMask, data.modelTransform };
_isVisible = true;
if (_owner.chunkedLodGlobe()->testIfCullable(*this, myRenderData)) {
+6 -5
View File
@@ -30,12 +30,13 @@
#include <memory>
namespace openspace {
class Camera;
class Camera;
namespace globebrowsing {
class RenderableGlobe;
class TileIndex;
class Geodetic2;
class Geodetic3;
class RenderableGlobe;
class TileIndex;
struct Geodetic2;
struct Geodetic3;
namespace cache {
class MemoryAwareTileCache;
+8 -8
View File
@@ -69,14 +69,14 @@ bool PointGlobe::initialize() {
glBindVertexArray(_vaoID);
std::array<glm::vec2, 6> quadVertexData = {
glm::vec2(-1.0f, -1.0f),
glm::vec2(1.0f, -1.0f),
glm::vec2(-1.0f, 1.0f),
glm::vec2(-1.0f, 1.0f),
glm::vec2(1.0f, -1.0f),
glm::vec2(1.0f, 1.0f)
};
std::array<glm::vec2, 6> quadVertexData = {
glm::vec2(-1.0f, -1.0f),
glm::vec2(1.0f, -1.0f),
glm::vec2(-1.0f, 1.0f),
glm::vec2(-1.0f, 1.0f),
glm::vec2(1.0f, -1.0f),
glm::vec2(1.0f, 1.0f)
};
// Vertex buffer
glBindBuffer(GL_ARRAY_BUFFER, _vertexBufferID);
@@ -415,7 +415,9 @@ size_t numberOfRasters(ghoul::opengl::Texture::Format format) {
case ghoul::opengl::Texture::Format::BGR: return 3;
case ghoul::opengl::Texture::Format::RGBA:; // Intentional fallthrough
case ghoul::opengl::Texture::Format::BGRA: return 4;
default: ghoul_assert(false, "Unknown format");
default:
ghoul_assert(false, "Unknown format");
return size_t(-1);
}
}
@@ -432,6 +434,7 @@ size_t numberOfBytes(GLenum glType) {
case GL_DOUBLE: return sizeof(GLdouble);
default:
ghoul_assert(false, "Unknown data type");
return size_t(-1);
}
}
@@ -449,6 +452,7 @@ size_t getMaximumValue(GLenum glType) {
return 1 << 31;
default:
ghoul_assert(false, "Unknown data type");
return size_t(-1);
}
}
@@ -472,6 +476,7 @@ float interpretFloat(GLenum glType, const char* src) {
return static_cast<float>(*reinterpret_cast<const GLdouble*>(src));
default:
ghoul_assert(false, "Unknown data type");
return 0.f;
}
}
@@ -50,7 +50,7 @@ SizeReferenceTileProvider::SizeReferenceTileProvider(const ghoul::Dictionary& di
: TextTileProvider(LayerManager::getTileTextureInitData(layergroupid::GroupID::ColorLayers))
, _backgroundTile(Tile::TileUnavailable)
{
_fontSize = 50;
_font = OsEng.fontManager().font("Mono", _fontSize);
@@ -113,9 +113,9 @@ std::vector<std::string> KameleonVolumeReader::gridVariableNames() const {
std::string y = tokens.at(1);
std::string z = tokens.at(2);
std::transform(x.begin(), x.end(), x.begin(), ::tolower);
std::transform(y.begin(), y.end(), y.begin(), ::tolower);
std::transform(z.begin(), z.end(), z.begin(), ::tolower);
std::transform(x.begin(), x.end(), x.begin(), tolower);
std::transform(y.begin(), y.end(), y.begin(), tolower);
std::transform(z.begin(), z.end(), z.begin(), tolower);
return std::vector<std::string>{x, y, z};
}
@@ -121,7 +121,7 @@ void KameleonVolumeRaycaster::preRaycast(const RaycastData& data, ghoul::opengl:
std::vector<glm::vec3> clipNormals = _clipPlanes->normals();
std::vector<glm::vec2> clipOffsets = _clipPlanes->offsets();
int nClips = clipNormals.size();
int nClips = static_cast<int>(clipNormals.size());
program.setUniform("nClips_" + id, nClips);
program.setUniform("clipNormals_" + id, clipNormals.data(), nClips);
@@ -72,8 +72,8 @@ RenderableKameleonVolume::RenderableKameleonVolume(const ghoul::Dictionary& dict
, _upperDomainBound("upperDomainBound", "Upper Domain Bound")
, _domainScale("domainScale", "Domain scale")
, _autoDomainBounds(false)
, _lowerValueBound("lowerValueBound", "Lower Value Bound", 0.0, 0.0, 1)
, _upperValueBound("upperValueBound", "Upper Value Bound", 1, 0.01, 1)
, _lowerValueBound("lowerValueBound", "Lower Value Bound", 0.f, 0.f, 1.f)
, _upperValueBound("upperValueBound", "Upper Value Bound", 1.f, 0.01f, 1.f)
, _autoValueBounds(false)
, _gridType("gridType", "Grid Type", properties::OptionProperty::DisplayType::Dropdown)
, _autoGridType(false)
@@ -83,7 +83,8 @@ RenderableKameleonVolume::RenderableKameleonVolume(const ghoul::Dictionary& dict
, _transferFunctionPath("transferFunctionPath", "Transfer Function Path")
, _raycaster(nullptr)
, _transferFunction(nullptr)
, _cache("cache", "Cache") {
, _cache("cache", "Cache")
{
glm::vec3 dimensions;
if (dictionary.getValue(KeyDimensions, dimensions)) {
@@ -91,10 +91,10 @@ unsigned int AtlasManager::atlasMapBuffer() {
}
void AtlasManager::updateAtlas(BUFFER_INDEX bufferIndex, std::vector<int>& brickIndices) {
int nBrickIndices = brickIndices.size();
size_t nBrickIndices = brickIndices.size();
_requiredBricks.clear();
for (int i = 0; i < nBrickIndices; i++) {
for (size_t i = 0; i < nBrickIndices; i++) {
_requiredBricks.insert(brickIndices[i]);
}
@@ -105,7 +105,7 @@ void AtlasManager::updateAtlas(BUFFER_INDEX bufferIndex, std::vector<int>& brick
}
// Stats
_nUsedBricks = _requiredBricks.size();
_nUsedBricks = static_cast<unsigned int>(_requiredBricks.size());
_nStreamedBricks = 0;
_nDiskReads = 0;
@@ -98,7 +98,7 @@ void LocalTfBrickSelector::selectBricks(int timestep, std::vector<int>& bricks)
// On average on the whole time period, splitting this spatial brick in two time steps
// would generate twice as much streaming. Current number of streams of this spatial brick
// is 2^nTemporalSplits over the whole time period.
int newStreams = std::pow(2, bs.nTemporalSplits);
int newStreams = static_cast<int>(std::pow(2, bs.nTemporalSplits));
if (nStreamedBricks + newStreams > totalStreamingBudget) {
// Reached dead end (streaming budget would be exceeded)
deadEnds.push_back(bs);
@@ -129,7 +129,7 @@ void LocalTfBrickSelector::selectBricks(int timestep, std::vector<int>& bricks)
// On average on the whole time period, splitting this spatial brick into eight spatial bricks
// would generate eight times as much streaming. Current number of streams of this spatial brick
// is 2^nTemporalStreams over the whole time period.
int newStreams = 7*std::pow(2, bs.nTemporalSplits);
int newStreams = 7 * static_cast<int>(std::pow(2, bs.nTemporalSplits));
if (nStreamedBricks + newStreams > totalStreamingBudget) {
// Reached dead end (streaming budget would be exceeded)
// However, temporal split might be possible
@@ -186,7 +186,7 @@ void LocalTfBrickSelector::selectBricks(int timestep, std::vector<int>& bricks)
temporalSplitQueue.pop_back();
unsigned int brickIndex = bs.brickIndex;
int newStreams = std::pow(2, bs.nTemporalSplits);
int newStreams = static_cast<int>(std::pow(2, bs.nTemporalSplits));
if (nStreamedBricks + newStreams > totalStreamingBudget) {
// The current best choice would make us exceed the streaming budget, try next instead.
deadEnds.push_back(bs);
@@ -242,14 +242,14 @@ float LocalTfBrickSelector::temporalSplitPoints(unsigned int brickIndex) {
if (_tsp->isBstLeaf(brickIndex)) {
return -1;
}
return _brickErrors[brickIndex].temporal * 0.5;
return _brickErrors[brickIndex].temporal * 0.5f;
}
float LocalTfBrickSelector::spatialSplitPoints(unsigned int brickIndex) {
if (_tsp->isOctreeLeaf(brickIndex)) {
return -1;
}
return _brickErrors[brickIndex].spatial * 0.125;
return _brickErrors[brickIndex].spatial * 0.125f;
}
float LocalTfBrickSelector::splitPoints(unsigned int brickIndex, BrickSelection::SplitType& splitType) {
@@ -285,7 +285,7 @@ bool LocalTfBrickSelector::calculateBrickErrors() {
glm::vec4 nextRgba = tf->sample(offset + 1);
float colorDifference = glm::distance(prevRgba, nextRgba);
float alpha = (prevRgba.w + nextRgba.w) * 0.5;
float alpha = (prevRgba.w + nextRgba.w) * 0.5f;
gradients[offset] = colorDifference*alpha;
}
@@ -300,7 +300,7 @@ bool LocalTfBrickSelector::calculateBrickErrors() {
const Histogram* histogram = _histogramManager->getSpatialHistogram(brickIndex);
float error = 0;
for (int i = 0; i < gradients.size(); i++) {
float x = (i + 0.5) / tfWidth;
float x = (i + 0.5f) / tfWidth;
float sample = histogram->interpolate(x);
assert(sample >= 0);
assert(gradients[i] >= 0);
@@ -315,7 +315,7 @@ bool LocalTfBrickSelector::calculateBrickErrors() {
const Histogram* histogram = _histogramManager->getTemporalHistogram(brickIndex);
float error = 0;
for (int i = 0; i < gradients.size(); i++) {
float x = (i + 0.5) / tfWidth;
float x = (i + 0.5f) / tfWidth;
float sample = histogram->interpolate(x);
assert(sample >= 0);
assert(gradients[i] >= 0);
@@ -49,7 +49,7 @@ namespace ghoul {
namespace openspace {
struct RenderData;
class RaycastData;
struct RaycastData;
class MultiresVolumeRaycaster : public VolumeRaycaster {
public:
@@ -106,9 +106,9 @@ RenderableMultiresVolume::RenderableMultiresVolume (const ghoul::Dictionary& dic
, _statsToFile("printStats", "Print Stats", false)
, _statsToFileName("printStatsFileName", "Stats Filename")
, _scalingExponent("scalingExponent", "Scaling Exponent", 1, -10, 20)
, _scaling("scaling", "Scaling", glm::vec3(1.0, 1.0, 1.0), glm::vec3(0.0), glm::vec3(10.0))
, _translation("translation", "Translation", glm::vec3(0.0, 0.0, 0.0), glm::vec3(0.0), glm::vec3(10.0))
, _rotation("rotation", "Euler rotation", glm::vec3(0.0, 0.0, 0.0), glm::vec3(0), glm::vec3(6.28))
, _scaling("scaling", "Scaling", glm::vec3(1.f), glm::vec3(0.f), glm::vec3(10.f))
, _translation("translation", "Translation", glm::vec3(0.f), glm::vec3(0.f), glm::vec3(10.f))
, _rotation("rotation", "Euler rotation", glm::vec3(0.f, 0.f, 0.f), glm::vec3(0.f), glm::vec3(6.28f))
{
std::string name;
//bool success = dictionary.getValue(constants::scenegraphnode::keyName, name);
@@ -99,7 +99,7 @@ void SimpleTfBrickSelector::selectBricks(int timestep, std::vector<int>& bricks)
// On average on the whole time period, splitting this spatial brick in two time steps
// would generate twice as much streaming. Current number of streams of this spatial brick
// is 2^nTemporalSplits over the whole time period.
int newStreams = std::pow(2, bs.nTemporalSplits);
int newStreams = static_cast<int>(std::pow(2, bs.nTemporalSplits));
// Refining this one more step would require the double amount of streams
if (nStreamedBricks + newStreams > totalStreamingBudget) {
@@ -132,7 +132,7 @@ void SimpleTfBrickSelector::selectBricks(int timestep, std::vector<int>& bricks)
// On average on the whole time period, splitting this spatial brick into eight spatial bricks
// would generate eight times as much streaming. Current number of streams of this spatial brick
// is 2^nTemporalStreams over the whole time period.
int newStreams = 7*std::pow(2, bs.nTemporalSplits);
int newStreams = 7 * static_cast<int>(std::pow(2, bs.nTemporalSplits));
if (nStreamedBricks + newStreams > totalStreamingBudget) {
// Reached dead end (streaming budget would be exceeded)
// However, temporal split might be possible
@@ -189,7 +189,7 @@ void SimpleTfBrickSelector::selectBricks(int timestep, std::vector<int>& bricks)
temporalSplitQueue.pop_back();
unsigned int brickIndex = bs.brickIndex;
int newStreams = std::pow(2, bs.nTemporalSplits);
int newStreams = static_cast<int>(std::pow(2, bs.nTemporalSplits));
if (nStreamedBricks + newStreams > totalStreamingBudget) {
// The current best choice would make us exceed the streaming budget, try next instead.
deadEnds.push_back(bs);
@@ -244,14 +244,14 @@ float SimpleTfBrickSelector::temporalSplitPoints(unsigned int brickIndex) {
if (_tsp->isBstLeaf(brickIndex)) {
return -1;
}
return _brickImportances[brickIndex] * 0.5;
return _brickImportances[brickIndex] * 0.5f;
}
float SimpleTfBrickSelector::spatialSplitPoints(unsigned int brickIndex) {
if (_tsp->isOctreeLeaf(brickIndex)) {
return -1;
}
return _brickImportances[brickIndex] * 0.125;
return _brickImportances[brickIndex] * 0.125f;
}
float SimpleTfBrickSelector::splitPoints(unsigned int brickIndex, BrickSelection::SplitType& splitType) {
@@ -278,8 +278,11 @@ bool SimpleTfBrickSelector::calculateBrickImportances() {
TransferFunction *tf = _transferFunction;
if (!tf) return false;
float tfWidth = tf->width();
if (tfWidth <= 0) return false;
size_t tfWidth = tf->width();
// By changing tfWidth to the correct type size_t, this check is no longer valid since
// size_t is unsigned ---abock
//if (tfWidth <= 0) return false;
/* std::vector<float> gradients(tfWidth - 1);
for (size_t offset = 0; offset < tfWidth - 1; offset++) {
@@ -303,7 +306,7 @@ bool SimpleTfBrickSelector::calculateBrickImportances() {
float dotProduct = 0;
for (int i = 0; i < tf->width(); i++) {
float x = float(i) / tfWidth;
float x = static_cast<float>(i) / static_cast<float>(tfWidth);
float sample = histogram->interpolate(x);
assert(sample >= 0);
@@ -105,7 +105,7 @@ void TfBrickSelector::selectBricks(int timestep, std::vector<int>& bricks) {
// would generate twice as much streaming. Current number of streams of this spatial brick
// is 2^nTemporalSplits over the whole time period.
int newStreams = std::pow(2, bs.nTemporalSplits);
int newStreams = static_cast<int>(std::pow(2, bs.nTemporalSplits));
//std::cout << "preparing for " << newStreams << " new streams" << std::endl;
// Refining this one more step would require the double amount of streams
@@ -139,7 +139,7 @@ void TfBrickSelector::selectBricks(int timestep, std::vector<int>& bricks) {
// On average on the whole time period, splitting this spatial brick into eight spatial bricks
// would generate eight times as much streaming. Current number of streams of this spatial brick
// is 2^nTemporalStreams over the whole time period.
int newStreams = 7*std::pow(2, bs.nTemporalSplits);
int newStreams = 7 * static_cast<int>(std::pow(2, bs.nTemporalSplits));
if (nStreamedBricks + newStreams > totalStreamingBudget) {
// Reached dead end (streaming budget would be exceeded)
@@ -207,7 +207,7 @@ void TfBrickSelector::selectBricks(int timestep, std::vector<int>& bricks) {
temporalSplitQueue.pop_back();
unsigned int brickIndex = bs.brickIndex;
int newStreams = std::pow(2, bs.nTemporalSplits);
int newStreams = static_cast<int>(std::pow(2, bs.nTemporalSplits));
if (nStreamedBricks + newStreams > totalStreamingBudget) {
// The current best choice would make us exceed the streaming budget, try next instead.
deadEnds.push_back(bs);
@@ -282,7 +282,7 @@ float TfBrickSelector::temporalSplitPoints(unsigned int brickIndex) {
//std::cout << "local temporal split minimum for brick " << brickIndex << std::endl;
diff = -diff;
}
return diff * 0.5;
return diff * 0.5f;
}
float TfBrickSelector::spatialSplitPoints(unsigned int brickIndex) {
@@ -310,7 +310,7 @@ float TfBrickSelector::spatialSplitPoints(unsigned int brickIndex) {
diff = -diff;
}
return diff * 0.125;
return diff * 0.125f;
}
float TfBrickSelector::splitPoints(unsigned int brickIndex, BrickSelection::SplitType& splitType) {
@@ -345,7 +345,7 @@ bool TfBrickSelector::calculateBrickErrors() {
glm::vec4 nextRgba = tf->sample(offset + 1);
float colorDifference = glm::distance(prevRgba, nextRgba);
float alpha = (prevRgba.w + nextRgba.w) * 0.5;
float alpha = (prevRgba.w + nextRgba.w) * 0.5f;
gradients[offset] = colorDifference*alpha;
}
@@ -362,7 +362,7 @@ bool TfBrickSelector::calculateBrickErrors() {
const Histogram* histogram = _histogramManager->getHistogram(brickIndex);
float error = 0;
for (int i = 0; i < gradients.size(); i++) {
float x = (i + 0.5) / tfWidth;
float x = (i + 0.5f) / tfWidth;
float sample = histogram->interpolate(x);
assert(sample >= 0);
assert(gradients[i] >= 0);
+1 -1
View File
@@ -307,7 +307,7 @@ bool TSP::calculateSpatialError() {
average += *it;
}
averages[brick] = average / static_cast<double>(numBrickVals);
averages[brick] = static_cast<float>(average / static_cast<double>(numBrickVals));
}
// Spatial SNR stats
@@ -174,7 +174,7 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary&
_shiftMeridianBy180 = dictionary.value<bool>(keyMeridianShift);
}
float radius = std::pow(10.0, 9.0);
float radius = std::pow(10.f, 9.f);
dictionary.getValue(keyRadius, radius);
setBoundingSphere(radius);
+15 -11
View File
@@ -65,24 +65,28 @@ TouchInteraction::TouchInteraction()
, _maxTapTime("Max Tap Time", "Max tap delay (in ms) for double tap", 300, 10, 1000)
, _deceleratesPerSecond("Decelerates per second", "Number of times velocity is decelerated per second", 240, 60, 300)
, _touchScreenSize("TouchScreenSize", "Touch Screen size in inches", 55.0f, 5.5f, 150.0f)
, _tapZoomFactor("Tap zoom factor","Scaling distance travelled on tap", 0.2, 0.0, 0.5)
, _tapZoomFactor("Tap zoom factor","Scaling distance travelled on tap", 0.2f, 0.f, 0.5f)
, _nodeRadiusThreshold("Activate direct-manipulation", "Radius a planet has to have to activate direct-manipulation", 0.2f, 0.0f, 1.0f)
, _rollAngleThreshold("Interpret roll", "Threshold for min angle for roll interpret", 0.025f, 0.0f, 0.05f)
, _orbitSpeedThreshold("Activate orbit spinning", "Threshold to activate orbit spinning in direct-manipulation", 0.005f, 0.0f, 0.01f)
, _spinSensitivity("Sensitivity of spinning", "Sensitivity of spinning in direct-manipulation", 1.0f, 0, 2)
, _inputStillThreshold("Input still", "Threshold for interpreting input as still", 0.0005f, 0, 0.001)
, _centroidStillThreshold("Centroid stationary", "Threshold for stationary centroid", 0.0018f, 0, 0.01) // used to void wrongly interpreted roll interactions
, _interpretPan("Pan delta distance", "Delta distance between fingers allowed for interpreting pan interaction", 0.015f, 0, 0.1)
, _slerpTime("Time to slerp", "Time to slerp in seconds to new orientation with new node picking", 3, 0, 5)
, _spinSensitivity("Sensitivity of spinning", "Sensitivity of spinning in direct-manipulation", 1.f, 0.f, 2.f)
, _inputStillThreshold("Input still", "Threshold for interpreting input as still", 0.0005f, 0.f, 0.001f)
, _centroidStillThreshold("Centroid stationary", "Threshold for stationary centroid", 0.0018f, 0.f, 0.01f) // used to void wrongly interpreted roll interactions
, _interpretPan("Pan delta distance", "Delta distance between fingers allowed for interpreting pan interaction", 0.015f, 0.f, 0.1f)
, _slerpTime("Time to slerp", "Time to slerp in seconds to new orientation with new node picking", 3.f, 0.f, 5.f)
, _guiButton("GUI Button", "GUI button size in pixels.", glm::ivec2(32, 64), glm::ivec2(8, 16), glm::ivec2(128, 256))
, _friction("Friction", "Friction for different interactions (orbit, zoom, roll, pan)", glm::vec4(0.01, 0.025, 0.02, 0.02), glm::vec4(0.0), glm::vec4(0.2))
, _friction("Friction", "Friction for different interactions (orbit, zoom, roll, pan)", glm::vec4(0.01f, 0.025f, 0.02f, 0.02f), glm::vec4(0.f), glm::vec4(0.2f))
, _vel{ glm::dvec2(0.0), 0.0, 0.0, glm::dvec2(0.0) }
, _sensitivity{glm::dvec2(0.08, 0.045), 4.0, 2.75, glm::dvec2(0.08, 0.045) }
, _centroid{ glm::dvec3(0.0) }
, _projectionScaleFactor{ 1.000004 } // calculated with two vectors with known diff in length, then projDiffLength/diffLength.
, _currentRadius{ 1.0 }, _slerpdT{ 1000 }, _numOfTests{ 0 }, _timeSlack{ 0.0 }
, _directTouchMode{ false }, _tap{ false }, _doubleTap{ false }, _lmSuccess{ true }, _guiON{ false }
, _directTouchMode{ false }
, _tap{ false }
, _doubleTap{ false }
, _lmSuccess{ true }
, _guiON{ false }
{
addProperty(_touchActive);
addProperty(_unitTest);
@@ -240,7 +244,7 @@ void TouchInteraction::directControl(const std::vector<TuioCursor>& list) {
// Gradient of distToMinimize w.r.t par (using forward difference)
auto gradient = [](double* g, double* par, int x, void* fdata, LMstat* lmstat) {
FunctionData* ptr = reinterpret_cast<FunctionData*>(fdata);
double h, hZoom, lastG, f1, f0 = ptr->distToMinimize(par, x, fdata, lmstat);
double h, lastG, f1, f0 = ptr->distToMinimize(par, x, fdata, lmstat);
double scale = log10(ptr->node->boundingSphere()); // scale value to find minimum step size h, dependant on planet size
std::vector<double> dPar(ptr->nDOF, 0.0);
dPar.assign(par, par + ptr->nDOF);
@@ -447,8 +451,8 @@ int TouchInteraction::interpretInteraction(const std::vector<TuioCursor>& list,
double rollOn = std::accumulate(list.begin(), list.end(), 0.0, [&](double diff, const TuioCursor& c) {
TuioPoint point = std::find_if(lastProcessed.begin(), lastProcessed.end(), [&c](const Point& p) { return p.first == c.getSessionID(); })->second;
double res = 0.0;
double lastAngle = point.getAngle(_centroid.x, _centroid.y);
double currentAngle = c.getAngle(_centroid.x, _centroid.y);
float lastAngle = point.getAngle(_centroid.x, _centroid.y);
float currentAngle = c.getAngle(_centroid.x, _centroid.y);
if (lastAngle > currentAngle + 1.5 * M_PI)
res = currentAngle + (2 * M_PI - lastAngle);
else if (currentAngle > lastAngle + 1.5 * M_PI)
+6 -6
View File
@@ -40,9 +40,9 @@ namespace openspace {
TouchMarker::TouchMarker()
: properties::PropertyOwner("TouchMarker")
, _visible("TouchMarkers visible", "Toggle visibility of markers", true)
, _radiusSize("Marker size", "Marker radius", 30, 0, 100)
, _transparency("Transparency of marker", "Marker transparency", 0.8, 0, 1.0)
, _thickness("Thickness of marker", "Marker thickness", 2.0, 0, 4.0)
, _radiusSize("Marker size", "Marker radius", 30.f, 0.f, 100.f)
, _transparency("Transparency of marker", "Marker transparency", 0.8f, 0.f, 1.f)
, _thickness("Thickness of marker", "Marker thickness", 2.f, 0.f, 4.f)
, _color(
"MarkerColor",
"Marker color",
@@ -116,12 +116,12 @@ void TouchMarker::render(const std::vector<TUIO::TuioCursor>& list) {
}
void TouchMarker::createVertexList(const std::vector<TUIO::TuioCursor>& list) {
_numFingers = list.size();
_numFingers = static_cast<int>(list.size());
GLfloat vertexData[MAX_FINGERS];
int i = 0;
for (const TUIO::TuioCursor& c : list) {
vertexData[i] = 2 * (c.getX() - 0.5);
vertexData[i + 1] = -2 * (c.getY() - 0.5);
vertexData[i] = 2 * (c.getX() - 0.5f);
vertexData[i + 1] = -2 * (c.getY() - 0.5f);
i += 2;
}
+1 -1
View File
@@ -32,7 +32,7 @@
#include <openspace/rendering/screenspacerenderable.h>
#include <ghoul/logging/logmanager.h>
#include <glm/ext.hpp>
//#include <glm/ext.hpp>
#include <sstream>
#include <string>
@@ -38,13 +38,14 @@ namespace openspace {
RenderableToyVolume::RenderableToyVolume(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _scalingExponent("scalingExponent", "Scaling Exponent", 1, -10, 20)
, _stepSize("stepSize", "Step Size", 0.02, 0.01, 1)
, _scaling("scaling", "Scaling", glm::vec3(1.0, 1.0, 1.0), glm::vec3(0.0), glm::vec3(10.0))
, _translation("translation", "Translation", glm::vec3(0.0, 0.0, 0.0), glm::vec3(0.0), glm::vec3(10.0))
, _stepSize("stepSize", "Step Size", 0.02f, 0.01f, 1.f)
, _scaling("scaling", "Scaling", glm::vec3(1.f, 1.f, 1.f), glm::vec3(0.f), glm::vec3(10.f))
, _translation("translation", "Translation", glm::vec3(0.f, 0.f, 0.f), glm::vec3(0.f), glm::vec3(10.f))
, _rotation("rotation", "Euler rotation", glm::vec3(0.f, 0.f, 0.f), glm::vec3(0), glm::vec3(6.28f))
, _color("color", "Color", glm::vec4(1.f, 0.f, 0.f, 0.1f), glm::vec4(0.f), glm::vec4(1.f)) {
float scalingExponent, stepSize;
, _color("color", "Color", glm::vec4(1.f, 0.f, 0.f, 0.1f), glm::vec4(0.f), glm::vec4(1.f))
{
float stepSize;
int scalingExponent;
glm::vec3 scaling, translation, rotation;
glm::vec4 color;
if (dictionary.getValue("ScalingExponent", scalingExponent)) {