mirror of
https://github.com/lubosz/overte.git
synced 2025-04-15 11:29:18 +02:00
Merge pull request #5224 from sethalves/fix-nan-in-vec3
don't try to convert a vec3 containing NaN to a script value
This commit is contained in:
commit
fbf2f51ded
1 changed files with 4 additions and 0 deletions
|
@ -63,6 +63,10 @@ void vec4FromScriptValue(const QScriptValue& object, glm::vec4& vec4) {
|
|||
|
||||
QScriptValue vec3toScriptValue(QScriptEngine* engine, const glm::vec3 &vec3) {
|
||||
QScriptValue obj = engine->newObject();
|
||||
if (vec3.x != vec3.x || vec3.y != vec3.y || vec3.z != vec3.z) {
|
||||
// if vec3 contains a NaN don't try to convert it
|
||||
return obj;
|
||||
}
|
||||
obj.setProperty("x", vec3.x);
|
||||
obj.setProperty("y", vec3.y);
|
||||
obj.setProperty("z", vec3.z);
|
||||
|
|
Loading…
Reference in a new issue