From cd4ec8f2cd3f883e6729c1c369402f6cb3ef456d Mon Sep 17 00:00:00 2001 From: libaii <1714653636@qq.com> Date: Sat, 10 Sep 2022 13:01:04 +0800 Subject: [PATCH] feat: add a new method setRotateDeg --- lib/node/node.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/node/node.js b/lib/node/node.js index 9643e234..0baca514 100755 --- a/lib/node/node.js +++ b/lib/node/node.js @@ -39,7 +39,7 @@ class FFNode extends FFBase { this.duration = 0; this.parent = null; this.preload = preload; - // + // this.t = 0; this.removeTime = 999999 * 1000; @@ -90,6 +90,15 @@ class FFNode extends FFBase { this.display.rotation = rotation; } + /** + * set display object rotation by deg + * @param deg + */ + setRotateDeg(deg = 0) { + deg = deg * (3.1415927 / 180); + this.display.rotation = deg; + } + /** * Set the duration of node in the scene * @param {number} duration