es6.js 123 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737
  1. var __extends = (this && this.__extends) || (function () {
  2. var extendStatics = Object.setPrototypeOf ||
  3. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  4. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  5. return function (d, b) {
  6. extendStatics(d, b);
  7. function __() { this.constructor = d; }
  8. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  9. };
  10. })();
  11. import * as BABYLON from 'babylonjs/core/es6';
  12. var BABYLON;
  13. (function (BABYLON) {
  14. var AnimationRange = /** @class */ (function () {
  15. function AnimationRange(name, from, to) {
  16. this.name = name;
  17. this.from = from;
  18. this.to = to;
  19. }
  20. AnimationRange.prototype.clone = function () {
  21. return new AnimationRange(this.name, this.from, this.to);
  22. };
  23. return AnimationRange;
  24. }());
  25. BABYLON.AnimationRange = AnimationRange;
  26. /**
  27. * Composed of a frame, and an action function
  28. */
  29. var AnimationEvent = /** @class */ (function () {
  30. function AnimationEvent(frame, action, onlyOnce) {
  31. this.frame = frame;
  32. this.action = action;
  33. this.onlyOnce = onlyOnce;
  34. this.isDone = false;
  35. }
  36. return AnimationEvent;
  37. }());
  38. BABYLON.AnimationEvent = AnimationEvent;
  39. var PathCursor = /** @class */ (function () {
  40. function PathCursor(path) {
  41. this.path = path;
  42. this._onchange = new Array();
  43. this.value = 0;
  44. this.animations = new Array();
  45. }
  46. PathCursor.prototype.getPoint = function () {
  47. var point = this.path.getPointAtLengthPosition(this.value);
  48. return new BABYLON.Vector3(point.x, 0, point.y);
  49. };
  50. PathCursor.prototype.moveAhead = function (step) {
  51. if (step === void 0) { step = 0.002; }
  52. this.move(step);
  53. return this;
  54. };
  55. PathCursor.prototype.moveBack = function (step) {
  56. if (step === void 0) { step = 0.002; }
  57. this.move(-step);
  58. return this;
  59. };
  60. PathCursor.prototype.move = function (step) {
  61. if (Math.abs(step) > 1) {
  62. throw "step size should be less than 1.";
  63. }
  64. this.value += step;
  65. this.ensureLimits();
  66. this.raiseOnChange();
  67. return this;
  68. };
  69. PathCursor.prototype.ensureLimits = function () {
  70. while (this.value > 1) {
  71. this.value -= 1;
  72. }
  73. while (this.value < 0) {
  74. this.value += 1;
  75. }
  76. return this;
  77. };
  78. // used by animation engine
  79. PathCursor.prototype.raiseOnChange = function () {
  80. var _this = this;
  81. this._onchange.forEach(function (f) { return f(_this); });
  82. return this;
  83. };
  84. PathCursor.prototype.onchange = function (f) {
  85. this._onchange.push(f);
  86. return this;
  87. };
  88. return PathCursor;
  89. }());
  90. BABYLON.PathCursor = PathCursor;
  91. var Animation = /** @class */ (function () {
  92. function Animation(name, targetProperty, framePerSecond, dataType, loopMode, enableBlending) {
  93. this.name = name;
  94. this.targetProperty = targetProperty;
  95. this.framePerSecond = framePerSecond;
  96. this.dataType = dataType;
  97. this.loopMode = loopMode;
  98. this.enableBlending = enableBlending;
  99. this._runtimeAnimations = new Array();
  100. // The set of event that will be linked to this animation
  101. this._events = new Array();
  102. this.blendingSpeed = 0.01;
  103. this._ranges = {};
  104. this.targetPropertyPath = targetProperty.split(".");
  105. this.dataType = dataType;
  106. this.loopMode = loopMode === undefined ? Animation.ANIMATIONLOOPMODE_CYCLE : loopMode;
  107. }
  108. Animation._PrepareAnimation = function (name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction) {
  109. var dataType = undefined;
  110. if (!isNaN(parseFloat(from)) && isFinite(from)) {
  111. dataType = Animation.ANIMATIONTYPE_FLOAT;
  112. }
  113. else if (from instanceof BABYLON.Quaternion) {
  114. dataType = Animation.ANIMATIONTYPE_QUATERNION;
  115. }
  116. else if (from instanceof BABYLON.Vector3) {
  117. dataType = Animation.ANIMATIONTYPE_VECTOR3;
  118. }
  119. else if (from instanceof BABYLON.Vector2) {
  120. dataType = Animation.ANIMATIONTYPE_VECTOR2;
  121. }
  122. else if (from instanceof BABYLON.Color3) {
  123. dataType = Animation.ANIMATIONTYPE_COLOR3;
  124. }
  125. else if (from instanceof BABYLON.Size) {
  126. dataType = Animation.ANIMATIONTYPE_SIZE;
  127. }
  128. if (dataType == undefined) {
  129. return null;
  130. }
  131. var animation = new Animation(name, targetProperty, framePerSecond, dataType, loopMode);
  132. var keys = [{ frame: 0, value: from }, { frame: totalFrame, value: to }];
  133. animation.setKeys(keys);
  134. if (easingFunction !== undefined) {
  135. animation.setEasingFunction(easingFunction);
  136. }
  137. return animation;
  138. };
  139. /**
  140. * Sets up an animation.
  141. * @param property the property to animate
  142. * @param animationType the animation type to apply
  143. * @param easingFunction the easing function used in the animation
  144. * @returns The created animation
  145. */
  146. Animation.CreateAnimation = function (property, animationType, framePerSecond, easingFunction) {
  147. var animation = new Animation(property + "Animation", property, framePerSecond, animationType, Animation.ANIMATIONLOOPMODE_CONSTANT);
  148. animation.setEasingFunction(easingFunction);
  149. return animation;
  150. };
  151. /**
  152. * Create and start an animation on a node
  153. * @param {string} name defines the name of the global animation that will be run on all nodes
  154. * @param {BABYLON.Node} node defines the root node where the animation will take place
  155. * @param {string} targetProperty defines property to animate
  156. * @param {number} framePerSecond defines the number of frame per second yo use
  157. * @param {number} totalFrame defines the number of frames in total
  158. * @param {any} from defines the initial value
  159. * @param {any} to defines the final value
  160. * @param {number} loopMode defines which loop mode you want to use (off by default)
  161. * @param {BABYLON.EasingFunction} easingFunction defines the easing function to use (linear by default)
  162. * @param onAnimationEnd defines the callback to call when animation end
  163. * @returns the animatable created for this animation
  164. */
  165. Animation.CreateAndStartAnimation = function (name, node, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction, onAnimationEnd) {
  166. var animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction);
  167. if (!animation) {
  168. return null;
  169. }
  170. return node.getScene().beginDirectAnimation(node, [animation], 0, totalFrame, (animation.loopMode === 1), 1.0, onAnimationEnd);
  171. };
  172. /**
  173. * Create and start an animation on a node and its descendants
  174. * @param {string} name defines the name of the global animation that will be run on all nodes
  175. * @param {BABYLON.Node} node defines the root node where the animation will take place
  176. * @param {boolean} directDescendantsOnly if true only direct descendants will be used, if false direct and also indirect (children of children, an so on in a recursive manner) descendants will be used.
  177. * @param {string} targetProperty defines property to animate
  178. * @param {number} framePerSecond defines the number of frame per second yo use
  179. * @param {number} totalFrame defines the number of frames in total
  180. * @param {any} from defines the initial value
  181. * @param {any} to defines the final value
  182. * @param {number} loopMode defines which loop mode you want to use (off by default)
  183. * @param {BABYLON.EasingFunction} easingFunction defines the easing function to use (linear by default)
  184. * @param onAnimationEnd defines the callback to call when an animation ends (will be called once per node)
  185. * @returns the list of animatables created for all nodes
  186. * @example https://www.babylonjs-playground.com/#MH0VLI
  187. */
  188. Animation.CreateAndStartHierarchyAnimation = function (name, node, directDescendantsOnly, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction, onAnimationEnd) {
  189. var animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction);
  190. if (!animation) {
  191. return null;
  192. }
  193. var scene = node.getScene();
  194. return scene.beginDirectHierarchyAnimation(node, directDescendantsOnly, [animation], 0, totalFrame, (animation.loopMode === 1), 1.0, onAnimationEnd);
  195. };
  196. Animation.CreateMergeAndStartAnimation = function (name, node, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction, onAnimationEnd) {
  197. var animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction);
  198. if (!animation) {
  199. return null;
  200. }
  201. node.animations.push(animation);
  202. return node.getScene().beginAnimation(node, 0, totalFrame, (animation.loopMode === 1), 1.0, onAnimationEnd);
  203. };
  204. /**
  205. * Transition property of the Camera to the target Value.
  206. * @param property The property to transition
  207. * @param targetValue The target Value of the property
  208. * @param host The object where the property to animate belongs
  209. * @param scene Scene used to run the animation
  210. * @param frameRate Framerate (in frame/s) to use
  211. * @param transition The transition type we want to use
  212. * @param duration The duration of the animation, in milliseconds
  213. * @param onAnimationEnd Call back trigger at the end of the animation.
  214. */
  215. Animation.TransitionTo = function (property, targetValue, host, scene, frameRate, transition, duration, onAnimationEnd) {
  216. if (onAnimationEnd === void 0) { onAnimationEnd = null; }
  217. if (duration <= 0) {
  218. host[property] = targetValue;
  219. if (onAnimationEnd) {
  220. onAnimationEnd();
  221. }
  222. return null;
  223. }
  224. var endFrame = frameRate * (duration / 1000);
  225. transition.setKeys([{
  226. frame: 0,
  227. value: host[property].clone ? host[property].clone() : host[property]
  228. },
  229. {
  230. frame: endFrame,
  231. value: targetValue
  232. }]);
  233. if (!host.animations) {
  234. host.animations = [];
  235. }
  236. host.animations.push(transition);
  237. var animation = scene.beginAnimation(host, 0, endFrame, false);
  238. animation.onAnimationEnd = onAnimationEnd;
  239. return animation;
  240. };
  241. Object.defineProperty(Animation.prototype, "runtimeAnimations", {
  242. /**
  243. * Return the array of runtime animations currently using this animation
  244. */
  245. get: function () {
  246. return this._runtimeAnimations;
  247. },
  248. enumerable: true,
  249. configurable: true
  250. });
  251. Object.defineProperty(Animation.prototype, "hasRunningRuntimeAnimations", {
  252. get: function () {
  253. for (var _i = 0, _a = this._runtimeAnimations; _i < _a.length; _i++) {
  254. var runtimeAnimation = _a[_i];
  255. if (!runtimeAnimation.isStopped) {
  256. return true;
  257. }
  258. }
  259. return false;
  260. },
  261. enumerable: true,
  262. configurable: true
  263. });
  264. // Methods
  265. /**
  266. * @param {boolean} fullDetails - support for multiple levels of logging within scene loading
  267. */
  268. Animation.prototype.toString = function (fullDetails) {
  269. var ret = "Name: " + this.name + ", property: " + this.targetProperty;
  270. ret += ", datatype: " + (["Float", "Vector3", "Quaternion", "Matrix", "Color3", "Vector2"])[this.dataType];
  271. ret += ", nKeys: " + (this._keys ? this._keys.length : "none");
  272. ret += ", nRanges: " + (this._ranges ? Object.keys(this._ranges).length : "none");
  273. if (fullDetails) {
  274. ret += ", Ranges: {";
  275. var first = true;
  276. for (var name in this._ranges) {
  277. if (first) {
  278. ret += ", ";
  279. first = false;
  280. }
  281. ret += name;
  282. }
  283. ret += "}";
  284. }
  285. return ret;
  286. };
  287. /**
  288. * Add an event to this animation.
  289. */
  290. Animation.prototype.addEvent = function (event) {
  291. this._events.push(event);
  292. };
  293. /**
  294. * Remove all events found at the given frame
  295. * @param frame
  296. */
  297. Animation.prototype.removeEvents = function (frame) {
  298. for (var index = 0; index < this._events.length; index++) {
  299. if (this._events[index].frame === frame) {
  300. this._events.splice(index, 1);
  301. index--;
  302. }
  303. }
  304. };
  305. Animation.prototype.getEvents = function () {
  306. return this._events;
  307. };
  308. Animation.prototype.createRange = function (name, from, to) {
  309. // check name not already in use; could happen for bones after serialized
  310. if (!this._ranges[name]) {
  311. this._ranges[name] = new AnimationRange(name, from, to);
  312. }
  313. };
  314. Animation.prototype.deleteRange = function (name, deleteFrames) {
  315. if (deleteFrames === void 0) { deleteFrames = true; }
  316. var range = this._ranges[name];
  317. if (!range) {
  318. return;
  319. }
  320. if (deleteFrames) {
  321. var from = range.from;
  322. var to = range.to;
  323. // this loop MUST go high to low for multiple splices to work
  324. for (var key = this._keys.length - 1; key >= 0; key--) {
  325. if (this._keys[key].frame >= from && this._keys[key].frame <= to) {
  326. this._keys.splice(key, 1);
  327. }
  328. }
  329. }
  330. this._ranges[name] = null; // said much faster than 'delete this._range[name]'
  331. };
  332. Animation.prototype.getRange = function (name) {
  333. return this._ranges[name];
  334. };
  335. Animation.prototype.getKeys = function () {
  336. return this._keys;
  337. };
  338. Animation.prototype.getHighestFrame = function () {
  339. var ret = 0;
  340. for (var key = 0, nKeys = this._keys.length; key < nKeys; key++) {
  341. if (ret < this._keys[key].frame) {
  342. ret = this._keys[key].frame;
  343. }
  344. }
  345. return ret;
  346. };
  347. Animation.prototype.getEasingFunction = function () {
  348. return this._easingFunction;
  349. };
  350. Animation.prototype.setEasingFunction = function (easingFunction) {
  351. this._easingFunction = easingFunction;
  352. };
  353. Animation.prototype.floatInterpolateFunction = function (startValue, endValue, gradient) {
  354. return BABYLON.Scalar.Lerp(startValue, endValue, gradient);
  355. };
  356. Animation.prototype.floatInterpolateFunctionWithTangents = function (startValue, outTangent, endValue, inTangent, gradient) {
  357. return BABYLON.Scalar.Hermite(startValue, outTangent, endValue, inTangent, gradient);
  358. };
  359. Animation.prototype.quaternionInterpolateFunction = function (startValue, endValue, gradient) {
  360. return BABYLON.Quaternion.Slerp(startValue, endValue, gradient);
  361. };
  362. Animation.prototype.quaternionInterpolateFunctionWithTangents = function (startValue, outTangent, endValue, inTangent, gradient) {
  363. return BABYLON.Quaternion.Hermite(startValue, outTangent, endValue, inTangent, gradient).normalize();
  364. };
  365. Animation.prototype.vector3InterpolateFunction = function (startValue, endValue, gradient) {
  366. return BABYLON.Vector3.Lerp(startValue, endValue, gradient);
  367. };
  368. Animation.prototype.vector3InterpolateFunctionWithTangents = function (startValue, outTangent, endValue, inTangent, gradient) {
  369. return BABYLON.Vector3.Hermite(startValue, outTangent, endValue, inTangent, gradient);
  370. };
  371. Animation.prototype.vector2InterpolateFunction = function (startValue, endValue, gradient) {
  372. return BABYLON.Vector2.Lerp(startValue, endValue, gradient);
  373. };
  374. Animation.prototype.vector2InterpolateFunctionWithTangents = function (startValue, outTangent, endValue, inTangent, gradient) {
  375. return BABYLON.Vector2.Hermite(startValue, outTangent, endValue, inTangent, gradient);
  376. };
  377. Animation.prototype.sizeInterpolateFunction = function (startValue, endValue, gradient) {
  378. return BABYLON.Size.Lerp(startValue, endValue, gradient);
  379. };
  380. Animation.prototype.color3InterpolateFunction = function (startValue, endValue, gradient) {
  381. return BABYLON.Color3.Lerp(startValue, endValue, gradient);
  382. };
  383. Animation.prototype.matrixInterpolateFunction = function (startValue, endValue, gradient) {
  384. return BABYLON.Matrix.Lerp(startValue, endValue, gradient);
  385. };
  386. Animation.prototype.clone = function () {
  387. var clone = new Animation(this.name, this.targetPropertyPath.join("."), this.framePerSecond, this.dataType, this.loopMode);
  388. clone.enableBlending = this.enableBlending;
  389. clone.blendingSpeed = this.blendingSpeed;
  390. if (this._keys) {
  391. clone.setKeys(this._keys);
  392. }
  393. if (this._ranges) {
  394. clone._ranges = {};
  395. for (var name in this._ranges) {
  396. var range = this._ranges[name];
  397. if (!range) {
  398. continue;
  399. }
  400. clone._ranges[name] = range.clone();
  401. }
  402. }
  403. return clone;
  404. };
  405. Animation.prototype.setKeys = function (values) {
  406. this._keys = values.slice(0);
  407. };
  408. Animation.prototype.serialize = function () {
  409. var serializationObject = {};
  410. serializationObject.name = this.name;
  411. serializationObject.property = this.targetProperty;
  412. serializationObject.framePerSecond = this.framePerSecond;
  413. serializationObject.dataType = this.dataType;
  414. serializationObject.loopBehavior = this.loopMode;
  415. serializationObject.enableBlending = this.enableBlending;
  416. serializationObject.blendingSpeed = this.blendingSpeed;
  417. var dataType = this.dataType;
  418. serializationObject.keys = [];
  419. var keys = this.getKeys();
  420. for (var index = 0; index < keys.length; index++) {
  421. var animationKey = keys[index];
  422. var key = {};
  423. key.frame = animationKey.frame;
  424. switch (dataType) {
  425. case Animation.ANIMATIONTYPE_FLOAT:
  426. key.values = [animationKey.value];
  427. break;
  428. case Animation.ANIMATIONTYPE_QUATERNION:
  429. case Animation.ANIMATIONTYPE_MATRIX:
  430. case Animation.ANIMATIONTYPE_VECTOR3:
  431. case Animation.ANIMATIONTYPE_COLOR3:
  432. key.values = animationKey.value.asArray();
  433. break;
  434. }
  435. serializationObject.keys.push(key);
  436. }
  437. serializationObject.ranges = [];
  438. for (var name in this._ranges) {
  439. var source = this._ranges[name];
  440. if (!source) {
  441. continue;
  442. }
  443. var range = {};
  444. range.name = name;
  445. range.from = source.from;
  446. range.to = source.to;
  447. serializationObject.ranges.push(range);
  448. }
  449. return serializationObject;
  450. };
  451. Object.defineProperty(Animation, "ANIMATIONTYPE_FLOAT", {
  452. get: function () {
  453. return Animation._ANIMATIONTYPE_FLOAT;
  454. },
  455. enumerable: true,
  456. configurable: true
  457. });
  458. Object.defineProperty(Animation, "ANIMATIONTYPE_VECTOR3", {
  459. get: function () {
  460. return Animation._ANIMATIONTYPE_VECTOR3;
  461. },
  462. enumerable: true,
  463. configurable: true
  464. });
  465. Object.defineProperty(Animation, "ANIMATIONTYPE_VECTOR2", {
  466. get: function () {
  467. return Animation._ANIMATIONTYPE_VECTOR2;
  468. },
  469. enumerable: true,
  470. configurable: true
  471. });
  472. Object.defineProperty(Animation, "ANIMATIONTYPE_SIZE", {
  473. get: function () {
  474. return Animation._ANIMATIONTYPE_SIZE;
  475. },
  476. enumerable: true,
  477. configurable: true
  478. });
  479. Object.defineProperty(Animation, "ANIMATIONTYPE_QUATERNION", {
  480. get: function () {
  481. return Animation._ANIMATIONTYPE_QUATERNION;
  482. },
  483. enumerable: true,
  484. configurable: true
  485. });
  486. Object.defineProperty(Animation, "ANIMATIONTYPE_MATRIX", {
  487. get: function () {
  488. return Animation._ANIMATIONTYPE_MATRIX;
  489. },
  490. enumerable: true,
  491. configurable: true
  492. });
  493. Object.defineProperty(Animation, "ANIMATIONTYPE_COLOR3", {
  494. get: function () {
  495. return Animation._ANIMATIONTYPE_COLOR3;
  496. },
  497. enumerable: true,
  498. configurable: true
  499. });
  500. Object.defineProperty(Animation, "ANIMATIONLOOPMODE_RELATIVE", {
  501. get: function () {
  502. return Animation._ANIMATIONLOOPMODE_RELATIVE;
  503. },
  504. enumerable: true,
  505. configurable: true
  506. });
  507. Object.defineProperty(Animation, "ANIMATIONLOOPMODE_CYCLE", {
  508. get: function () {
  509. return Animation._ANIMATIONLOOPMODE_CYCLE;
  510. },
  511. enumerable: true,
  512. configurable: true
  513. });
  514. Object.defineProperty(Animation, "ANIMATIONLOOPMODE_CONSTANT", {
  515. get: function () {
  516. return Animation._ANIMATIONLOOPMODE_CONSTANT;
  517. },
  518. enumerable: true,
  519. configurable: true
  520. });
  521. Animation.Parse = function (parsedAnimation) {
  522. var animation = new Animation(parsedAnimation.name, parsedAnimation.property, parsedAnimation.framePerSecond, parsedAnimation.dataType, parsedAnimation.loopBehavior);
  523. var dataType = parsedAnimation.dataType;
  524. var keys = [];
  525. var data;
  526. var index;
  527. if (parsedAnimation.enableBlending) {
  528. animation.enableBlending = parsedAnimation.enableBlending;
  529. }
  530. if (parsedAnimation.blendingSpeed) {
  531. animation.blendingSpeed = parsedAnimation.blendingSpeed;
  532. }
  533. for (index = 0; index < parsedAnimation.keys.length; index++) {
  534. var key = parsedAnimation.keys[index];
  535. var inTangent;
  536. var outTangent;
  537. switch (dataType) {
  538. case Animation.ANIMATIONTYPE_FLOAT:
  539. data = key.values[0];
  540. if (key.values.length >= 1) {
  541. inTangent = key.values[1];
  542. }
  543. if (key.values.length >= 2) {
  544. outTangent = key.values[2];
  545. }
  546. break;
  547. case Animation.ANIMATIONTYPE_QUATERNION:
  548. data = BABYLON.Quaternion.FromArray(key.values);
  549. if (key.values.length >= 8) {
  550. var _inTangent = BABYLON.Quaternion.FromArray(key.values.slice(4, 8));
  551. if (!_inTangent.equals(BABYLON.Quaternion.Zero())) {
  552. inTangent = _inTangent;
  553. }
  554. }
  555. if (key.values.length >= 12) {
  556. var _outTangent = BABYLON.Quaternion.FromArray(key.values.slice(8, 12));
  557. if (!_outTangent.equals(BABYLON.Quaternion.Zero())) {
  558. outTangent = _outTangent;
  559. }
  560. }
  561. break;
  562. case Animation.ANIMATIONTYPE_MATRIX:
  563. data = BABYLON.Matrix.FromArray(key.values);
  564. break;
  565. case Animation.ANIMATIONTYPE_COLOR3:
  566. data = BABYLON.Color3.FromArray(key.values);
  567. break;
  568. case Animation.ANIMATIONTYPE_VECTOR3:
  569. default:
  570. data = BABYLON.Vector3.FromArray(key.values);
  571. break;
  572. }
  573. var keyData = {};
  574. keyData.frame = key.frame;
  575. keyData.value = data;
  576. if (inTangent != undefined) {
  577. keyData.inTangent = inTangent;
  578. }
  579. if (outTangent != undefined) {
  580. keyData.outTangent = outTangent;
  581. }
  582. keys.push(keyData);
  583. }
  584. animation.setKeys(keys);
  585. if (parsedAnimation.ranges) {
  586. for (index = 0; index < parsedAnimation.ranges.length; index++) {
  587. data = parsedAnimation.ranges[index];
  588. animation.createRange(data.name, data.from, data.to);
  589. }
  590. }
  591. return animation;
  592. };
  593. Animation.AppendSerializedAnimations = function (source, destination) {
  594. if (source.animations) {
  595. destination.animations = [];
  596. for (var animationIndex = 0; animationIndex < source.animations.length; animationIndex++) {
  597. var animation = source.animations[animationIndex];
  598. destination.animations.push(animation.serialize());
  599. }
  600. }
  601. };
  602. Animation.AllowMatricesInterpolation = false;
  603. // Statics
  604. Animation._ANIMATIONTYPE_FLOAT = 0;
  605. Animation._ANIMATIONTYPE_VECTOR3 = 1;
  606. Animation._ANIMATIONTYPE_QUATERNION = 2;
  607. Animation._ANIMATIONTYPE_MATRIX = 3;
  608. Animation._ANIMATIONTYPE_COLOR3 = 4;
  609. Animation._ANIMATIONTYPE_VECTOR2 = 5;
  610. Animation._ANIMATIONTYPE_SIZE = 6;
  611. Animation._ANIMATIONLOOPMODE_RELATIVE = 0;
  612. Animation._ANIMATIONLOOPMODE_CYCLE = 1;
  613. Animation._ANIMATIONLOOPMODE_CONSTANT = 2;
  614. return Animation;
  615. }());
  616. BABYLON.Animation = Animation;
  617. })(BABYLON || (BABYLON = {}));
  618. //# sourceMappingURL=babylon.animation.js.map
  619. var BABYLON;
  620. (function (BABYLON) {
  621. /**
  622. * This class defines the direct association between an animation and a target
  623. */
  624. var TargetedAnimation = /** @class */ (function () {
  625. function TargetedAnimation() {
  626. }
  627. return TargetedAnimation;
  628. }());
  629. BABYLON.TargetedAnimation = TargetedAnimation;
  630. /**
  631. * Use this class to create coordinated animations on multiple targets
  632. */
  633. var AnimationGroup = /** @class */ (function () {
  634. function AnimationGroup(name, scene) {
  635. if (scene === void 0) { scene = null; }
  636. this.name = name;
  637. this._targetedAnimations = new Array();
  638. this._animatables = new Array();
  639. this._from = Number.MAX_VALUE;
  640. this._to = Number.MIN_VALUE;
  641. this._speedRatio = 1;
  642. this.onAnimationEndObservable = new BABYLON.Observable();
  643. this._scene = scene || BABYLON.Engine.LastCreatedScene;
  644. this._scene.animationGroups.push(this);
  645. }
  646. Object.defineProperty(AnimationGroup.prototype, "isStarted", {
  647. /**
  648. * Define if the animations are started
  649. */
  650. get: function () {
  651. return this._isStarted;
  652. },
  653. enumerable: true,
  654. configurable: true
  655. });
  656. Object.defineProperty(AnimationGroup.prototype, "speedRatio", {
  657. /**
  658. * Gets or sets the speed ratio to use for all animations
  659. */
  660. get: function () {
  661. return this._speedRatio;
  662. },
  663. /**
  664. * Gets or sets the speed ratio to use for all animations
  665. */
  666. set: function (value) {
  667. if (this._speedRatio === value) {
  668. return;
  669. }
  670. this._speedRatio = value;
  671. for (var index = 0; index < this._animatables.length; index++) {
  672. var animatable = this._animatables[index];
  673. animatable.speedRatio = this._speedRatio;
  674. }
  675. },
  676. enumerable: true,
  677. configurable: true
  678. });
  679. /**
  680. * Add an animation (with its target) in the group
  681. * @param animation defines the animation we want to add
  682. * @param target defines the target of the animation
  683. * @returns the {BABYLON.TargetedAnimation} object
  684. */
  685. AnimationGroup.prototype.addTargetedAnimation = function (animation, target) {
  686. var targetedAnimation = {
  687. animation: animation,
  688. target: target
  689. };
  690. var keys = animation.getKeys();
  691. if (this._from > keys[0].frame) {
  692. this._from = keys[0].frame;
  693. }
  694. if (this._to < keys[keys.length - 1].frame) {
  695. this._to = keys[keys.length - 1].frame;
  696. }
  697. this._targetedAnimations.push(targetedAnimation);
  698. return targetedAnimation;
  699. };
  700. /**
  701. * This function will normalize every animation in the group to make sure they all go from beginFrame to endFrame
  702. * It can add constant keys at begin or end
  703. * @param beginFrame defines the new begin frame for all animations. It can't be bigger than the smaller begin frame of all animations
  704. * @param endFrame defines the new end frame for all animations. It can't be smaller than the larger end frame of all animations
  705. */
  706. AnimationGroup.prototype.normalize = function (beginFrame, endFrame) {
  707. beginFrame = Math.min(beginFrame, this._from);
  708. endFrame = Math.min(endFrame, this._to);
  709. for (var index = 0; index < this._targetedAnimations.length; index++) {
  710. var targetedAnimation = this._targetedAnimations[index];
  711. var keys = targetedAnimation.animation.getKeys();
  712. var startKey = keys[0];
  713. var endKey = keys[keys.length - 1];
  714. if (startKey.frame > beginFrame) {
  715. var newKey = {
  716. frame: beginFrame,
  717. value: startKey.value,
  718. inTangent: startKey.inTangent,
  719. outTangent: startKey.outTangent
  720. };
  721. keys.splice(0, 0, newKey);
  722. }
  723. if (endKey.frame < endFrame) {
  724. var newKey = {
  725. frame: endFrame,
  726. value: endKey.value,
  727. inTangent: startKey.outTangent,
  728. outTangent: startKey.outTangent
  729. };
  730. keys.push(newKey);
  731. }
  732. }
  733. return this;
  734. };
  735. /**
  736. * Start all animations on given targets
  737. * @param loop defines if animations must loop
  738. * @param speedRatio defines the ratio to apply to animation speed (1 by default)
  739. */
  740. AnimationGroup.prototype.start = function (loop, speedRatio) {
  741. var _this = this;
  742. if (loop === void 0) { loop = false; }
  743. if (speedRatio === void 0) { speedRatio = 1; }
  744. if (this._isStarted || this._targetedAnimations.length === 0) {
  745. return this;
  746. }
  747. var _loop_1 = function () {
  748. var targetedAnimation = this_1._targetedAnimations[index];
  749. this_1._animatables.push(this_1._scene.beginDirectAnimation(targetedAnimation.target, [targetedAnimation.animation], this_1._from, this_1._to, loop, speedRatio, function () {
  750. _this.onAnimationEndObservable.notifyObservers(targetedAnimation);
  751. }));
  752. };
  753. var this_1 = this;
  754. for (var index = 0; index < this._targetedAnimations.length; index++) {
  755. _loop_1();
  756. }
  757. this._speedRatio = speedRatio;
  758. this._isStarted = true;
  759. return this;
  760. };
  761. /**
  762. * Pause all animations
  763. */
  764. AnimationGroup.prototype.pause = function () {
  765. if (!this._isStarted) {
  766. return this;
  767. }
  768. for (var index = 0; index < this._animatables.length; index++) {
  769. var animatable = this._animatables[index];
  770. animatable.pause();
  771. }
  772. return this;
  773. };
  774. /**
  775. * Play all animations to initial state
  776. * This function will start() the animations if they were not started or will restart() them if they were paused
  777. * @param loop defines if animations must loop
  778. */
  779. AnimationGroup.prototype.play = function (loop) {
  780. if (this.isStarted) {
  781. if (loop !== undefined) {
  782. for (var index = 0; index < this._animatables.length; index++) {
  783. var animatable = this._animatables[index];
  784. animatable.loopAnimation = loop;
  785. }
  786. }
  787. this.restart();
  788. }
  789. else {
  790. this.start(loop, this._speedRatio);
  791. }
  792. return this;
  793. };
  794. /**
  795. * Reset all animations to initial state
  796. */
  797. AnimationGroup.prototype.reset = function () {
  798. if (!this._isStarted) {
  799. return this;
  800. }
  801. for (var index = 0; index < this._animatables.length; index++) {
  802. var animatable = this._animatables[index];
  803. animatable.reset();
  804. }
  805. return this;
  806. };
  807. /**
  808. * Restart animations from key 0
  809. */
  810. AnimationGroup.prototype.restart = function () {
  811. if (!this._isStarted) {
  812. return this;
  813. }
  814. for (var index = 0; index < this._animatables.length; index++) {
  815. var animatable = this._animatables[index];
  816. animatable.restart();
  817. }
  818. return this;
  819. };
  820. /**
  821. * Stop all animations
  822. */
  823. AnimationGroup.prototype.stop = function () {
  824. if (!this._isStarted) {
  825. return this;
  826. }
  827. for (var index = 0; index < this._animatables.length; index++) {
  828. var animatable = this._animatables[index];
  829. animatable.stop();
  830. }
  831. this._isStarted = false;
  832. return this;
  833. };
  834. /**
  835. * Dispose all associated resources
  836. */
  837. AnimationGroup.prototype.dispose = function () {
  838. this._targetedAnimations = [];
  839. this._animatables = [];
  840. var index = this._scene.animationGroups.indexOf(this);
  841. if (index > -1) {
  842. this._scene.animationGroups.splice(index, 1);
  843. }
  844. };
  845. return AnimationGroup;
  846. }());
  847. BABYLON.AnimationGroup = AnimationGroup;
  848. })(BABYLON || (BABYLON = {}));
  849. //# sourceMappingURL=babylon.animationGroup.js.map
  850. BABYLON.Effect.ShadersStore['defaultVertexShader'] = "#include<__decl__defaultVertex>\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef TANGENT\nattribute vec4 tangent;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n\n#include<instancesDeclaration>\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV == 0\nvarying vec2 vDiffuseUV;\n#endif\n#if defined(AMBIENT) && AMBIENTDIRECTUV == 0\nvarying vec2 vAmbientUV;\n#endif\n#if defined(OPACITY) && OPACITYDIRECTUV == 0\nvarying vec2 vOpacityUV;\n#endif\n#if defined(EMISSIVE) && EMISSIVEDIRECTUV == 0\nvarying vec2 vEmissiveUV;\n#endif\n#if defined(LIGHTMAP) && LIGHTMAPDIRECTUV == 0\nvarying vec2 vLightmapUV;\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM) && SPECULARDIRECTUV == 0\nvarying vec2 vSpecularUV;\n#endif\n#if defined(BUMP) && BUMPDIRECTUV == 0\nvarying vec2 vBumpUV;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<bumpVertexDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#include<logDepthDeclaration>\nvoid main(void) {\nvec3 positionUpdated=position;\n#ifdef NORMAL \nvec3 normalUpdated=normal;\n#endif\n#ifdef TANGENT\nvec4 tangentUpdated=tangent;\n#endif\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvPositionUVW=positionUpdated;\n#endif \n#include<instancesVertex>\n#include<bonesVertex>\ngl_Position=viewProjection*finalWorld*vec4(positionUpdated,1.0);\nvec4 worldPos=finalWorld*vec4(positionUpdated,1.0);\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nmat3 normalWorld=mat3(finalWorld);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvNormalW=normalize(normalWorld*normalUpdated);\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvDirectionW=normalize(vec3(finalWorld*vec4(positionUpdated,0.0)));\n#endif\n\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef MAINUV1\nvMainUV1=uv;\n#endif\n#ifdef MAINUV2\nvMainUV2=uv2;\n#endif\n#if defined(DIFFUSE) && DIFFUSEDIRECTUV == 0\nif (vDiffuseInfos.x == 0.)\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvDiffuseUV=vec2(diffuseMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(AMBIENT) && AMBIENTDIRECTUV == 0\nif (vAmbientInfos.x == 0.)\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvAmbientUV=vec2(ambientMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(OPACITY) && OPACITYDIRECTUV == 0\nif (vOpacityInfos.x == 0.)\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvOpacityUV=vec2(opacityMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(EMISSIVE) && EMISSIVEDIRECTUV == 0\nif (vEmissiveInfos.x == 0.)\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvEmissiveUV=vec2(emissiveMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(LIGHTMAP) && LIGHTMAPDIRECTUV == 0\nif (vLightmapInfos.x == 0.)\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvLightmapUV=vec2(lightmapMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM) && SPECULARDIRECTUV == 0\nif (vSpecularInfos.x == 0.)\n{\nvSpecularUV=vec2(specularMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvSpecularUV=vec2(specularMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#if defined(BUMP) && BUMPDIRECTUV == 0\nif (vBumpInfos.x == 0.)\n{\nvBumpUV=vec2(bumpMatrix*vec4(uv,1.0,0.0));\n}\nelse\n{\nvBumpUV=vec2(bumpMatrix*vec4(uv2,1.0,0.0));\n}\n#endif\n#include<bumpVertex>\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#ifdef VERTEXCOLOR\n\nvColor=color;\n#endif\n#include<pointCloudVertex>\n#include<logDepthVertex>\n}";
  851. BABYLON.Effect.ShadersStore['defaultPixelShader'] = "#include<__decl__defaultFragment>\n#if defined(BUMP) || !defined(NORMAL)\n#extension GL_OES_standard_derivatives : enable\n#endif\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n\n#define RECIPROCAL_PI2 0.15915494\nuniform vec3 vEyePosition;\nuniform vec3 vAmbientColor;\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#ifdef MAINUV1\nvarying vec2 vMainUV1;\n#endif\n#ifdef MAINUV2\nvarying vec2 vMainUV2;\n#endif\n\n#include<helperFunctions>\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n\n#ifdef DIFFUSE\n#if DIFFUSEDIRECTUV == 1\n#define vDiffuseUV vMainUV1\n#elif DIFFUSEDIRECTUV == 2\n#define vDiffuseUV vMainUV2\n#else\nvarying vec2 vDiffuseUV;\n#endif\nuniform sampler2D diffuseSampler;\n#endif\n#ifdef AMBIENT\n#if AMBIENTDIRECTUV == 1\n#define vAmbientUV vMainUV1\n#elif AMBIENTDIRECTUV == 2\n#define vAmbientUV vMainUV2\n#else\nvarying vec2 vAmbientUV;\n#endif\nuniform sampler2D ambientSampler;\n#endif\n#ifdef OPACITY \n#if OPACITYDIRECTUV == 1\n#define vOpacityUV vMainUV1\n#elif OPACITYDIRECTUV == 2\n#define vOpacityUV vMainUV2\n#else\nvarying vec2 vOpacityUV;\n#endif\nuniform sampler2D opacitySampler;\n#endif\n#ifdef EMISSIVE\n#if EMISSIVEDIRECTUV == 1\n#define vEmissiveUV vMainUV1\n#elif EMISSIVEDIRECTUV == 2\n#define vEmissiveUV vMainUV2\n#else\nvarying vec2 vEmissiveUV;\n#endif\nuniform sampler2D emissiveSampler;\n#endif\n#ifdef LIGHTMAP\n#if LIGHTMAPDIRECTUV == 1\n#define vLightmapUV vMainUV1\n#elif LIGHTMAPDIRECTUV == 2\n#define vLightmapUV vMainUV2\n#else\nvarying vec2 vLightmapUV;\n#endif\nuniform sampler2D lightmapSampler;\n#endif\n#ifdef REFRACTION\n#ifdef REFRACTIONMAP_3D\nuniform samplerCube refractionCubeSampler;\n#else\nuniform sampler2D refraction2DSampler;\n#endif\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\n#if SPECULARDIRECTUV == 1\n#define vSpecularUV vMainUV1\n#elif SPECULARDIRECTUV == 2\n#define vSpecularUV vMainUV2\n#else\nvarying vec2 vSpecularUV;\n#endif\nuniform sampler2D specularSampler;\n#endif\n\n#include<fresnelFunction>\n\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\nuniform samplerCube reflectionCubeSampler;\n#else\nuniform sampler2D reflection2DSampler;\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vec3 vPositionUVW;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vec3 vDirectionW;\n#endif\n#endif\n#include<reflectionFunction>\n#endif\n#include<imageProcessingDeclaration>\n#include<imageProcessingFunctions>\n#include<bumpFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nvoid main(void) {\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\nvec4 baseColor=vec4(1.,1.,1.,1.);\nvec3 diffuseColor=vDiffuseColor.rgb;\n\nfloat alpha=vDiffuseColor.a;\n\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=normalize(-cross(dFdx(vPositionW),dFdy(vPositionW)));\n#endif\n#include<bumpFragment>\n#ifdef TWOSIDEDLIGHTING\nnormalW=gl_FrontFacing ? normalW : -normalW;\n#endif\n#ifdef DIFFUSE\nbaseColor=texture2D(diffuseSampler,vDiffuseUV+uvOffset);\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#ifdef ALPHAFROMDIFFUSE\nalpha*=baseColor.a;\n#endif\nbaseColor.rgb*=vDiffuseInfos.y;\n#endif\n#include<depthPrePass>\n#ifdef VERTEXCOLOR\nbaseColor.rgb*=vColor.rgb;\n#endif\n\nvec3 baseAmbientColor=vec3(1.,1.,1.);\n#ifdef AMBIENT\nbaseAmbientColor=texture2D(ambientSampler,vAmbientUV+uvOffset).rgb*vAmbientInfos.y;\n#endif\n\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;\nvec3 specularColor=vSpecularColor.rgb;\n#ifdef SPECULAR\nvec4 specularMapColor=texture2D(specularSampler,vSpecularUV+uvOffset);\nspecularColor=specularMapColor.rgb;\n#ifdef GLOSSINESS\nglossiness=glossiness*specularMapColor.a;\n#endif\n#endif\n#else\nfloat glossiness=0.;\n#endif\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\nfloat shadow=1.;\n#ifdef LIGHTMAP\nvec3 lightmapColor=texture2D(lightmapSampler,vLightmapUV+uvOffset).rgb*vLightmapInfos.y;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n\nvec3 refractionColor=vec3(0.,0.,0.);\n#ifdef REFRACTION\nvec3 refractionVector=normalize(refract(-viewDirectionW,normalW,vRefractionInfos.y));\n#ifdef REFRACTIONMAP_3D\nrefractionVector.y=refractionVector.y*vRefractionInfos.w;\nif (dot(refractionVector,viewDirectionW)<1.0)\n{\nrefractionColor=textureCube(refractionCubeSampler,refractionVector).rgb*vRefractionInfos.x;\n}\n#else\nvec3 vRefractionUVW=vec3(refractionMatrix*(view*vec4(vPositionW+refractionVector*vRefractionInfos.z,1.0)));\nvec2 refractionCoords=vRefractionUVW.xy/vRefractionUVW.z;\nrefractionCoords.y=1.0-refractionCoords.y;\nrefractionColor=texture2D(refraction2DSampler,refractionCoords).rgb*vRefractionInfos.x;\n#endif\n#endif\n\nvec3 reflectionColor=vec3(0.,0.,0.);\n#ifdef REFLECTION\nvec3 vReflectionUVW=computeReflectionCoords(vec4(vPositionW,1.0),normalW);\n#ifdef REFLECTIONMAP_3D\n#ifdef ROUGHNESS\nfloat bias=vReflectionInfos.y;\n#ifdef SPECULARTERM\n#ifdef SPECULAR\n#ifdef GLOSSINESS\nbias*=(1.0-specularMapColor.a);\n#endif\n#endif\n#endif\nreflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW,bias).rgb*vReflectionInfos.x;\n#else\nreflectionColor=textureCube(reflectionCubeSampler,vReflectionUVW).rgb*vReflectionInfos.x;\n#endif\n#else\nvec2 coords=vReflectionUVW.xy;\n#ifdef REFLECTIONMAP_PROJECTION\ncoords/=vReflectionUVW.z;\n#endif\ncoords.y=1.0-coords.y;\nreflectionColor=texture2D(reflection2DSampler,coords).rgb*vReflectionInfos.x;\n#endif\n#ifdef REFLECTIONFRESNEL\nfloat reflectionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,reflectionRightColor.a,reflectionLeftColor.a);\n#ifdef REFLECTIONFRESNELFROMSPECULAR\n#ifdef SPECULARTERM\nreflectionColor*=specularColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#else\nreflectionColor*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#endif\n#else\nreflectionColor*=reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*reflectionRightColor.rgb;\n#endif\n#endif\n#endif\n#ifdef REFRACTIONFRESNEL\nfloat refractionFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,refractionRightColor.a,refractionLeftColor.a);\nrefractionColor*=refractionLeftColor.rgb*(1.0-refractionFresnelTerm)+refractionFresnelTerm*refractionRightColor.rgb;\n#endif\n#ifdef OPACITY\nvec4 opacityMap=texture2D(opacitySampler,vOpacityUV+uvOffset);\n#ifdef OPACITYRGB\nopacityMap.rgb=opacityMap.rgb*vec3(0.3,0.59,0.11);\nalpha*=(opacityMap.x+opacityMap.y+opacityMap.z)* vOpacityInfos.y;\n#else\nalpha*=opacityMap.a*vOpacityInfos.y;\n#endif\n#endif\n#ifdef VERTEXALPHA\nalpha*=vColor.a;\n#endif\n#ifdef OPACITYFRESNEL\nfloat opacityFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,opacityParts.z,opacityParts.w);\nalpha+=opacityParts.x*(1.0-opacityFresnelTerm)+opacityFresnelTerm*opacityParts.y;\n#endif\n\nvec3 emissiveColor=vEmissiveColor;\n#ifdef EMISSIVE\nemissiveColor+=texture2D(emissiveSampler,vEmissiveUV+uvOffset).rgb*vEmissiveInfos.y;\n#endif\n#ifdef EMISSIVEFRESNEL\nfloat emissiveFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,emissiveRightColor.a,emissiveLeftColor.a);\nemissiveColor*=emissiveLeftColor.rgb*(1.0-emissiveFresnelTerm)+emissiveFresnelTerm*emissiveRightColor.rgb;\n#endif\n\n#ifdef DIFFUSEFRESNEL\nfloat diffuseFresnelTerm=computeFresnelTerm(viewDirectionW,normalW,diffuseRightColor.a,diffuseLeftColor.a);\ndiffuseBase*=diffuseLeftColor.rgb*(1.0-diffuseFresnelTerm)+diffuseFresnelTerm*diffuseRightColor.rgb;\n#endif\n\n#ifdef EMISSIVEASILLUMINATION\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\n#else\n#ifdef LINKEMISSIVEWITHDIFFUSE\nvec3 finalDiffuse=clamp((diffuseBase+emissiveColor)*diffuseColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\n#else\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor+emissiveColor+vAmbientColor,0.0,1.0)*baseColor.rgb;\n#endif\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#ifdef SPECULAROVERALPHA\nalpha=clamp(alpha+dot(finalSpecular,vec3(0.3,0.59,0.11)),0.,1.);\n#endif\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\n#ifdef REFLECTIONOVERALPHA\nalpha=clamp(alpha+dot(reflectionColor,vec3(0.3,0.59,0.11)),0.,1.);\n#endif\n\n#ifdef EMISSIVEASILLUMINATION\nvec4 color=vec4(clamp(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor+emissiveColor+refractionColor,0.0,1.0),alpha);\n#else\nvec4 color=vec4(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor+refractionColor,alpha);\n#endif\n\n#ifdef LIGHTMAP\n#ifndef LIGHTMAPEXCLUDED\n#ifdef USELIGHTMAPASSHADOWMAP\ncolor.rgb*=lightmapColor;\n#else\ncolor.rgb+=lightmapColor;\n#endif\n#endif\n#endif\n#include<logDepthFragment>\n#include<fogFragment>\n\n\n#ifdef IMAGEPROCESSINGPOSTPROCESS\ncolor.rgb=toLinearSpace(color.rgb);\n#else\n#ifdef IMAGEPROCESSING\ncolor.rgb=toLinearSpace(color.rgb);\ncolor=applyImageProcessing(color);\n#endif\n#endif\n#ifdef PREMULTIPLYALPHA\n\ncolor.rgb*=color.a;\n#endif\ngl_FragColor=color;\n}";
  852. var BABYLON;
  853. (function (BABYLON) {
  854. var RuntimeAnimation = /** @class */ (function () {
  855. function RuntimeAnimation(target, animation) {
  856. this._offsetsCache = {};
  857. this._highLimitsCache = {};
  858. this._stopped = false;
  859. this._blendingFactor = 0;
  860. this._ratioOffset = 0;
  861. this._animation = animation;
  862. this._target = target;
  863. animation._runtimeAnimations.push(this);
  864. }
  865. Object.defineProperty(RuntimeAnimation.prototype, "animation", {
  866. get: function () {
  867. return this._animation;
  868. },
  869. enumerable: true,
  870. configurable: true
  871. });
  872. RuntimeAnimation.prototype.reset = function () {
  873. this._offsetsCache = {};
  874. this._highLimitsCache = {};
  875. this.currentFrame = 0;
  876. this._blendingFactor = 0;
  877. this._originalBlendValue = null;
  878. };
  879. RuntimeAnimation.prototype.isStopped = function () {
  880. return this._stopped;
  881. };
  882. RuntimeAnimation.prototype.dispose = function () {
  883. var index = this._animation.runtimeAnimations.indexOf(this);
  884. if (index > -1) {
  885. this._animation.runtimeAnimations.splice(index, 1);
  886. }
  887. };
  888. RuntimeAnimation.prototype._getKeyValue = function (value) {
  889. if (typeof value === "function") {
  890. return value();
  891. }
  892. return value;
  893. };
  894. RuntimeAnimation.prototype._interpolate = function (currentFrame, repeatCount, loopMode, offsetValue, highLimitValue) {
  895. if (loopMode === BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT && repeatCount > 0) {
  896. return highLimitValue.clone ? highLimitValue.clone() : highLimitValue;
  897. }
  898. this.currentFrame = currentFrame;
  899. var keys = this._animation.getKeys();
  900. // Try to get a hash to find the right key
  901. var startKeyIndex = Math.max(0, Math.min(keys.length - 1, Math.floor(keys.length * (currentFrame - keys[0].frame) / (keys[keys.length - 1].frame - keys[0].frame)) - 1));
  902. if (keys[startKeyIndex].frame >= currentFrame) {
  903. while (startKeyIndex - 1 >= 0 && keys[startKeyIndex].frame >= currentFrame) {
  904. startKeyIndex--;
  905. }
  906. }
  907. for (var key = startKeyIndex; key < keys.length; key++) {
  908. var endKey = keys[key + 1];
  909. if (endKey.frame >= currentFrame) {
  910. var startKey = keys[key];
  911. var startValue = this._getKeyValue(startKey.value);
  912. var endValue = this._getKeyValue(endKey.value);
  913. var useTangent = startKey.outTangent !== undefined && endKey.inTangent !== undefined;
  914. var frameDelta = endKey.frame - startKey.frame;
  915. // gradient : percent of currentFrame between the frame inf and the frame sup
  916. var gradient = (currentFrame - startKey.frame) / frameDelta;
  917. // check for easingFunction and correction of gradient
  918. var easingFunction = this._animation.getEasingFunction();
  919. if (easingFunction != null) {
  920. gradient = easingFunction.ease(gradient);
  921. }
  922. switch (this._animation.dataType) {
  923. // Float
  924. case BABYLON.Animation.ANIMATIONTYPE_FLOAT:
  925. var floatValue = useTangent ? this._animation.floatInterpolateFunctionWithTangents(startValue, startKey.outTangent * frameDelta, endValue, endKey.inTangent * frameDelta, gradient) : this._animation.floatInterpolateFunction(startValue, endValue, gradient);
  926. switch (loopMode) {
  927. case BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE:
  928. case BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT:
  929. return floatValue;
  930. case BABYLON.Animation.ANIMATIONLOOPMODE_RELATIVE:
  931. return offsetValue * repeatCount + floatValue;
  932. }
  933. break;
  934. // Quaternion
  935. case BABYLON.Animation.ANIMATIONTYPE_QUATERNION:
  936. var quatValue = useTangent ? this._animation.quaternionInterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient) : this._animation.quaternionInterpolateFunction(startValue, endValue, gradient);
  937. switch (loopMode) {
  938. case BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE:
  939. case BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT:
  940. return quatValue;
  941. case BABYLON.Animation.ANIMATIONLOOPMODE_RELATIVE:
  942. return quatValue.add(offsetValue.scale(repeatCount));
  943. }
  944. return quatValue;
  945. // Vector3
  946. case BABYLON.Animation.ANIMATIONTYPE_VECTOR3:
  947. var vec3Value = useTangent ? this._animation.vector3InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient) : this._animation.vector3InterpolateFunction(startValue, endValue, gradient);
  948. switch (loopMode) {
  949. case BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE:
  950. case BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT:
  951. return vec3Value;
  952. case BABYLON.Animation.ANIMATIONLOOPMODE_RELATIVE:
  953. return vec3Value.add(offsetValue.scale(repeatCount));
  954. }
  955. // Vector2
  956. case BABYLON.Animation.ANIMATIONTYPE_VECTOR2:
  957. var vec2Value = useTangent ? this._animation.vector2InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient) : this._animation.vector2InterpolateFunction(startValue, endValue, gradient);
  958. switch (loopMode) {
  959. case BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE:
  960. case BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT:
  961. return vec2Value;
  962. case BABYLON.Animation.ANIMATIONLOOPMODE_RELATIVE:
  963. return vec2Value.add(offsetValue.scale(repeatCount));
  964. }
  965. // Size
  966. case BABYLON.Animation.ANIMATIONTYPE_SIZE:
  967. switch (loopMode) {
  968. case BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE:
  969. case BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT:
  970. return this._animation.sizeInterpolateFunction(startValue, endValue, gradient);
  971. case BABYLON.Animation.ANIMATIONLOOPMODE_RELATIVE:
  972. return this._animation.sizeInterpolateFunction(startValue, endValue, gradient).add(offsetValue.scale(repeatCount));
  973. }
  974. // Color3
  975. case BABYLON.Animation.ANIMATIONTYPE_COLOR3:
  976. switch (loopMode) {
  977. case BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE:
  978. case BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT:
  979. return this._animation.color3InterpolateFunction(startValue, endValue, gradient);
  980. case BABYLON.Animation.ANIMATIONLOOPMODE_RELATIVE:
  981. return this._animation.color3InterpolateFunction(startValue, endValue, gradient).add(offsetValue.scale(repeatCount));
  982. }
  983. // Matrix
  984. case BABYLON.Animation.ANIMATIONTYPE_MATRIX:
  985. switch (loopMode) {
  986. case BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE:
  987. case BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT:
  988. if (BABYLON.Animation.AllowMatricesInterpolation) {
  989. return this._animation.matrixInterpolateFunction(startValue, endValue, gradient);
  990. }
  991. case BABYLON.Animation.ANIMATIONLOOPMODE_RELATIVE:
  992. return startValue;
  993. }
  994. default:
  995. break;
  996. }
  997. break;
  998. }
  999. }
  1000. return this._getKeyValue(keys[keys.length - 1].value);
  1001. };
  1002. RuntimeAnimation.prototype.setValue = function (currentValue, blend) {
  1003. if (blend === void 0) { blend = false; }
  1004. // Set value
  1005. var path;
  1006. var destination;
  1007. var targetPropertyPath = this._animation.targetPropertyPath;
  1008. if (targetPropertyPath.length > 1) {
  1009. var property = this._target[targetPropertyPath[0]];
  1010. for (var index = 1; index < targetPropertyPath.length - 1; index++) {
  1011. property = property[targetPropertyPath[index]];
  1012. }
  1013. path = targetPropertyPath[targetPropertyPath.length - 1];
  1014. destination = property;
  1015. }
  1016. else {
  1017. path = targetPropertyPath[0];
  1018. destination = this._target;
  1019. }
  1020. // Blending
  1021. if (this._animation.enableBlending && this._blendingFactor <= 1.0) {
  1022. if (!this._originalBlendValue) {
  1023. if (destination[path].clone) {
  1024. this._originalBlendValue = destination[path].clone();
  1025. }
  1026. else {
  1027. this._originalBlendValue = destination[path];
  1028. }
  1029. }
  1030. if (this._originalBlendValue.prototype) {
  1031. if (this._originalBlendValue.prototype.Lerp) {
  1032. destination[path] = this._originalBlendValue.construtor.prototype.Lerp(currentValue, this._originalBlendValue, this._blendingFactor);
  1033. }
  1034. else {
  1035. destination[path] = currentValue;
  1036. }
  1037. }
  1038. else if (this._originalBlendValue.m) {
  1039. destination[path] = BABYLON.Matrix.Lerp(this._originalBlendValue, currentValue, this._blendingFactor);
  1040. }
  1041. else {
  1042. destination[path] = this._originalBlendValue * (1.0 - this._blendingFactor) + this._blendingFactor * currentValue;
  1043. }
  1044. this._blendingFactor += this._animation.blendingSpeed;
  1045. }
  1046. else {
  1047. destination[path] = currentValue;
  1048. }
  1049. if (this._target.markAsDirty) {
  1050. this._target.markAsDirty(this._animation.targetProperty);
  1051. }
  1052. };
  1053. RuntimeAnimation.prototype.goToFrame = function (frame) {
  1054. var keys = this._animation.getKeys();
  1055. if (frame < keys[0].frame) {
  1056. frame = keys[0].frame;
  1057. }
  1058. else if (frame > keys[keys.length - 1].frame) {
  1059. frame = keys[keys.length - 1].frame;
  1060. }
  1061. var currentValue = this._interpolate(frame, 0, this._animation.loopMode);
  1062. this.setValue(currentValue);
  1063. };
  1064. RuntimeAnimation.prototype._prepareForSpeedRatioChange = function (newSpeedRatio) {
  1065. var newRatio = this._previousDelay * (this._animation.framePerSecond * newSpeedRatio) / 1000.0;
  1066. this._ratioOffset = this._previousRatio - newRatio;
  1067. };
  1068. RuntimeAnimation.prototype.animate = function (delay, from, to, loop, speedRatio, blend) {
  1069. if (blend === void 0) { blend = false; }
  1070. var targetPropertyPath = this._animation.targetPropertyPath;
  1071. if (!targetPropertyPath || targetPropertyPath.length < 1) {
  1072. this._stopped = true;
  1073. return false;
  1074. }
  1075. var returnValue = true;
  1076. var keys = this._animation.getKeys();
  1077. // Adding a start key at frame 0 if missing
  1078. if (keys[0].frame !== 0) {
  1079. var newKey = { frame: 0, value: keys[0].value };
  1080. keys.splice(0, 0, newKey);
  1081. }
  1082. // Check limits
  1083. if (from < keys[0].frame || from > keys[keys.length - 1].frame) {
  1084. from = keys[0].frame;
  1085. }
  1086. if (to < keys[0].frame || to > keys[keys.length - 1].frame) {
  1087. to = keys[keys.length - 1].frame;
  1088. }
  1089. //to and from cannot be the same key
  1090. if (from === to) {
  1091. if (from > keys[0].frame) {
  1092. from--;
  1093. }
  1094. else if (to < keys[keys.length - 1].frame) {
  1095. to++;
  1096. }
  1097. }
  1098. // Compute ratio
  1099. var range = to - from;
  1100. var offsetValue;
  1101. // ratio represents the frame delta between from and to
  1102. var ratio = (delay * (this._animation.framePerSecond * speedRatio) / 1000.0) + this._ratioOffset;
  1103. var highLimitValue = 0;
  1104. this._previousDelay = delay;
  1105. this._previousRatio = ratio;
  1106. if (((to > from && ratio > range) || (from > to && ratio < range)) && !loop) {
  1107. returnValue = false;
  1108. highLimitValue = this._getKeyValue(keys[keys.length - 1].value);
  1109. }
  1110. else {
  1111. // Get max value if required
  1112. if (this._animation.loopMode !== BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE) {
  1113. var keyOffset = to.toString() + from.toString();
  1114. if (!this._offsetsCache[keyOffset]) {
  1115. var fromValue = this._interpolate(from, 0, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
  1116. var toValue = this._interpolate(to, 0, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
  1117. switch (this._animation.dataType) {
  1118. // Float
  1119. case BABYLON.Animation.ANIMATIONTYPE_FLOAT:
  1120. this._offsetsCache[keyOffset] = toValue - fromValue;
  1121. break;
  1122. // Quaternion
  1123. case BABYLON.Animation.ANIMATIONTYPE_QUATERNION:
  1124. this._offsetsCache[keyOffset] = toValue.subtract(fromValue);
  1125. break;
  1126. // Vector3
  1127. case BABYLON.Animation.ANIMATIONTYPE_VECTOR3:
  1128. this._offsetsCache[keyOffset] = toValue.subtract(fromValue);
  1129. // Vector2
  1130. case BABYLON.Animation.ANIMATIONTYPE_VECTOR2:
  1131. this._offsetsCache[keyOffset] = toValue.subtract(fromValue);
  1132. // Size
  1133. case BABYLON.Animation.ANIMATIONTYPE_SIZE:
  1134. this._offsetsCache[keyOffset] = toValue.subtract(fromValue);
  1135. // Color3
  1136. case BABYLON.Animation.ANIMATIONTYPE_COLOR3:
  1137. this._offsetsCache[keyOffset] = toValue.subtract(fromValue);
  1138. default:
  1139. break;
  1140. }
  1141. this._highLimitsCache[keyOffset] = toValue;
  1142. }
  1143. highLimitValue = this._highLimitsCache[keyOffset];
  1144. offsetValue = this._offsetsCache[keyOffset];
  1145. }
  1146. }
  1147. if (offsetValue === undefined) {
  1148. switch (this._animation.dataType) {
  1149. // Float
  1150. case BABYLON.Animation.ANIMATIONTYPE_FLOAT:
  1151. offsetValue = 0;
  1152. break;
  1153. // Quaternion
  1154. case BABYLON.Animation.ANIMATIONTYPE_QUATERNION:
  1155. offsetValue = new BABYLON.Quaternion(0, 0, 0, 0);
  1156. break;
  1157. // Vector3
  1158. case BABYLON.Animation.ANIMATIONTYPE_VECTOR3:
  1159. offsetValue = BABYLON.Vector3.Zero();
  1160. break;
  1161. // Vector2
  1162. case BABYLON.Animation.ANIMATIONTYPE_VECTOR2:
  1163. offsetValue = BABYLON.Vector2.Zero();
  1164. break;
  1165. // Size
  1166. case BABYLON.Animation.ANIMATIONTYPE_SIZE:
  1167. offsetValue = BABYLON.Size.Zero();
  1168. break;
  1169. // Color3
  1170. case BABYLON.Animation.ANIMATIONTYPE_COLOR3:
  1171. offsetValue = BABYLON.Color3.Black();
  1172. }
  1173. }
  1174. // Compute value
  1175. var repeatCount = (ratio / range) >> 0;
  1176. var currentFrame = returnValue ? from + ratio % range : to;
  1177. var currentValue = this._interpolate(currentFrame, repeatCount, this._animation.loopMode, offsetValue, highLimitValue);
  1178. // Set value
  1179. this.setValue(currentValue);
  1180. // Check events
  1181. var events = this._animation.getEvents();
  1182. for (var index = 0; index < events.length; index++) {
  1183. // Make sure current frame has passed event frame and that event frame is within the current range
  1184. // Also, handle both forward and reverse animations
  1185. if ((range > 0 && currentFrame >= events[index].frame && events[index].frame >= from) ||
  1186. (range < 0 && currentFrame <= events[index].frame && events[index].frame <= from)) {
  1187. var event = events[index];
  1188. if (!event.isDone) {
  1189. // If event should be done only once, remove it.
  1190. if (event.onlyOnce) {
  1191. events.splice(index, 1);
  1192. index--;
  1193. }
  1194. event.isDone = true;
  1195. event.action();
  1196. } // Don't do anything if the event has already be done.
  1197. }
  1198. else if (events[index].isDone && !events[index].onlyOnce) {
  1199. // reset event, the animation is looping
  1200. events[index].isDone = false;
  1201. }
  1202. }
  1203. if (!returnValue) {
  1204. this._stopped = true;
  1205. }
  1206. return returnValue;
  1207. };
  1208. return RuntimeAnimation;
  1209. }());
  1210. BABYLON.RuntimeAnimation = RuntimeAnimation;
  1211. })(BABYLON || (BABYLON = {}));
  1212. //# sourceMappingURL=babylon.runtimeAnimation.js.map
  1213. var BABYLON;
  1214. (function (BABYLON) {
  1215. var Animatable = /** @class */ (function () {
  1216. function Animatable(scene, target, fromFrame, toFrame, loopAnimation, speedRatio, onAnimationEnd, animations) {
  1217. if (fromFrame === void 0) { fromFrame = 0; }
  1218. if (toFrame === void 0) { toFrame = 100; }
  1219. if (loopAnimation === void 0) { loopAnimation = false; }
  1220. if (speedRatio === void 0) { speedRatio = 1.0; }
  1221. this.target = target;
  1222. this.fromFrame = fromFrame;
  1223. this.toFrame = toFrame;
  1224. this.loopAnimation = loopAnimation;
  1225. this.onAnimationEnd = onAnimationEnd;
  1226. this._localDelayOffset = null;
  1227. this._pausedDelay = null;
  1228. this._runtimeAnimations = new Array();
  1229. this._paused = false;
  1230. this._speedRatio = 1;
  1231. this.animationStarted = false;
  1232. if (animations) {
  1233. this.appendAnimations(target, animations);
  1234. }
  1235. this._speedRatio = speedRatio;
  1236. this._scene = scene;
  1237. scene._activeAnimatables.push(this);
  1238. }
  1239. Object.defineProperty(Animatable.prototype, "speedRatio", {
  1240. get: function () {
  1241. return this._speedRatio;
  1242. },
  1243. set: function (value) {
  1244. for (var index = 0; index < this._runtimeAnimations.length; index++) {
  1245. var animation = this._runtimeAnimations[index];
  1246. animation._prepareForSpeedRatioChange(value);
  1247. }
  1248. this._speedRatio = value;
  1249. },
  1250. enumerable: true,
  1251. configurable: true
  1252. });
  1253. // Methods
  1254. Animatable.prototype.getAnimations = function () {
  1255. return this._runtimeAnimations;
  1256. };
  1257. Animatable.prototype.appendAnimations = function (target, animations) {
  1258. for (var index = 0; index < animations.length; index++) {
  1259. var animation = animations[index];
  1260. this._runtimeAnimations.push(new BABYLON.RuntimeAnimation(target, animation));
  1261. }
  1262. };
  1263. Animatable.prototype.getAnimationByTargetProperty = function (property) {
  1264. var runtimeAnimations = this._runtimeAnimations;
  1265. for (var index = 0; index < runtimeAnimations.length; index++) {
  1266. if (runtimeAnimations[index].animation.targetProperty === property) {
  1267. return runtimeAnimations[index].animation;
  1268. }
  1269. }
  1270. return null;
  1271. };
  1272. Animatable.prototype.getRuntimeAnimationByTargetProperty = function (property) {
  1273. var runtimeAnimations = this._runtimeAnimations;
  1274. for (var index = 0; index < runtimeAnimations.length; index++) {
  1275. if (runtimeAnimations[index].animation.targetProperty === property) {
  1276. return runtimeAnimations[index];
  1277. }
  1278. }
  1279. return null;
  1280. };
  1281. Animatable.prototype.reset = function () {
  1282. var runtimeAnimations = this._runtimeAnimations;
  1283. for (var index = 0; index < runtimeAnimations.length; index++) {
  1284. runtimeAnimations[index].reset();
  1285. }
  1286. // Reset to original value
  1287. for (index = 0; index < runtimeAnimations.length; index++) {
  1288. var animation = runtimeAnimations[index];
  1289. animation.animate(0, this.fromFrame, this.toFrame, false, this._speedRatio);
  1290. }
  1291. this._localDelayOffset = null;
  1292. this._pausedDelay = null;
  1293. };
  1294. Animatable.prototype.enableBlending = function (blendingSpeed) {
  1295. var runtimeAnimations = this._runtimeAnimations;
  1296. for (var index = 0; index < runtimeAnimations.length; index++) {
  1297. runtimeAnimations[index].animation.enableBlending = true;
  1298. runtimeAnimations[index].animation.blendingSpeed = blendingSpeed;
  1299. }
  1300. };
  1301. Animatable.prototype.disableBlending = function () {
  1302. var runtimeAnimations = this._runtimeAnimations;
  1303. for (var index = 0; index < runtimeAnimations.length; index++) {
  1304. runtimeAnimations[index].animation.enableBlending = false;
  1305. }
  1306. };
  1307. Animatable.prototype.goToFrame = function (frame) {
  1308. var runtimeAnimations = this._runtimeAnimations;
  1309. if (runtimeAnimations[0]) {
  1310. var fps = runtimeAnimations[0].animation.framePerSecond;
  1311. var currentFrame = runtimeAnimations[0].currentFrame;
  1312. var adjustTime = frame - currentFrame;
  1313. var delay = adjustTime * 1000 / fps;
  1314. if (this._localDelayOffset === null) {
  1315. this._localDelayOffset = 0;
  1316. }
  1317. this._localDelayOffset -= delay;
  1318. }
  1319. for (var index = 0; index < runtimeAnimations.length; index++) {
  1320. runtimeAnimations[index].goToFrame(frame);
  1321. }
  1322. };
  1323. Animatable.prototype.pause = function () {
  1324. if (this._paused) {
  1325. return;
  1326. }
  1327. this._paused = true;
  1328. };
  1329. Animatable.prototype.restart = function () {
  1330. this._paused = false;
  1331. };
  1332. Animatable.prototype.stop = function (animationName) {
  1333. if (animationName) {
  1334. var idx = this._scene._activeAnimatables.indexOf(this);
  1335. if (idx > -1) {
  1336. var runtimeAnimations = this._runtimeAnimations;
  1337. for (var index = runtimeAnimations.length - 1; index >= 0; index--) {
  1338. if (typeof animationName === "string" && runtimeAnimations[index].animation.name != animationName) {
  1339. continue;
  1340. }
  1341. runtimeAnimations[index].dispose();
  1342. runtimeAnimations.splice(index, 1);
  1343. }
  1344. if (runtimeAnimations.length == 0) {
  1345. this._scene._activeAnimatables.splice(idx, 1);
  1346. if (this.onAnimationEnd) {
  1347. this.onAnimationEnd();
  1348. }
  1349. }
  1350. }
  1351. }
  1352. else {
  1353. var index = this._scene._activeAnimatables.indexOf(this);
  1354. if (index > -1) {
  1355. this._scene._activeAnimatables.splice(index, 1);
  1356. var runtimeAnimations = this._runtimeAnimations;
  1357. for (var index = 0; index < runtimeAnimations.length; index++) {
  1358. runtimeAnimations[index].dispose();
  1359. }
  1360. if (this.onAnimationEnd) {
  1361. this.onAnimationEnd();
  1362. }
  1363. }
  1364. }
  1365. };
  1366. Animatable.prototype._animate = function (delay) {
  1367. if (this._paused) {
  1368. this.animationStarted = false;
  1369. if (this._pausedDelay === null) {
  1370. this._pausedDelay = delay;
  1371. }
  1372. return true;
  1373. }
  1374. if (this._localDelayOffset === null) {
  1375. this._localDelayOffset = delay;
  1376. }
  1377. else if (this._pausedDelay !== null) {
  1378. this._localDelayOffset += delay - this._pausedDelay;
  1379. this._pausedDelay = null;
  1380. }
  1381. // Animating
  1382. var running = false;
  1383. var runtimeAnimations = this._runtimeAnimations;
  1384. var index;
  1385. for (index = 0; index < runtimeAnimations.length; index++) {
  1386. var animation = runtimeAnimations[index];
  1387. var isRunning = animation.animate(delay - this._localDelayOffset, this.fromFrame, this.toFrame, this.loopAnimation, this._speedRatio);
  1388. running = running || isRunning;
  1389. }
  1390. this.animationStarted = running;
  1391. if (!running) {
  1392. // Remove from active animatables
  1393. index = this._scene._activeAnimatables.indexOf(this);
  1394. this._scene._activeAnimatables.splice(index, 1);
  1395. // Dispose all runtime animations
  1396. for (index = 0; index < runtimeAnimations.length; index++) {
  1397. runtimeAnimations[index].dispose();
  1398. }
  1399. }
  1400. if (!running && this.onAnimationEnd) {
  1401. this.onAnimationEnd();
  1402. this.onAnimationEnd = null;
  1403. }
  1404. return running;
  1405. };
  1406. return Animatable;
  1407. }());
  1408. BABYLON.Animatable = Animatable;
  1409. })(BABYLON || (BABYLON = {}));
  1410. //# sourceMappingURL=babylon.animatable.js.map
  1411. var BABYLON;
  1412. (function (BABYLON) {
  1413. var EasingFunction = /** @class */ (function () {
  1414. function EasingFunction() {
  1415. // Properties
  1416. this._easingMode = EasingFunction.EASINGMODE_EASEIN;
  1417. }
  1418. Object.defineProperty(EasingFunction, "EASINGMODE_EASEIN", {
  1419. get: function () {
  1420. return EasingFunction._EASINGMODE_EASEIN;
  1421. },
  1422. enumerable: true,
  1423. configurable: true
  1424. });
  1425. Object.defineProperty(EasingFunction, "EASINGMODE_EASEOUT", {
  1426. get: function () {
  1427. return EasingFunction._EASINGMODE_EASEOUT;
  1428. },
  1429. enumerable: true,
  1430. configurable: true
  1431. });
  1432. Object.defineProperty(EasingFunction, "EASINGMODE_EASEINOUT", {
  1433. get: function () {
  1434. return EasingFunction._EASINGMODE_EASEINOUT;
  1435. },
  1436. enumerable: true,
  1437. configurable: true
  1438. });
  1439. EasingFunction.prototype.setEasingMode = function (easingMode) {
  1440. var n = Math.min(Math.max(easingMode, 0), 2);
  1441. this._easingMode = n;
  1442. };
  1443. EasingFunction.prototype.getEasingMode = function () {
  1444. return this._easingMode;
  1445. };
  1446. EasingFunction.prototype.easeInCore = function (gradient) {
  1447. throw new Error('You must implement this method');
  1448. };
  1449. EasingFunction.prototype.ease = function (gradient) {
  1450. switch (this._easingMode) {
  1451. case EasingFunction.EASINGMODE_EASEIN:
  1452. return this.easeInCore(gradient);
  1453. case EasingFunction.EASINGMODE_EASEOUT:
  1454. return (1 - this.easeInCore(1 - gradient));
  1455. }
  1456. if (gradient >= 0.5) {
  1457. return (((1 - this.easeInCore((1 - gradient) * 2)) * 0.5) + 0.5);
  1458. }
  1459. return (this.easeInCore(gradient * 2) * 0.5);
  1460. };
  1461. //Statics
  1462. EasingFunction._EASINGMODE_EASEIN = 0;
  1463. EasingFunction._EASINGMODE_EASEOUT = 1;
  1464. EasingFunction._EASINGMODE_EASEINOUT = 2;
  1465. return EasingFunction;
  1466. }());
  1467. BABYLON.EasingFunction = EasingFunction;
  1468. var CircleEase = /** @class */ (function (_super) {
  1469. __extends(CircleEase, _super);
  1470. function CircleEase() {
  1471. return _super !== null && _super.apply(this, arguments) || this;
  1472. }
  1473. CircleEase.prototype.easeInCore = function (gradient) {
  1474. gradient = Math.max(0, Math.min(1, gradient));
  1475. return (1.0 - Math.sqrt(1.0 - (gradient * gradient)));
  1476. };
  1477. return CircleEase;
  1478. }(EasingFunction));
  1479. BABYLON.CircleEase = CircleEase;
  1480. var BackEase = /** @class */ (function (_super) {
  1481. __extends(BackEase, _super);
  1482. function BackEase(amplitude) {
  1483. if (amplitude === void 0) { amplitude = 1; }
  1484. var _this = _super.call(this) || this;
  1485. _this.amplitude = amplitude;
  1486. return _this;
  1487. }
  1488. BackEase.prototype.easeInCore = function (gradient) {
  1489. var num = Math.max(0, this.amplitude);
  1490. return (Math.pow(gradient, 3.0) - ((gradient * num) * Math.sin(3.1415926535897931 * gradient)));
  1491. };
  1492. return BackEase;
  1493. }(EasingFunction));
  1494. BABYLON.BackEase = BackEase;
  1495. var BounceEase = /** @class */ (function (_super) {
  1496. __extends(BounceEase, _super);
  1497. function BounceEase(bounces, bounciness) {
  1498. if (bounces === void 0) { bounces = 3; }
  1499. if (bounciness === void 0) { bounciness = 2; }
  1500. var _this = _super.call(this) || this;
  1501. _this.bounces = bounces;
  1502. _this.bounciness = bounciness;
  1503. return _this;
  1504. }
  1505. BounceEase.prototype.easeInCore = function (gradient) {
  1506. var y = Math.max(0.0, this.bounces);
  1507. var bounciness = this.bounciness;
  1508. if (bounciness <= 1.0) {
  1509. bounciness = 1.001;
  1510. }
  1511. var num9 = Math.pow(bounciness, y);
  1512. var num5 = 1.0 - bounciness;
  1513. var num4 = ((1.0 - num9) / num5) + (num9 * 0.5);
  1514. var num15 = gradient * num4;
  1515. var num65 = Math.log((-num15 * (1.0 - bounciness)) + 1.0) / Math.log(bounciness);
  1516. var num3 = Math.floor(num65);
  1517. var num13 = num3 + 1.0;
  1518. var num8 = (1.0 - Math.pow(bounciness, num3)) / (num5 * num4);
  1519. var num12 = (1.0 - Math.pow(bounciness, num13)) / (num5 * num4);
  1520. var num7 = (num8 + num12) * 0.5;
  1521. var num6 = gradient - num7;
  1522. var num2 = num7 - num8;
  1523. return (((-Math.pow(1.0 / bounciness, y - num3) / (num2 * num2)) * (num6 - num2)) * (num6 + num2));
  1524. };
  1525. return BounceEase;
  1526. }(EasingFunction));
  1527. BABYLON.BounceEase = BounceEase;
  1528. var CubicEase = /** @class */ (function (_super) {
  1529. __extends(CubicEase, _super);
  1530. function CubicEase() {
  1531. return _super !== null && _super.apply(this, arguments) || this;
  1532. }
  1533. CubicEase.prototype.easeInCore = function (gradient) {
  1534. return (gradient * gradient * gradient);
  1535. };
  1536. return CubicEase;
  1537. }(EasingFunction));
  1538. BABYLON.CubicEase = CubicEase;
  1539. var ElasticEase = /** @class */ (function (_super) {
  1540. __extends(ElasticEase, _super);
  1541. function ElasticEase(oscillations, springiness) {
  1542. if (oscillations === void 0) { oscillations = 3; }
  1543. if (springiness === void 0) { springiness = 3; }
  1544. var _this = _super.call(this) || this;
  1545. _this.oscillations = oscillations;
  1546. _this.springiness = springiness;
  1547. return _this;
  1548. }
  1549. ElasticEase.prototype.easeInCore = function (gradient) {
  1550. var num2;
  1551. var num3 = Math.max(0.0, this.oscillations);
  1552. var num = Math.max(0.0, this.springiness);
  1553. if (num == 0) {
  1554. num2 = gradient;
  1555. }
  1556. else {
  1557. num2 = (Math.exp(num * gradient) - 1.0) / (Math.exp(num) - 1.0);
  1558. }
  1559. return (num2 * Math.sin(((6.2831853071795862 * num3) + 1.5707963267948966) * gradient));
  1560. };
  1561. return ElasticEase;
  1562. }(EasingFunction));
  1563. BABYLON.ElasticEase = ElasticEase;
  1564. var ExponentialEase = /** @class */ (function (_super) {
  1565. __extends(ExponentialEase, _super);
  1566. function ExponentialEase(exponent) {
  1567. if (exponent === void 0) { exponent = 2; }
  1568. var _this = _super.call(this) || this;
  1569. _this.exponent = exponent;
  1570. return _this;
  1571. }
  1572. ExponentialEase.prototype.easeInCore = function (gradient) {
  1573. if (this.exponent <= 0) {
  1574. return gradient;
  1575. }
  1576. return ((Math.exp(this.exponent * gradient) - 1.0) / (Math.exp(this.exponent) - 1.0));
  1577. };
  1578. return ExponentialEase;
  1579. }(EasingFunction));
  1580. BABYLON.ExponentialEase = ExponentialEase;
  1581. var PowerEase = /** @class */ (function (_super) {
  1582. __extends(PowerEase, _super);
  1583. function PowerEase(power) {
  1584. if (power === void 0) { power = 2; }
  1585. var _this = _super.call(this) || this;
  1586. _this.power = power;
  1587. return _this;
  1588. }
  1589. PowerEase.prototype.easeInCore = function (gradient) {
  1590. var y = Math.max(0.0, this.power);
  1591. return Math.pow(gradient, y);
  1592. };
  1593. return PowerEase;
  1594. }(EasingFunction));
  1595. BABYLON.PowerEase = PowerEase;
  1596. var QuadraticEase = /** @class */ (function (_super) {
  1597. __extends(QuadraticEase, _super);
  1598. function QuadraticEase() {
  1599. return _super !== null && _super.apply(this, arguments) || this;
  1600. }
  1601. QuadraticEase.prototype.easeInCore = function (gradient) {
  1602. return (gradient * gradient);
  1603. };
  1604. return QuadraticEase;
  1605. }(EasingFunction));
  1606. BABYLON.QuadraticEase = QuadraticEase;
  1607. var QuarticEase = /** @class */ (function (_super) {
  1608. __extends(QuarticEase, _super);
  1609. function QuarticEase() {
  1610. return _super !== null && _super.apply(this, arguments) || this;
  1611. }
  1612. QuarticEase.prototype.easeInCore = function (gradient) {
  1613. return (gradient * gradient * gradient * gradient);
  1614. };
  1615. return QuarticEase;
  1616. }(EasingFunction));
  1617. BABYLON.QuarticEase = QuarticEase;
  1618. var QuinticEase = /** @class */ (function (_super) {
  1619. __extends(QuinticEase, _super);
  1620. function QuinticEase() {
  1621. return _super !== null && _super.apply(this, arguments) || this;
  1622. }
  1623. QuinticEase.prototype.easeInCore = function (gradient) {
  1624. return (gradient * gradient * gradient * gradient * gradient);
  1625. };
  1626. return QuinticEase;
  1627. }(EasingFunction));
  1628. BABYLON.QuinticEase = QuinticEase;
  1629. var SineEase = /** @class */ (function (_super) {
  1630. __extends(SineEase, _super);
  1631. function SineEase() {
  1632. return _super !== null && _super.apply(this, arguments) || this;
  1633. }
  1634. SineEase.prototype.easeInCore = function (gradient) {
  1635. return (1.0 - Math.sin(1.5707963267948966 * (1.0 - gradient)));
  1636. };
  1637. return SineEase;
  1638. }(EasingFunction));
  1639. BABYLON.SineEase = SineEase;
  1640. var BezierCurveEase = /** @class */ (function (_super) {
  1641. __extends(BezierCurveEase, _super);
  1642. function BezierCurveEase(x1, y1, x2, y2) {
  1643. if (x1 === void 0) { x1 = 0; }
  1644. if (y1 === void 0) { y1 = 0; }
  1645. if (x2 === void 0) { x2 = 1; }
  1646. if (y2 === void 0) { y2 = 1; }
  1647. var _this = _super.call(this) || this;
  1648. _this.x1 = x1;
  1649. _this.y1 = y1;
  1650. _this.x2 = x2;
  1651. _this.y2 = y2;
  1652. return _this;
  1653. }
  1654. BezierCurveEase.prototype.easeInCore = function (gradient) {
  1655. return BABYLON.BezierCurve.interpolate(gradient, this.x1, this.y1, this.x2, this.y2);
  1656. };
  1657. return BezierCurveEase;
  1658. }(EasingFunction));
  1659. BABYLON.BezierCurveEase = BezierCurveEase;
  1660. })(BABYLON || (BABYLON = {}));
  1661. //# sourceMappingURL=babylon.easing.js.map
  1662. BABYLON.Effect.IncludesShadersStore['depthPrePass'] = "#ifdef DEPTHPREPASS\ngl_FragColor=vec4(0.,0.,0.,1.0);\nreturn;\n#endif";
  1663. BABYLON.Effect.IncludesShadersStore['bonesDeclaration'] = "#if NUM_BONE_INFLUENCERS>0\nuniform mat4 mBones[BonesPerMesh];\nattribute vec4 matricesIndices;\nattribute vec4 matricesWeights;\n#if NUM_BONE_INFLUENCERS>4\nattribute vec4 matricesIndicesExtra;\nattribute vec4 matricesWeightsExtra;\n#endif\n#endif";
  1664. BABYLON.Effect.IncludesShadersStore['instancesDeclaration'] = "#ifdef INSTANCES\nattribute vec4 world0;\nattribute vec4 world1;\nattribute vec4 world2;\nattribute vec4 world3;\n#else\nuniform mat4 world;\n#endif";
  1665. BABYLON.Effect.IncludesShadersStore['pointCloudVertexDeclaration'] = "#ifdef POINTSIZE\nuniform float pointSize;\n#endif";
  1666. BABYLON.Effect.IncludesShadersStore['bumpVertexDeclaration'] = "#if defined(BUMP) || defined(PARALLAX)\n#if defined(TANGENT) && defined(NORMAL) \nvarying mat3 vTBN;\n#endif\n#endif\n";
  1667. BABYLON.Effect.IncludesShadersStore['clipPlaneVertexDeclaration'] = "#ifdef CLIPPLANE\nuniform vec4 vClipPlane;\nvarying float fClipDistance;\n#endif";
  1668. BABYLON.Effect.IncludesShadersStore['fogVertexDeclaration'] = "#ifdef FOG\nvarying vec3 vFogDistance;\n#endif";
  1669. BABYLON.Effect.IncludesShadersStore['morphTargetsVertexGlobalDeclaration'] = "#ifdef MORPHTARGETS\nuniform float morphTargetInfluences[NUM_MORPH_INFLUENCERS];\n#endif";
  1670. BABYLON.Effect.IncludesShadersStore['morphTargetsVertexDeclaration'] = "#ifdef MORPHTARGETS\nattribute vec3 position{X};\n#ifdef MORPHTARGETS_NORMAL\nattribute vec3 normal{X};\n#endif\n#ifdef MORPHTARGETS_TANGENT\nattribute vec3 tangent{X};\n#endif\n#endif";
  1671. BABYLON.Effect.IncludesShadersStore['logDepthDeclaration'] = "#ifdef LOGARITHMICDEPTH\nuniform float logarithmicDepthConstant;\nvarying float vFragmentDepth;\n#endif";
  1672. BABYLON.Effect.IncludesShadersStore['morphTargetsVertex'] = "#ifdef MORPHTARGETS\npositionUpdated+=(position{X}-position)*morphTargetInfluences[{X}];\n#ifdef MORPHTARGETS_NORMAL\nnormalUpdated+=(normal{X}-normal)*morphTargetInfluences[{X}];\n#endif\n#ifdef MORPHTARGETS_TANGENT\ntangentUpdated.xyz+=(tangent{X}-tangent.xyz)*morphTargetInfluences[{X}];\n#endif\n#endif";
  1673. BABYLON.Effect.IncludesShadersStore['instancesVertex'] = "#ifdef INSTANCES\nmat4 finalWorld=mat4(world0,world1,world2,world3);\n#else\nmat4 finalWorld=world;\n#endif";
  1674. BABYLON.Effect.IncludesShadersStore['bonesVertex'] = "#if NUM_BONE_INFLUENCERS>0\nmat4 influence;\ninfluence=mBones[int(matricesIndices[0])]*matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence+=mBones[int(matricesIndices[1])]*matricesWeights[1];\n#endif \n#if NUM_BONE_INFLUENCERS>2\ninfluence+=mBones[int(matricesIndices[2])]*matricesWeights[2];\n#endif \n#if NUM_BONE_INFLUENCERS>3\ninfluence+=mBones[int(matricesIndices[3])]*matricesWeights[3];\n#endif \n#if NUM_BONE_INFLUENCERS>4\ninfluence+=mBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];\n#endif \n#if NUM_BONE_INFLUENCERS>5\ninfluence+=mBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];\n#endif \n#if NUM_BONE_INFLUENCERS>6\ninfluence+=mBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];\n#endif \n#if NUM_BONE_INFLUENCERS>7\ninfluence+=mBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];\n#endif \nfinalWorld=finalWorld*influence;\n#endif";
  1675. BABYLON.Effect.IncludesShadersStore['bumpVertex'] = "#if defined(BUMP) || defined(PARALLAX)\n#if defined(TANGENT) && defined(NORMAL)\nvec3 tbnNormal=normalize(normalUpdated);\nvec3 tbnTangent=normalize(tangentUpdated.xyz);\nvec3 tbnBitangent=cross(tbnNormal,tbnTangent)*tangentUpdated.w;\nvTBN=mat3(finalWorld)*mat3(tbnTangent,tbnBitangent,tbnNormal);\n#endif\n#endif";
  1676. BABYLON.Effect.IncludesShadersStore['clipPlaneVertex'] = "#ifdef CLIPPLANE\nfClipDistance=dot(worldPos,vClipPlane);\n#endif";
  1677. BABYLON.Effect.IncludesShadersStore['fogVertex'] = "#ifdef FOG\nvFogDistance=(view*worldPos).xyz;\n#endif";
  1678. BABYLON.Effect.IncludesShadersStore['shadowsVertex'] = "#ifdef SHADOWS\n#if defined(SHADOW{X}) && !defined(SHADOWCUBE{X})\nvPositionFromLight{X}=lightMatrix{X}*worldPos;\nvDepthMetric{X}=((vPositionFromLight{X}.z+light{X}.depthValues.x)/(light{X}.depthValues.y));\n#endif\n#endif";
  1679. BABYLON.Effect.IncludesShadersStore['pointCloudVertex'] = "#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif";
  1680. BABYLON.Effect.IncludesShadersStore['logDepthVertex'] = "#ifdef LOGARITHMICDEPTH\nvFragmentDepth=1.0+gl_Position.w;\ngl_Position.z=log2(max(0.000001,vFragmentDepth))*logarithmicDepthConstant;\n#endif";
  1681. BABYLON.Effect.IncludesShadersStore['helperFunctions'] = "const float PI=3.1415926535897932384626433832795;\nconst float LinearEncodePowerApprox=2.2;\nconst float GammaEncodePowerApprox=1.0/LinearEncodePowerApprox;\nconst vec3 LuminanceEncodeApprox=vec3(0.2126,0.7152,0.0722);\nmat3 transposeMat3(mat3 inMatrix) {\nvec3 i0=inMatrix[0];\nvec3 i1=inMatrix[1];\nvec3 i2=inMatrix[2];\nmat3 outMatrix=mat3(\nvec3(i0.x,i1.x,i2.x),\nvec3(i0.y,i1.y,i2.y),\nvec3(i0.z,i1.z,i2.z)\n);\nreturn outMatrix;\n}\n\nmat3 inverseMat3(mat3 inMatrix) {\nfloat a00=inMatrix[0][0],a01=inMatrix[0][1],a02=inMatrix[0][2];\nfloat a10=inMatrix[1][0],a11=inMatrix[1][1],a12=inMatrix[1][2];\nfloat a20=inMatrix[2][0],a21=inMatrix[2][1],a22=inMatrix[2][2];\nfloat b01=a22*a11-a12*a21;\nfloat b11=-a22*a10+a12*a20;\nfloat b21=a21*a10-a11*a20;\nfloat det=a00*b01+a01*b11+a02*b21;\nreturn mat3(b01,(-a22*a01+a02*a21),(a12*a01-a02*a11),\nb11,(a22*a00-a02*a20),(-a12*a00+a02*a10),\nb21,(-a21*a00+a01*a20),(a11*a00-a01*a10))/det;\n}\nfloat computeFallOff(float value,vec2 clipSpace,float frustumEdgeFalloff)\n{\nfloat mask=smoothstep(1.0-frustumEdgeFalloff,1.0,clamp(dot(clipSpace,clipSpace),0.,1.));\nreturn mix(value,1.0,mask);\n}\nvec3 applyEaseInOut(vec3 x){\nreturn x*x*(3.0-2.0*x);\n}\nvec3 toLinearSpace(vec3 color)\n{\nreturn pow(color,vec3(LinearEncodePowerApprox));\n}\nvec3 toGammaSpace(vec3 color)\n{\nreturn pow(color,vec3(GammaEncodePowerApprox));\n}\nfloat square(float value)\n{\nreturn value*value;\n}\nfloat getLuminance(vec3 color)\n{\nreturn clamp(dot(color,LuminanceEncodeApprox),0.,1.);\n}\n\nfloat getRand(vec2 seed) {\nreturn fract(sin(dot(seed.xy ,vec2(12.9898,78.233)))*43758.5453);\n}\nvec3 dither(vec2 seed,vec3 color) {\nfloat rand=getRand(seed);\ncolor+=mix(-0.5/255.0,0.5/255.0,rand);\ncolor=max(color,0.0);\nreturn color;\n}";
  1682. BABYLON.Effect.IncludesShadersStore['lightFragmentDeclaration'] = "#ifdef LIGHT{X}\nuniform vec4 vLightData{X};\nuniform vec4 vLightDiffuse{X};\n#ifdef SPECULARTERM\nuniform vec3 vLightSpecular{X};\n#else\nvec3 vLightSpecular{X}=vec3(0.);\n#endif\n#ifdef SHADOW{X}\n#if defined(SHADOWCUBE{X})\nuniform samplerCube shadowSampler{X};\n#else\nvarying vec4 vPositionFromLight{X};\nvarying float vDepthMetric{X};\nuniform sampler2D shadowSampler{X};\nuniform mat4 lightMatrix{X};\n#endif\nuniform vec4 shadowsInfo{X};\nuniform vec2 depthValues{X};\n#endif\n#ifdef SPOTLIGHT{X}\nuniform vec4 vLightDirection{X};\n#endif\n#ifdef HEMILIGHT{X}\nuniform vec3 vLightGround{X};\n#endif\n#endif";
  1683. BABYLON.Effect.IncludesShadersStore['lightsFragmentFunctions'] = "\nstruct lightingInfo\n{\nvec3 diffuse;\n#ifdef SPECULARTERM\nvec3 specular;\n#endif\n#ifdef NDOTL\nfloat ndl;\n#endif\n};\nlightingInfo computeLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {\nlightingInfo result;\nvec3 lightVectorW;\nfloat attenuation=1.0;\nif (lightData.w == 0.)\n{\nvec3 direction=lightData.xyz-vPositionW;\nattenuation=max(0.,1.0-length(direction)/range);\nlightVectorW=normalize(direction);\n}\nelse\n{\nlightVectorW=normalize(-lightData.xyz);\n}\n\nfloat ndl=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\n\nvec3 angleW=normalize(viewDirectionW+lightVectorW);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;\n}\nlightingInfo computeSpotLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec4 lightDirection,vec3 diffuseColor,vec3 specularColor,float range,float glossiness) {\nlightingInfo result;\nvec3 direction=lightData.xyz-vPositionW;\nvec3 lightVectorW=normalize(direction);\nfloat attenuation=max(0.,1.0-length(direction)/range);\n\nfloat cosAngle=max(0.,dot(lightDirection.xyz,-lightVectorW));\nif (cosAngle>=lightDirection.w)\n{\ncosAngle=max(0.,pow(cosAngle,lightData.w));\nattenuation*=cosAngle;\n\nfloat ndl=max(0.,dot(vNormal,lightVectorW));\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=ndl*diffuseColor*attenuation;\n#ifdef SPECULARTERM\n\nvec3 angleW=normalize(viewDirectionW+lightVectorW);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor*attenuation;\n#endif\nreturn result;\n}\nresult.diffuse=vec3(0.);\n#ifdef SPECULARTERM\nresult.specular=vec3(0.);\n#endif\n#ifdef NDOTL\nresult.ndl=0.;\n#endif\nreturn result;\n}\nlightingInfo computeHemisphericLighting(vec3 viewDirectionW,vec3 vNormal,vec4 lightData,vec3 diffuseColor,vec3 specularColor,vec3 groundColor,float glossiness) {\nlightingInfo result;\n\nfloat ndl=dot(vNormal,lightData.xyz)*0.5+0.5;\n#ifdef NDOTL\nresult.ndl=ndl;\n#endif\nresult.diffuse=mix(groundColor,diffuseColor,ndl);\n#ifdef SPECULARTERM\n\nvec3 angleW=normalize(viewDirectionW+lightData.xyz);\nfloat specComp=max(0.,dot(vNormal,angleW));\nspecComp=pow(specComp,max(1.,glossiness));\nresult.specular=specComp*specularColor;\n#endif\nreturn result;\n}\n";
  1684. BABYLON.Effect.IncludesShadersStore['lightUboDeclaration'] = "#ifdef LIGHT{X}\nuniform Light{X}\n{\nvec4 vLightData;\nvec4 vLightDiffuse;\nvec3 vLightSpecular;\n#ifdef SPOTLIGHT{X}\nvec4 vLightDirection;\n#endif\n#ifdef HEMILIGHT{X}\nvec3 vLightGround;\n#endif\nvec4 shadowsInfo;\nvec2 depthValues;\n} light{X};\n#ifdef SHADOW{X}\n#if defined(SHADOWCUBE{X})\nuniform samplerCube shadowSampler{X};\n#else\nvarying vec4 vPositionFromLight{X};\nvarying float vDepthMetric{X};\nuniform sampler2D shadowSampler{X};\nuniform mat4 lightMatrix{X};\n#endif\n#endif\n#endif";
  1685. BABYLON.Effect.IncludesShadersStore['defaultVertexDeclaration'] = "\nuniform mat4 viewProjection;\nuniform mat4 view;\n#ifdef DIFFUSE\nuniform mat4 diffuseMatrix;\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef AMBIENT\nuniform mat4 ambientMatrix;\nuniform vec2 vAmbientInfos;\n#endif\n#ifdef OPACITY\nuniform mat4 opacityMatrix;\nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\nuniform mat4 emissiveMatrix;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\nuniform mat4 lightmapMatrix;\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\nuniform vec2 vSpecularInfos;\nuniform mat4 specularMatrix;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform mat4 bumpMatrix;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n";
  1686. BABYLON.Effect.IncludesShadersStore['defaultFragmentDeclaration'] = "uniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nuniform vec3 vEmissiveColor;\n\n#ifdef DIFFUSE\nuniform vec2 vDiffuseInfos;\n#endif\n#ifdef AMBIENT\nuniform vec2 vAmbientInfos;\n#endif\n#ifdef OPACITY \nuniform vec2 vOpacityInfos;\n#endif\n#ifdef EMISSIVE\nuniform vec2 vEmissiveInfos;\n#endif\n#ifdef LIGHTMAP\nuniform vec2 vLightmapInfos;\n#endif\n#ifdef BUMP\nuniform vec3 vBumpInfos;\nuniform vec2 vTangentSpaceParams;\n#endif\n#if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION)\nuniform mat4 view;\n#endif\n#ifdef REFRACTION\nuniform vec4 vRefractionInfos;\n#ifndef REFRACTIONMAP_3D\nuniform mat4 refractionMatrix;\n#endif\n#ifdef REFRACTIONFRESNEL\nuniform vec4 refractionLeftColor;\nuniform vec4 refractionRightColor;\n#endif\n#endif\n#if defined(SPECULAR) && defined(SPECULARTERM)\nuniform vec2 vSpecularInfos;\n#endif\n#ifdef DIFFUSEFRESNEL\nuniform vec4 diffuseLeftColor;\nuniform vec4 diffuseRightColor;\n#endif\n#ifdef OPACITYFRESNEL\nuniform vec4 opacityParts;\n#endif\n#ifdef EMISSIVEFRESNEL\nuniform vec4 emissiveLeftColor;\nuniform vec4 emissiveRightColor;\n#endif\n\n#ifdef REFLECTION\nuniform vec2 vReflectionInfos;\n#ifdef REFLECTIONMAP_SKYBOX\n#else\n#if defined(REFLECTIONMAP_PLANAR) || defined(REFLECTIONMAP_CUBIC) || defined(REFLECTIONMAP_PROJECTION)\nuniform mat4 reflectionMatrix;\n#endif\n#endif\n#ifdef REFLECTIONFRESNEL\nuniform vec4 reflectionLeftColor;\nuniform vec4 reflectionRightColor;\n#endif\n#endif";
  1687. BABYLON.Effect.IncludesShadersStore['defaultUboDeclaration'] = "layout(std140,column_major) uniform;\nuniform Material\n{\nvec4 diffuseLeftColor;\nvec4 diffuseRightColor;\nvec4 opacityParts;\nvec4 reflectionLeftColor;\nvec4 reflectionRightColor;\nvec4 refractionLeftColor;\nvec4 refractionRightColor;\nvec4 emissiveLeftColor; \nvec4 emissiveRightColor;\nvec2 vDiffuseInfos;\nvec2 vAmbientInfos;\nvec2 vOpacityInfos;\nvec2 vReflectionInfos;\nvec2 vEmissiveInfos;\nvec2 vLightmapInfos;\nvec2 vSpecularInfos;\nvec3 vBumpInfos;\nmat4 diffuseMatrix;\nmat4 ambientMatrix;\nmat4 opacityMatrix;\nmat4 reflectionMatrix;\nmat4 emissiveMatrix;\nmat4 lightmapMatrix;\nmat4 specularMatrix;\nmat4 bumpMatrix; \nvec4 vTangentSpaceParams;\nmat4 refractionMatrix;\nvec4 vRefractionInfos;\nvec4 vSpecularColor;\nvec3 vEmissiveColor;\nvec4 vDiffuseColor;\nfloat pointSize; \n};\nuniform Scene {\nmat4 viewProjection;\nmat4 view;\n};";
  1688. BABYLON.Effect.IncludesShadersStore['shadowsFragmentFunctions'] = "#ifdef SHADOWS\n#ifndef SHADOWFLOAT\nfloat unpack(vec4 color)\n{\nconst vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);\nreturn dot(color,bit_shift);\n}\n#endif\nfloat computeShadowCube(vec3 lightPosition,samplerCube shadowSampler,float darkness,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\ndepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nfloat shadow=unpack(textureCube(shadowSampler,directionToLight));\n#else\nfloat shadow=textureCube(shadowSampler,directionToLight).x;\n#endif\nif (depth>shadow)\n{\nreturn darkness;\n}\nreturn 1.0;\n}\nfloat computeShadowWithPCFCube(vec3 lightPosition,samplerCube shadowSampler,float mapSize,float darkness,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\ndepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\nfloat visibility=1.;\nvec3 poissonDisk[4];\npoissonDisk[0]=vec3(-1.0,1.0,-1.0);\npoissonDisk[1]=vec3(1.0,-1.0,-1.0);\npoissonDisk[2]=vec3(-1.0,-1.0,-1.0);\npoissonDisk[3]=vec3(1.0,-1.0,1.0);\n\n#ifndef SHADOWFLOAT\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[0]*mapSize))<depth) visibility-=0.25;\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[1]*mapSize))<depth) visibility-=0.25;\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[2]*mapSize))<depth) visibility-=0.25;\nif (unpack(textureCube(shadowSampler,directionToLight+poissonDisk[3]*mapSize))<depth) visibility-=0.25;\n#else\nif (textureCube(shadowSampler,directionToLight+poissonDisk[0]*mapSize).x<depth) visibility-=0.25;\nif (textureCube(shadowSampler,directionToLight+poissonDisk[1]*mapSize).x<depth) visibility-=0.25;\nif (textureCube(shadowSampler,directionToLight+poissonDisk[2]*mapSize).x<depth) visibility-=0.25;\nif (textureCube(shadowSampler,directionToLight+poissonDisk[3]*mapSize).x<depth) visibility-=0.25;\n#endif\nreturn min(1.0,visibility+darkness);\n}\nfloat computeShadowWithESMCube(vec3 lightPosition,samplerCube shadowSampler,float darkness,float depthScale,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\nfloat shadowPixelDepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(textureCube(shadowSampler,directionToLight));\n#else\nfloat shadowMapSample=textureCube(shadowSampler,directionToLight).x;\n#endif\nfloat esm=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness); \nreturn esm;\n}\nfloat computeShadowWithCloseESMCube(vec3 lightPosition,samplerCube shadowSampler,float darkness,float depthScale,vec2 depthValues)\n{\nvec3 directionToLight=vPositionW-lightPosition;\nfloat depth=length(directionToLight);\ndepth=(depth+depthValues.x)/(depthValues.y);\nfloat shadowPixelDepth=clamp(depth,0.,1.0);\ndirectionToLight=normalize(directionToLight);\ndirectionToLight.y=-directionToLight.y;\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(textureCube(shadowSampler,directionToLight));\n#else\nfloat shadowMapSample=textureCube(shadowSampler,directionToLight).x;\n#endif\nfloat esm=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);\nreturn esm;\n}\nfloat computeShadow(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadow=unpack(texture2D(shadowSampler,uv));\n#else\nfloat shadow=texture2D(shadowSampler,uv).x;\n#endif\nif (shadowPixelDepth>shadow)\n{\nreturn computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff);\n}\nreturn 1.;\n}\nfloat computeShadowWithPCF(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float mapSize,float darkness,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\nfloat visibility=1.;\nvec2 poissonDisk[4];\npoissonDisk[0]=vec2(-0.94201624,-0.39906216);\npoissonDisk[1]=vec2(0.94558609,-0.76890725);\npoissonDisk[2]=vec2(-0.094184101,-0.92938870);\npoissonDisk[3]=vec2(0.34495938,0.29387760);\n\n#ifndef SHADOWFLOAT\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[0]*mapSize))<shadowPixelDepth) visibility-=0.25;\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[1]*mapSize))<shadowPixelDepth) visibility-=0.25;\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[2]*mapSize))<shadowPixelDepth) visibility-=0.25;\nif (unpack(texture2D(shadowSampler,uv+poissonDisk[3]*mapSize))<shadowPixelDepth) visibility-=0.25;\n#else\nif (texture2D(shadowSampler,uv+poissonDisk[0]*mapSize).x<shadowPixelDepth) visibility-=0.25;\nif (texture2D(shadowSampler,uv+poissonDisk[1]*mapSize).x<shadowPixelDepth) visibility-=0.25;\nif (texture2D(shadowSampler,uv+poissonDisk[2]*mapSize).x<shadowPixelDepth) visibility-=0.25;\nif (texture2D(shadowSampler,uv+poissonDisk[3]*mapSize).x<shadowPixelDepth) visibility-=0.25;\n#endif\nreturn computeFallOff(min(1.0,visibility+darkness),clipSpace.xy,frustumEdgeFalloff);\n}\nfloat computeShadowWithESM(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float depthScale,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0);\n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(texture2D(shadowSampler,uv));\n#else\nfloat shadowMapSample=texture2D(shadowSampler,uv).x;\n#endif\nfloat esm=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);\nreturn computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);\n}\nfloat computeShadowWithCloseESM(vec4 vPositionFromLight,float depthMetric,sampler2D shadowSampler,float darkness,float depthScale,float frustumEdgeFalloff)\n{\nvec3 clipSpace=vPositionFromLight.xyz/vPositionFromLight.w;\nvec2 uv=0.5*clipSpace.xy+vec2(0.5);\nif (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)\n{\nreturn 1.0;\n}\nfloat shadowPixelDepth=clamp(depthMetric,0.,1.0); \n#ifndef SHADOWFLOAT\nfloat shadowMapSample=unpack(texture2D(shadowSampler,uv));\n#else\nfloat shadowMapSample=texture2D(shadowSampler,uv).x;\n#endif\nfloat esm=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);\nreturn computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);\n}\n#endif\n";
  1689. BABYLON.Effect.IncludesShadersStore['fresnelFunction'] = "#ifdef FRESNEL\nfloat computeFresnelTerm(vec3 viewDirection,vec3 worldNormal,float bias,float power)\n{\nfloat fresnelTerm=pow(bias+abs(dot(viewDirection,worldNormal)),power);\nreturn clamp(fresnelTerm,0.,1.);\n}\n#endif";
  1690. BABYLON.Effect.IncludesShadersStore['reflectionFunction'] = "vec3 computeReflectionCoords(vec4 worldPos,vec3 worldNormal)\n{\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvec3 direction=normalize(vDirectionW);\nfloat t=clamp(direction.y*-0.5+0.5,0.,1.0);\nfloat s=atan(direction.z,direction.x)*RECIPROCAL_PI2+0.5;\n#ifdef REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED\nreturn vec3(1.0-s,t,0);\n#else\nreturn vec3(s,t,0);\n#endif\n#endif\n#ifdef REFLECTIONMAP_EQUIRECTANGULAR\nvec3 cameraToVertex=normalize(worldPos.xyz-vEyePosition.xyz);\nvec3 r=reflect(cameraToVertex,worldNormal);\nfloat t=clamp(r.y*-0.5+0.5,0.,1.0);\nfloat s=atan(r.z,r.x)*RECIPROCAL_PI2+0.5;\nreturn vec3(s,t,0);\n#endif\n#ifdef REFLECTIONMAP_SPHERICAL\nvec3 viewDir=normalize(vec3(view*worldPos));\nvec3 viewNormal=normalize(vec3(view*vec4(worldNormal,0.0)));\nvec3 r=reflect(viewDir,viewNormal);\nr.z=r.z-1.0;\nfloat m=2.0*length(r);\nreturn vec3(r.x/m+0.5,1.0-r.y/m-0.5,0);\n#endif\n#ifdef REFLECTIONMAP_PLANAR\nvec3 viewDir=worldPos.xyz-vEyePosition.xyz;\nvec3 coords=normalize(reflect(viewDir,worldNormal));\nreturn vec3(reflectionMatrix*vec4(coords,1));\n#endif\n#ifdef REFLECTIONMAP_CUBIC\nvec3 viewDir=worldPos.xyz-vEyePosition.xyz;\nvec3 coords=reflect(viewDir,worldNormal);\n#ifdef INVERTCUBICMAP\ncoords.y=1.0-coords.y;\n#endif\nreturn vec3(reflectionMatrix*vec4(coords,0));\n#endif\n#ifdef REFLECTIONMAP_PROJECTION\nreturn vec3(reflectionMatrix*(view*worldPos));\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nreturn vPositionUVW;\n#endif\n#ifdef REFLECTIONMAP_EXPLICIT\nreturn vec3(0,0,0);\n#endif\n}";
  1691. BABYLON.Effect.IncludesShadersStore['imageProcessingDeclaration'] = "#ifdef EXPOSURE\nuniform float exposureLinear;\n#endif\n#ifdef CONTRAST\nuniform float contrast;\n#endif\n#ifdef VIGNETTE\nuniform vec2 vInverseScreenSize;\nuniform vec4 vignetteSettings1;\nuniform vec4 vignetteSettings2;\n#endif\n#ifdef COLORCURVES\nuniform vec4 vCameraColorCurveNegative;\nuniform vec4 vCameraColorCurveNeutral;\nuniform vec4 vCameraColorCurvePositive;\n#endif\n#ifdef COLORGRADING\n#ifdef COLORGRADING3D\nuniform highp sampler3D txColorTransform;\n#else\nuniform sampler2D txColorTransform;\n#endif\nuniform vec4 colorTransformSettings;\n#endif";
  1692. BABYLON.Effect.IncludesShadersStore['imageProcessingFunctions'] = "#if defined(COLORGRADING) && !defined(COLORGRADING3D)\n\nvec3 sampleTexture3D(sampler2D colorTransform,vec3 color,vec2 sampler3dSetting)\n{\nfloat sliceSize=2.0*sampler3dSetting.x; \n#ifdef SAMPLER3DGREENDEPTH\nfloat sliceContinuous=(color.g-sampler3dSetting.x)*sampler3dSetting.y;\n#else\nfloat sliceContinuous=(color.b-sampler3dSetting.x)*sampler3dSetting.y;\n#endif\nfloat sliceInteger=floor(sliceContinuous);\n\n\nfloat sliceFraction=sliceContinuous-sliceInteger;\n#ifdef SAMPLER3DGREENDEPTH\nvec2 sliceUV=color.rb;\n#else\nvec2 sliceUV=color.rg;\n#endif\nsliceUV.x*=sliceSize;\nsliceUV.x+=sliceInteger*sliceSize;\nsliceUV=clamp(sliceUV,0.,1.);\nvec4 slice0Color=texture2D(colorTransform,sliceUV);\nsliceUV.x+=sliceSize;\nsliceUV=clamp(sliceUV,0.,1.);\nvec4 slice1Color=texture2D(colorTransform,sliceUV);\nvec3 result=mix(slice0Color.rgb,slice1Color.rgb,sliceFraction);\n#ifdef SAMPLER3DBGRMAP\ncolor.rgb=result.rgb;\n#else\ncolor.rgb=result.bgr;\n#endif\nreturn color;\n}\n#endif\nvec4 applyImageProcessing(vec4 result) {\n#ifdef EXPOSURE\nresult.rgb*=exposureLinear;\n#endif\n#ifdef VIGNETTE\n\nvec2 viewportXY=gl_FragCoord.xy*vInverseScreenSize;\nviewportXY=viewportXY*2.0-1.0;\nvec3 vignetteXY1=vec3(viewportXY*vignetteSettings1.xy+vignetteSettings1.zw,1.0);\nfloat vignetteTerm=dot(vignetteXY1,vignetteXY1);\nfloat vignette=pow(vignetteTerm,vignetteSettings2.w);\n\nvec3 vignetteColor=vignetteSettings2.rgb;\n#ifdef VIGNETTEBLENDMODEMULTIPLY\nvec3 vignetteColorMultiplier=mix(vignetteColor,vec3(1,1,1),vignette);\nresult.rgb*=vignetteColorMultiplier;\n#endif\n#ifdef VIGNETTEBLENDMODEOPAQUE\nresult.rgb=mix(vignetteColor,result.rgb,vignette);\n#endif\n#endif\n#ifdef TONEMAPPING\nconst float tonemappingCalibration=1.590579;\nresult.rgb=1.0-exp2(-tonemappingCalibration*result.rgb);\n#endif\n\nresult.rgb=toGammaSpace(result.rgb);\nresult.rgb=clamp(result.rgb,0.0,1.0);\n#ifdef CONTRAST\n\nvec3 resultHighContrast=applyEaseInOut(result.rgb);\nif (contrast<1.0) {\n\nresult.rgb=mix(vec3(0.5,0.5,0.5),result.rgb,contrast);\n} else {\n\nresult.rgb=mix(result.rgb,resultHighContrast,contrast-1.0);\n}\n#endif\n\n#ifdef COLORGRADING\nvec3 colorTransformInput=result.rgb*colorTransformSettings.xxx+colorTransformSettings.yyy;\n#ifdef COLORGRADING3D\nvec3 colorTransformOutput=texture(txColorTransform,colorTransformInput).rgb;\n#else\nvec3 colorTransformOutput=sampleTexture3D(txColorTransform,colorTransformInput,colorTransformSettings.yz).rgb;\n#endif\nresult.rgb=mix(result.rgb,colorTransformOutput,colorTransformSettings.www);\n#endif\n#ifdef COLORCURVES\n\nfloat luma=getLuminance(result.rgb);\nvec2 curveMix=clamp(vec2(luma*3.0-1.5,luma*-3.0+1.5),vec2(0.0),vec2(1.0));\nvec4 colorCurve=vCameraColorCurveNeutral+curveMix.x*vCameraColorCurvePositive-curveMix.y*vCameraColorCurveNegative;\nresult.rgb*=colorCurve.rgb;\nresult.rgb=mix(vec3(luma),result.rgb,colorCurve.a);\n#endif\nreturn result;\n}";
  1693. BABYLON.Effect.IncludesShadersStore['bumpFragmentFunctions'] = "#ifdef BUMP\n#if BUMPDIRECTUV == 1\n#define vBumpUV vMainUV1\n#elif BUMPDIRECTUV == 2\n#define vBumpUV vMainUV2\n#else\nvarying vec2 vBumpUV;\n#endif\nuniform sampler2D bumpSampler;\n#if defined(TANGENT) && defined(NORMAL) \nvarying mat3 vTBN;\n#endif\n\nmat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv)\n{\n\nuv=gl_FrontFacing ? uv : -uv;\n\nvec3 dp1=dFdx(p);\nvec3 dp2=dFdy(p);\nvec2 duv1=dFdx(uv);\nvec2 duv2=dFdy(uv);\n\nvec3 dp2perp=cross(dp2,normal);\nvec3 dp1perp=cross(normal,dp1);\nvec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;\nvec3 bitangent=dp2perp*duv1.y+dp1perp*duv2.y;\n\ntangent*=vTangentSpaceParams.x;\nbitangent*=vTangentSpaceParams.y;\n\nfloat invmax=inversesqrt(max(dot(tangent,tangent),dot(bitangent,bitangent)));\nreturn mat3(tangent*invmax,bitangent*invmax,normal);\n}\nvec3 perturbNormal(mat3 cotangentFrame,vec2 uv)\n{\nvec3 map=texture2D(bumpSampler,uv).xyz;\nmap=map*2.0-1.0;\n#ifdef NORMALXYSCALE\nmap=normalize(map*vec3(vBumpInfos.y,vBumpInfos.y,1.0));\n#endif\nreturn normalize(cotangentFrame*map);\n}\n#ifdef PARALLAX\nconst float minSamples=4.;\nconst float maxSamples=15.;\nconst int iMaxSamples=15;\n\nvec2 parallaxOcclusion(vec3 vViewDirCoT,vec3 vNormalCoT,vec2 texCoord,float parallaxScale) {\nfloat parallaxLimit=length(vViewDirCoT.xy)/vViewDirCoT.z;\nparallaxLimit*=parallaxScale;\nvec2 vOffsetDir=normalize(vViewDirCoT.xy);\nvec2 vMaxOffset=vOffsetDir*parallaxLimit;\nfloat numSamples=maxSamples+(dot(vViewDirCoT,vNormalCoT)*(minSamples-maxSamples));\nfloat stepSize=1.0/numSamples;\n\nfloat currRayHeight=1.0;\nvec2 vCurrOffset=vec2(0,0);\nvec2 vLastOffset=vec2(0,0);\nfloat lastSampledHeight=1.0;\nfloat currSampledHeight=1.0;\nfor (int i=0; i<iMaxSamples; i++)\n{\ncurrSampledHeight=texture2D(bumpSampler,vBumpUV+vCurrOffset).w;\n\nif (currSampledHeight>currRayHeight)\n{\nfloat delta1=currSampledHeight-currRayHeight;\nfloat delta2=(currRayHeight+stepSize)-lastSampledHeight;\nfloat ratio=delta1/(delta1+delta2);\nvCurrOffset=(ratio)* vLastOffset+(1.0-ratio)*vCurrOffset;\n\nbreak;\n}\nelse\n{\ncurrRayHeight-=stepSize;\nvLastOffset=vCurrOffset;\nvCurrOffset+=stepSize*vMaxOffset;\nlastSampledHeight=currSampledHeight;\n}\n}\nreturn vCurrOffset;\n}\nvec2 parallaxOffset(vec3 viewDir,float heightScale)\n{\n\nfloat height=texture2D(bumpSampler,vBumpUV).w;\nvec2 texCoordOffset=heightScale*viewDir.xy*height;\nreturn -texCoordOffset;\n}\n#endif\n#endif";
  1694. BABYLON.Effect.IncludesShadersStore['clipPlaneFragmentDeclaration'] = "#ifdef CLIPPLANE\nvarying float fClipDistance;\n#endif";
  1695. BABYLON.Effect.IncludesShadersStore['fogFragmentDeclaration'] = "#ifdef FOG\n#define FOGMODE_NONE 0.\n#define FOGMODE_EXP 1.\n#define FOGMODE_EXP2 2.\n#define FOGMODE_LINEAR 3.\n#define E 2.71828\nuniform vec4 vFogInfos;\nuniform vec3 vFogColor;\nvarying vec3 vFogDistance;\nfloat CalcFogFactor()\n{\nfloat fogCoeff=1.0;\nfloat fogStart=vFogInfos.y;\nfloat fogEnd=vFogInfos.z;\nfloat fogDensity=vFogInfos.w;\nfloat fogDistance=length(vFogDistance);\nif (FOGMODE_LINEAR == vFogInfos.x)\n{\nfogCoeff=(fogEnd-fogDistance)/(fogEnd-fogStart);\n}\nelse if (FOGMODE_EXP == vFogInfos.x)\n{\nfogCoeff=1.0/pow(E,fogDistance*fogDensity);\n}\nelse if (FOGMODE_EXP2 == vFogInfos.x)\n{\nfogCoeff=1.0/pow(E,fogDistance*fogDistance*fogDensity*fogDensity);\n}\nreturn clamp(fogCoeff,0.0,1.0);\n}\n#endif";
  1696. BABYLON.Effect.IncludesShadersStore['clipPlaneFragment'] = "#ifdef CLIPPLANE\nif (fClipDistance>0.0)\n{\ndiscard;\n}\n#endif";
  1697. BABYLON.Effect.IncludesShadersStore['bumpFragment'] = "vec2 uvOffset=vec2(0.0,0.0);\n#if defined(BUMP) || defined(PARALLAX)\n#ifdef NORMALXYSCALE\nfloat normalScale=1.0;\n#else \nfloat normalScale=vBumpInfos.y;\n#endif\n#if defined(TANGENT) && defined(NORMAL)\nmat3 TBN=vTBN;\n#else\nmat3 TBN=cotangent_frame(normalW*normalScale,vPositionW,vBumpUV);\n#endif\n#endif\n#ifdef PARALLAX\nmat3 invTBN=transposeMat3(TBN);\n#ifdef PARALLAXOCCLUSION\nuvOffset=parallaxOcclusion(invTBN*-viewDirectionW,invTBN*normalW,vBumpUV,vBumpInfos.z);\n#else\nuvOffset=parallaxOffset(invTBN*viewDirectionW,vBumpInfos.z);\n#endif\n#endif\n#ifdef BUMP\nnormalW=perturbNormal(TBN,vBumpUV+uvOffset);\n#endif";
  1698. BABYLON.Effect.IncludesShadersStore['lightFragment'] = "#ifdef LIGHT{X}\n#if defined(SHADOWONLY) || (defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X}))\n\n#else\n#ifdef PBR\n#ifdef SPOTLIGHT{X}\ninfo=computeSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular,light{X}.vLightDiffuse.a,roughness,NdotV,specularEnvironmentR0,specularEnvironmentR90,NdotL);\n#endif\n#ifdef HEMILIGHT{X}\ninfo=computeHemisphericLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular,light{X}.vLightGround,roughness,NdotV,specularEnvironmentR0,specularEnvironmentR90,NdotL);\n#endif\n#if defined(POINTLIGHT{X}) || defined(DIRLIGHT{X})\ninfo=computeLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular,light{X}.vLightDiffuse.a,roughness,NdotV,specularEnvironmentR0,specularEnvironmentR90,NdotL);\n#endif\n#else\n#ifdef SPOTLIGHT{X}\ninfo=computeSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular,light{X}.vLightDiffuse.a,glossiness);\n#endif\n#ifdef HEMILIGHT{X}\ninfo=computeHemisphericLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular,light{X}.vLightGround,glossiness);\n#endif\n#if defined(POINTLIGHT{X}) || defined(DIRLIGHT{X})\ninfo=computeLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDiffuse.rgb,light{X}.vLightSpecular,light{X}.vLightDiffuse.a,glossiness);\n#endif\n#endif\n#endif\n#ifdef SHADOW{X}\n#ifdef SHADOWCLOSEESM{X}\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithCloseESMCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);\n#else\nshadow=computeShadowWithCloseESM(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);\n#endif\n#else\n#ifdef SHADOWESM{X}\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithESMCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);\n#else\nshadow=computeShadowWithESM(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);\n#endif\n#else \n#ifdef SHADOWPCF{X}\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowWithPCFCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.depthValues);\n#else\nshadow=computeShadowWithPCF(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#else\n#if defined(SHADOWCUBE{X})\nshadow=computeShadowCube(light{X}.vLightData.xyz,shadowSampler{X},light{X}.shadowsInfo.x,light{X}.depthValues);\n#else\nshadow=computeShadow(vPositionFromLight{X},vDepthMetric{X},shadowSampler{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);\n#endif\n#endif\n#endif\n#endif\n#ifdef SHADOWONLY\n#ifndef SHADOWINUSE\n#define SHADOWINUSE\n#endif\nglobalShadow+=shadow;\nshadowLightCount+=1.0;\n#endif\n#else\nshadow=1.;\n#endif\n#ifndef SHADOWONLY\n#ifdef CUSTOMUSERLIGHTING\ndiffuseBase+=computeCustomDiffuseLighting(info,diffuseBase,shadow);\n#ifdef SPECULARTERM\nspecularBase+=computeCustomSpecularLighting(info,specularBase,shadow);\n#endif\n#elif defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X})\ndiffuseBase+=lightmapColor*shadow;\n#ifdef SPECULARTERM\n#ifndef LIGHTMAPNOSPECULAR{X}\nspecularBase+=info.specular*shadow*lightmapColor;\n#endif\n#endif\n#else\ndiffuseBase+=info.diffuse*shadow;\n#ifdef SPECULARTERM\nspecularBase+=info.specular*shadow;\n#endif\n#endif\n#endif\n#endif";
  1699. BABYLON.Effect.IncludesShadersStore['logDepthFragment'] = "#ifdef LOGARITHMICDEPTH\ngl_FragDepthEXT=log2(vFragmentDepth)*logarithmicDepthConstant*0.5;\n#endif";
  1700. BABYLON.Effect.IncludesShadersStore['fogFragment'] = "#ifdef FOG\nfloat fog=CalcFogFactor();\ncolor.rgb=fog*color.rgb+(1.0-fog)*vFogColor;\n#endif";
  1701. var AnimationRange = BABYLON.AnimationRange;
  1702. var AnimationEvent = BABYLON.AnimationEvent;
  1703. var PathCursor = BABYLON.PathCursor;
  1704. var Animation = BABYLON.Animation;
  1705. var TargetedAnimation = BABYLON.TargetedAnimation;
  1706. var AnimationGroup = BABYLON.AnimationGroup;
  1707. var RuntimeAnimation = BABYLON.RuntimeAnimation;
  1708. var Animatable = BABYLON.Animatable;
  1709. var EasingFunction = BABYLON.EasingFunction;
  1710. var CircleEase = BABYLON.CircleEase;
  1711. var BackEase = BABYLON.BackEase;
  1712. var BounceEase = BABYLON.BounceEase;
  1713. var CubicEase = BABYLON.CubicEase;
  1714. var ElasticEase = BABYLON.ElasticEase;
  1715. var ExponentialEase = BABYLON.ExponentialEase;
  1716. var PowerEase = BABYLON.PowerEase;
  1717. var QuadraticEase = BABYLON.QuadraticEase;
  1718. var QuarticEase = BABYLON.QuarticEase;
  1719. var QuinticEase = BABYLON.QuinticEase;
  1720. var SineEase = BABYLON.SineEase;
  1721. var BezierCurveEase = BABYLON.BezierCurveEase;
  1722. export { AnimationRange,AnimationEvent,PathCursor,Animation,TargetedAnimation,AnimationGroup,RuntimeAnimation,Animatable,EasingFunction,CircleEase,BackEase,BounceEase,CubicEase,ElasticEase,ExponentialEase,PowerEase,QuadraticEase,QuarticEase,QuinticEase,SineEase,BezierCurveEase };