mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-06 04:18:36 -06:00
Addressing more CppCheck warnings
This commit is contained in:
@@ -50,6 +50,7 @@ WavefrontGeometry::WavefrontGeometry(const ghoul::Dictionary& dictionary)
|
||||
// The name is passed down from the SceneGraphNode
|
||||
std::string name;
|
||||
bool success = dictionary.getValue(keyName, name);
|
||||
ghoul_assert(success, "Name tag was not present");
|
||||
|
||||
std::string file;
|
||||
success = dictionary.getValue(constants::modelgeometry::keyObjFile, file);
|
||||
@@ -72,6 +73,11 @@ void WavefrontGeometry::loadObj(const char *filename){
|
||||
LINFO("Loading OBJ file '" << filename << "'");
|
||||
std::string err = tinyobj::LoadObj(shapes, materials, filename, mtl_basepat);
|
||||
|
||||
if (!err.empty()) {
|
||||
LERROR(err);
|
||||
return;
|
||||
}
|
||||
|
||||
LINFO("Loaded Mesh");
|
||||
LINFO("Number of Shapes: " << shapes.size());
|
||||
LINFO("Number of Materials: " << materials.size());
|
||||
|
||||
@@ -81,7 +81,7 @@ RenderablePlanet::RenderablePlanet(const ghoul::Dictionary& dictionary)
|
||||
|
||||
dictionary.getValue(keyFrame, _frame);
|
||||
|
||||
bool b1 = dictionary.getValue(keyBody, _target);
|
||||
dictionary.getValue(keyBody, _target);
|
||||
//assert(b1 == true);
|
||||
|
||||
// TODO: textures need to be replaced by a good system similar to the geometry as soon
|
||||
|
||||
@@ -385,10 +385,10 @@ RenderableFieldlines::generateFieldlinesVolumeKameleon()
|
||||
}
|
||||
fileName = absPath(fileName);
|
||||
|
||||
KameleonWrapper::Model modelType;
|
||||
if (model == vectorFieldKameleonModelBATSRUS)
|
||||
modelType = KameleonWrapper::Model::BATSRUS;
|
||||
else {
|
||||
//KameleonWrapper::Model modelType;
|
||||
if (model != vectorFieldKameleonModelBATSRUS) {
|
||||
//modelType = KameleonWrapper::Model::BATSRUS;
|
||||
//else {
|
||||
LERROR(keyVectorField << "." << keyVectorFieldVolumeModel << " model '" <<
|
||||
model << "' not supported");
|
||||
return {};
|
||||
|
||||
@@ -120,6 +120,7 @@ bool RenderableSphere::isReady() const {
|
||||
}
|
||||
|
||||
bool RenderableSphere::initialize() {
|
||||
delete _sphere;
|
||||
_sphere = new PowerScaledSphere(_size.value(), _segments);
|
||||
_sphere->initialize();
|
||||
|
||||
|
||||
@@ -400,7 +400,6 @@ namespace openspace {
|
||||
|
||||
// converts the quaternion used to rotation matrices
|
||||
_mainCamera->compileViewRotationMatrix();
|
||||
UpdateData a = { Time::ref().currentTime(), Time::ref().deltaTime() };
|
||||
|
||||
// update and evaluate the scene starting from the root node
|
||||
_sceneGraph->update({
|
||||
@@ -484,11 +483,11 @@ namespace openspace {
|
||||
int x1, xSize, y1, ySize;
|
||||
sgct::Engine::instance()->getActiveWindowPtr()->getCurrentViewportPixelCoords(x1, y1, xSize, ySize);
|
||||
int startY = ySize - 2 * font_size_mono;
|
||||
const glm::vec2 scaling = _mainCamera->scaling();
|
||||
const glm::vec3 viewdirection = _mainCamera->viewDirection();
|
||||
const psc position = _mainCamera->position();
|
||||
const psc origin = OsEng.interactionHandler()->focusNode()->worldPosition();
|
||||
const PowerScaledScalar pssl = (position - origin).length();
|
||||
const glm::vec2& scaling = _mainCamera->scaling();
|
||||
const glm::vec3& viewdirection = _mainCamera->viewDirection();
|
||||
const psc& position = _mainCamera->position();
|
||||
const psc& origin = OsEng.interactionHandler()->focusNode()->worldPosition();
|
||||
const PowerScaledScalar& pssl = (position - origin).length();
|
||||
|
||||
// GUI PRINT
|
||||
// Using a macro to shorten line length and increase readability
|
||||
|
||||
@@ -217,7 +217,7 @@ void SceneGraphNode::evaluate(const Camera* camera, const psc& parentPosition) {
|
||||
//const psc toCamera = thisPosition - camPos;
|
||||
|
||||
// init as not visible
|
||||
_boundingSphereVisible = false;
|
||||
//_boundingSphereVisible = false;
|
||||
_renderableVisible = false;
|
||||
|
||||
#ifndef OPENSPACE_VIDEO_EXPORT
|
||||
@@ -414,7 +414,7 @@ SceneGraphNode* SceneGraphNode::childNode(const std::string& name)
|
||||
void SceneGraphNode::updateCamera(Camera* camera) const{
|
||||
|
||||
psc origin = worldPosition();
|
||||
int i = 0;
|
||||
//int i = 0;
|
||||
// the camera position
|
||||
|
||||
psc relative = camera->position();
|
||||
|
||||
Reference in New Issue
Block a user