mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 19:16:56 +02:00
manually promote glm values to double when stringifying (to prevent -Wdouble-promotion "error")
This commit is contained in:
parent
f9d29256e0
commit
c17d1a6d88
3 changed files with 4 additions and 4 deletions
|
@ -69,7 +69,7 @@ glm::vec3 Mat4::getUp(const glm::mat4& m) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mat4::print(const QString& label, const glm::mat4& m, bool transpose) const {
|
void Mat4::print(const QString& label, const glm::mat4& m, bool transpose) const {
|
||||||
glm::mat4 out = transpose ? glm::transpose(m) : m;
|
glm::dmat4 out = transpose ? glm::transpose(m) : m;
|
||||||
QString message = QString("%1 %2").arg(qPrintable(label));
|
QString message = QString("%1 %2").arg(qPrintable(label));
|
||||||
message = message.arg(glm::to_string(out).c_str());
|
message = message.arg(glm::to_string(out).c_str());
|
||||||
qCDebug(scriptengine) << message;
|
qCDebug(scriptengine) << message;
|
||||||
|
|
|
@ -119,9 +119,9 @@ float Quat::dot(const glm::quat& q1, const glm::quat& q2) {
|
||||||
void Quat::print(const QString& label, const glm::quat& q, bool asDegrees) {
|
void Quat::print(const QString& label, const glm::quat& q, bool asDegrees) {
|
||||||
QString message = QString("%1 %2").arg(qPrintable(label));
|
QString message = QString("%1 %2").arg(qPrintable(label));
|
||||||
if (asDegrees) {
|
if (asDegrees) {
|
||||||
message = message.arg(glm::to_string(safeEulerAngles(q)).c_str());
|
message = message.arg(glm::to_string(glm::dvec3(safeEulerAngles(q))).c_str());
|
||||||
} else {
|
} else {
|
||||||
message = message.arg(glm::to_string(q).c_str());
|
message = message.arg(glm::to_string(glm::dquat(q)).c_str());
|
||||||
}
|
}
|
||||||
qCDebug(scriptengine) << message;
|
qCDebug(scriptengine) << message;
|
||||||
if (ScriptEngine* scriptEngine = qobject_cast<ScriptEngine*>(engine())) {
|
if (ScriptEngine* scriptEngine = qobject_cast<ScriptEngine*>(engine())) {
|
||||||
|
|
|
@ -29,7 +29,7 @@ float Vec3::orientedAngle(const glm::vec3& v1, const glm::vec3& v2, const glm::v
|
||||||
|
|
||||||
void Vec3::print(const QString& label, const glm::vec3& v) {
|
void Vec3::print(const QString& label, const glm::vec3& v) {
|
||||||
QString message = QString("%1 %2").arg(qPrintable(label));
|
QString message = QString("%1 %2").arg(qPrintable(label));
|
||||||
message = message.arg(glm::to_string(v).c_str());
|
message = message.arg(glm::to_string(glm::dvec3(v)).c_str());
|
||||||
qCDebug(scriptengine) << message;
|
qCDebug(scriptengine) << message;
|
||||||
if (ScriptEngine* scriptEngine = qobject_cast<ScriptEngine*>(engine())) {
|
if (ScriptEngine* scriptEngine = qobject_cast<ScriptEngine*>(engine())) {
|
||||||
scriptEngine->print(message);
|
scriptEngine->print(message);
|
||||||
|
|
Loading…
Reference in a new issue