123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233 |
- import defaultValue from "../Core/defaultValue.js";
- import Event from "../Core/Event.js";
- import JulianDate from "../Core/JulianDate.js";
- import ModelAnimationLoop from "./ModelAnimationLoop.js";
- import ModelAnimationState from "./ModelAnimationState.js";
- function ModelAnimation(options, model, runtimeAnimation) {
- this._name = runtimeAnimation.name;
- this._startTime = JulianDate.clone(options.startTime);
- this._delay = defaultValue(options.delay, 0.0);
- this._stopTime = options.stopTime;
-
- this.removeOnStop = defaultValue(options.removeOnStop, false);
- this._multiplier = defaultValue(options.multiplier, 1.0);
- this._reverse = defaultValue(options.reverse, false);
- this._loop = defaultValue(options.loop, ModelAnimationLoop.NONE);
-
- this.start = new Event();
-
- this.update = new Event();
-
- this.stop = new Event();
- this._state = ModelAnimationState.STOPPED;
- this._runtimeAnimation = runtimeAnimation;
-
- this._computedStartTime = undefined;
- this._duration = undefined;
-
- var that = this;
- this._raiseStartEvent = function () {
- that.start.raiseEvent(model, that);
- };
- this._updateEventTime = 0.0;
- this._raiseUpdateEvent = function () {
- that.update.raiseEvent(model, that, that._updateEventTime);
- };
- this._raiseStopEvent = function () {
- that.stop.raiseEvent(model, that);
- };
- }
- Object.defineProperties(ModelAnimation.prototype, {
-
- name: {
- get: function () {
- return this._name;
- },
- },
-
- startTime: {
- get: function () {
- return this._startTime;
- },
- },
-
- delay: {
- get: function () {
- return this._delay;
- },
- },
-
- stopTime: {
- get: function () {
- return this._stopTime;
- },
- },
-
- multiplier: {
- get: function () {
- return this._multiplier;
- },
- },
-
- reverse: {
- get: function () {
- return this._reverse;
- },
- },
-
- loop: {
- get: function () {
- return this._loop;
- },
- },
- });
- export default ModelAnimation;
|