From dfd8a0da5f7c62980e09a523d35db5890b110969 Mon Sep 17 00:00:00 2001 From: liteng <930372551@qq.com> Date: Mon, 24 Sep 2018 15:02:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A8=E7=94=BB=E6=A8=A1=E5=9E=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ShadowEditor.Web/src/animation/Animation.js | 27 +++++++++++++++++++ .../animation/TweenAnimationComponent.js | 4 +-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/ShadowEditor.Web/src/animation/Animation.js b/ShadowEditor.Web/src/animation/Animation.js index 5854064a..4034b196 100644 --- a/ShadowEditor.Web/src/animation/Animation.js +++ b/ShadowEditor.Web/src/animation/Animation.js @@ -9,12 +9,39 @@ var ID = -1; */ function Animation(options) { options = options || {}; + + // 基本信息 this.id = options.id || null; // MongoDB _id字段 this.uuid = options.uuid || THREE.Math.generateUUID(); // uuid this.name = options.name || `动画${ID--}`; // 动画名称 this.type = options.type || AnimationType.Tween; // 动画类型 this.startTime = options.startTime || 0; // 开始时间(秒) this.endTime = options.endTime || 10; // 结束时间(秒) + + // 补间动画 + this.beginStatus = options.beginStatus || 'Current'; // 开始状态(Current、Custom) + this.beginPositionX = options.beginPositionX || 0; + this.beginPositionY = options.beginPositionY || 0; + this.beginPositionZ = options.beginPositionZ || 0; + this.beginRotationX = options.beginRotationX || 0; + this.beginRotationY = options.beginRotationY || 0; + this.beginRotationZ = options.beginRotationZ || 0; + this.beginScaleLock = options.beginScaleLock === undefined ? true : options.beginScaleLock; + this.beginScaleX = options.beginScaleX || 1.0; + this.beginScaleY = options.beginScaleY || 1.0; + this.beginScaleZ = options.beginScaleZ || 1.0; + this.ease = options.ease || 'linear'; // linear, quadIn, quadOut, quadInOut, cubicIn, cubicOut, cubicInOut, quartIn, quartOut, quartInOut, quintIn, quintOut, quintInOut, sineIn, sineOut, sineInOut, backIn, backOut, backInOut, circIn, circOut, circInOut, bounceIn, bounceOut, bounceInOut, elasticIn, elasticOut, elasticInOut + this.endStatus = options.endStatus || 'Current'; + this.endPositionX = options.endPositionX || 0; + this.endPositionY = options.endPositionY || 0; + this.endPositionZ = options.endPositionZ || 0; + this.endRotationX = options.endRotationX || 0; + this.endRotationY = options.endRotationY || 0; + this.endRotationZ = options.endRotationZ || 0; + this.endScaleLock = options.endScaleLock === undefined ? true : options.endScaleLock; + this.endScaleX = options.endScaleX || 1.0; + this.endScaleY = options.endScaleY || 1.0; + this.endScaleZ = options.endScaleZ || 1.0; } export default Animation; \ No newline at end of file diff --git a/ShadowEditor.Web/src/component/animation/TweenAnimationComponent.js b/ShadowEditor.Web/src/component/animation/TweenAnimationComponent.js index 3eb01a2a..df0ed086 100644 --- a/ShadowEditor.Web/src/component/animation/TweenAnimationComponent.js +++ b/ShadowEditor.Web/src/component/animation/TweenAnimationComponent.js @@ -44,7 +44,7 @@ TweenAnimationComponent.prototype.render = function () { id: 'beginStatus', scope: this.id, options: { - Current: '当前位置', + Current: '当前状态', Custom: '自定义' }, onChange: this.onChange.bind(this) @@ -226,7 +226,7 @@ TweenAnimationComponent.prototype.render = function () { id: 'endStatus', scope: this.id, options: { - Current: '当前位置', + Current: '当前状态', Custom: '自定义' }, onChange: this.onChange.bind(this)