Merge pull request #5676 from AndrewMeadows/dubnium

remove a few warnings from linux build
This commit is contained in:
Seth Alves 2015-09-01 11:45:06 -07:00
commit 3d7aa6f4d6
7 changed files with 22 additions and 22 deletions

View file

@ -104,10 +104,10 @@ bool OpenGLDisplayPlugin::eventFilter(QObject* receiver, QEvent* event) {
if (QCoreApplication::sendEvent(QCoreApplication::instance(), event)) {
return true;
}
break;
default:
break;
}
return false;
}

View file

@ -131,20 +131,20 @@ void ParticleEffectEntityItem::computeAndUpdateDimensions() {
float maxVelocityX = fabsf(_velocity.x) + _velocitySpread.x;
float maxAccelerationX = fabsf(_acceleration.x) + _accelerationSpread.x;
float maxXDistance = (maxVelocityX * time) + (0.5 * maxAccelerationX * time * time);
float maxXDistance = (maxVelocityX * time) + (0.5f * maxAccelerationX * time * time);
float maxVelocityY = fabs(_velocity.y) + _velocitySpread.y;
float maxVelocityY = fabsf(_velocity.y) + _velocitySpread.y;
float maxAccelerationY = fabsf(_acceleration.y) + _accelerationSpread.y;
float maxYDistance = (maxVelocityY * time) + (0.5 * maxAccelerationY * time * time);
float maxYDistance = (maxVelocityY * time) + (0.5f * maxAccelerationY * time * time);
float maxVelocityZ = fabsf(_velocity.z) + _velocitySpread.z;
float maxAccelerationZ = fabsf(_acceleration.z) + _accelerationSpread.z;
float maxZDistance = (maxVelocityZ * time) + (0.5 * maxAccelerationZ * time * time);
float maxZDistance = (maxVelocityZ * time) + (0.5f * maxAccelerationZ * time * time);
float maxDistance = std::max(maxXDistance, std::max(maxYDistance, maxZDistance));
//times 2 because dimensions are diameters not radii
glm::vec3 dims(2.0 * maxDistance);
glm::vec3 dims(2.0f * maxDistance);
EntityItem::setDimensions(dims);
}

View file

