From 7e2ec4f0f8b7a4895e168310866084d4cdb1c6af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leslie=20Leigh=20=28=E6=9D=8E=E7=9A=84=E5=BA=8F=29?= Date: Wed, 25 Dec 2019 12:27:29 +0800 Subject: [PATCH] Fix that `Quat` constructor misbehaves when argument `w` is 0 (#5957) --- cocos/core/math/quat.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/core/math/quat.ts b/cocos/core/math/quat.ts index 2b7b4b34fa..2c86d142b4 100644 --- a/cocos/core/math/quat.ts +++ b/cocos/core/math/quat.ts @@ -648,7 +648,7 @@ export class Quat extends ValueType { this.x = x || 0; this.y = y || 0; this.z = z || 0; - this.w = w || 1; + this.w = w ?? 1; } }