@ -230,7 +230,7 @@ void UserInputMapper::update(float deltaTime) {
for (auto i = 0; i < NUM_ACTIONS; i++) {
_actionStates[i] *= _actionScales[i];
// Emit only on change, and emit when moving back to 0
if (fabs(_actionStates[i] - _lastActionStates[i]) > EPSILON) {
if (fabsf(_actionStates[i] - _lastActionStates[i]) > EPSILON) {
_lastActionStates[i] = _actionStates[i];
emit actionEvent(i, _actionStates[i]);
}
@ -319,4 +319,4 @@ void UserInputMapper::createActionNames() {
_actionNames[SHIFT] = "SHIFT";
_actionNames[ACTION1] = "ACTION1";
_actionNames[ACTION2] = "ACTION2";
}
}

View file

@ -243,7 +243,7 @@ void AmbientOcclusion::run(const render::SceneContextPointer& sceneContext, cons
batch._glUniform2f(_depthTexCoordScaleLoc, depthTexCoordScaleS, depthTexCoordScaleT);
batch._glUniform2f(_renderTargetResLoc, fbWidth, fbHeight);
batch._glUniform2f(_renderTargetResInvLoc, 1.0/fbWidth, 1.0/fbHeight);
batch._glUniform2f(_renderTargetResInvLoc, 1.0f / fbWidth, 1.0f / fbHeight);
glm::vec4 color(0.0f, 0.0f, 0.0f, 1.0f);
glm::vec2 bottomLeft(-1.0f, -1.0f);

View file

@ -372,20 +372,20 @@ QRectF glmToRect(const glm::vec2 & pos, const glm::vec2 & size) {
// create matrix from orientation and position
glm::mat4 createMatFromQuatAndPos(const glm::quat& q, const glm::vec3& p) {
glm::mat4 m = glm::mat4_cast(q);
m[3] = glm::vec4(p, 1);
m[3] = glm::vec4(p, 1.0f);
return m;
}
// cancel out roll and pitch
glm::quat cancelOutRollAndPitch(const glm::quat& q) {
glm::vec3 zAxis = q * glm::vec3(0, 0, 1);
glm::vec3 zAxis = q * glm::vec3(0.0f, 0.0f, 1.0f);
// cancel out the roll and pitch
glm::vec3 newZ = (zAxis.x == 0 && zAxis.z == 0) ? vec3(1, 0, 0) : glm::normalize(vec3(zAxis.x, 0, zAxis.z));
glm::vec3 newX = glm::cross(vec3(0, 1, 0), newZ);
glm::vec3 newZ = (zAxis.x == 0 && zAxis.z == 0.0f) ? vec3(1.0f, 0.0f, 0.0f) : glm::normalize(vec3(zAxis.x, 0.0f, zAxis.z));
glm::vec3 newX = glm::cross(vec3(0.0f, 1.0f, 0.0f), newZ);
glm::vec3 newY = glm::cross(newZ, newX);
glm::mat4 temp(glm::vec4(newX, 0), glm::vec4(newY, 0), glm::vec4(newZ, 0), glm::vec4(0, 0, 0, 1));
glm::mat4 temp(glm::vec4(newX, 0.0f), glm::vec4(newY, 0.0f), glm::vec4(newZ, 0.0f), glm::vec4(0.0f, 0.0f, 0.0f, 1.0f));
return glm::quat_cast(temp);
}
@ -394,15 +394,15 @@ glm::mat4 cancelOutRollAndPitch(const glm::mat4& m) {
glm::vec3 zAxis = glm::vec3(m[2]);
// cancel out the roll and pitch
glm::vec3 newZ = (zAxis.x == 0 && zAxis.z == 0) ? vec3(1, 0, 0) : glm::normalize(vec3(zAxis.x, 0, zAxis.z));
glm::vec3 newX = glm::cross(vec3(0, 1, 0), newZ);
glm::vec3 newZ = (zAxis.x == 0.0f && zAxis.z == 0.0f) ? vec3(1.0f, 0.0f, 0.0f) : glm::normalize(vec3(zAxis.x, 0.0f, zAxis.z));
glm::vec3 newX = glm::cross(vec3(0.0f, 1.0f, 0.0f), newZ);
glm::vec3 newY = glm::cross(newZ, newX);
glm::mat4 temp(glm::vec4(newX, 0), glm::vec4(newY, 0), glm::vec4(newZ, 0), m[3]);
glm::mat4 temp(glm::vec4(newX, 0.0f), glm::vec4(newY, 0.0f), glm::vec4(newZ, 0.0f), m[3]);
return temp;
}
glm::vec3 transformPoint(const glm::mat4& m, const glm::vec3& p) {
glm::vec4 temp = m * glm::vec4(p, 1);
glm::vec4 temp = m * glm::vec4(p, 1.0f);
return glm::vec3(temp.x / temp.w, temp.y / temp.w, temp.z / temp.w);
}

View file

@ -93,8 +93,8 @@ template <typename T>
void testByteCountCoded() {
testByteCountCodedStable<T>(0);
testByteCountCodedStable<T>(1);
testByteCountCodedStable<T>(1 << 16);
testByteCountCodedStable<T>(std::numeric_limits<T>::max() >> 16);
testByteCountCodedStable<T>(1 << 8*sizeof(T));
testByteCountCodedStable<T>(std::numeric_limits<T>::max() >> 8*sizeof(T));
testByteCountCodedStable<T>(std::numeric_limits<T>::max() >> 8);
testByteCountCodedStable<T>(std::numeric_limits<T>::max() >> 1);
testByteCountCodedStable<T>(std::numeric_limits<T>::max());

View file

@ -342,8 +342,8 @@ public:
glm::vec3 unitscale { 1.0f };
glm::vec3 up { 0.0f, 1.0f, 0.0f };
glm::vec3 cam_pos { 1.5f * sin(t), 0.0f, 2.0f };
// glm::vec3 camera_focus { 5.0f * cos(t * 0.1f), 0.0f, 0.0f };
glm::vec3 cam_pos { 1.5f * sinf(t), 0.0f, 2.0f };
// glm::vec3 camera_focus { 5.0f * cosf(t * 0.1f), 0.0f, 0.0f };
glm::vec3 camera_focus { 0.0f, 0.0f, 0.0f };
glm::quat cam_rotation;
// glm::quat cam_rotation = glm::quat_cast(glm::lookAt(cam_pos, camera_focus, up));