index.js 123 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724
  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. if(typeof require !== 'undefined'){
  12. var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : this);
  13. var BABYLON = globalObject["BABYLON"] || {};
  14. var BABYLON0 = require('babylonjs/core');
  15. if(BABYLON !== BABYLON0) __extends(BABYLON, BABYLON0);
  16. var BABYLON;
  17. (function (BABYLON) {
  18. var AnimationRange = /** @class */ (function () {
  19. function AnimationRange(name, from, to) {
  20. this.name = name;
  21. this.from = from;
  22. this.to = to;
  23. }
  24. AnimationRange.prototype.clone = function () {
  25. return new AnimationRange(this.name, this.from, this.to);
  26. };
  27. return AnimationRange;
  28. }());
  29. BABYLON.AnimationRange = AnimationRange;
  30. /**
  31. * Composed of a frame, and an action function
  32. */
  33. var AnimationEvent = /** @class */ (function () {
  34. function AnimationEvent(frame, action, onlyOnce) {
  35. this.frame = frame;
  36. this.action = action;
  37. this.onlyOnce = onlyOnce;
  38. this.isDone = false;
  39. }
  40. return AnimationEvent;
  41. }());
  42. BABYLON.AnimationEvent = AnimationEvent;
  43. var PathCursor = /** @class */ (function () {
  44. function PathCursor(path) {
  45. this.path = path;
  46. this._onchange = new Array();
  47. this.value = 0;
  48. this.animations = new Array();
  49. }
  50. PathCursor.prototype.getPoint = function () {
  51. var point = this.path.getPointAtLengthPosition(this.value);
  52. return new BABYLON.Vector3(point.x, 0, point.y);
  53. };
  54. PathCursor.prototype.moveAhead = function (step) {
  55. if (step === void 0) { step = 0.002; }
  56. this.move(step);
  57. return this;
  58. };
  59. PathCursor.prototype.moveBack = function (step) {
  60. if (step === void 0) { step = 0.002; }
  61. this.move(-step);
  62. return this;
  63. };
  64. PathCursor.prototype.move = function (step) {
  65. if (Math.abs(step) > 1) {
  66. throw "step size should be less than 1.";
  67. }
  68. this.value += step;
  69. this.ensureLimits();
  70. this.raiseOnChange();
  71. return this;
  72. };
  73. PathCursor.prototype.ensureLimits = function () {
  74. while (this.value > 1) {
  75. this.value -= 1;
  76. }
  77. while (this.value < 0) {
  78. this.value += 1;
  79. }
  80. return this;
  81. };
  82. // used by animation engine
  83. PathCursor.prototype.raiseOnChange = function () {
  84. var _this = this;
  85. this._onchange.forEach(function (f) { return f(_this); });
  86. return this;
  87. };
  88. PathCursor.prototype.onchange = function (f) {
  89. this._onchange.push(f);
  90. return this;
  91. };
  92. return PathCursor;
  93. }());
  94. BABYLON.PathCursor = PathCursor;
  95. var Animation = /** @class */ (function () {
  96. function Animation(name, targetProperty, framePerSecond, dataType, loopMode, enableBlending) {
  97. this.name = name;
  98. this.targetProperty = targetProperty;
  99. this.framePerSecond = framePerSecond;
  100. this.dataType = dataType;
  101. this.loopMode = loopMode;
  102. this.enableBlending = enableBlending;
  103. this._runtimeAnimations = new Array();
  104. // The set of event that will be linked to this animation
  105. this._events = new Array();
  106. this.blendingSpeed = 0.01;
  107. this._ranges = {};
  108. this.targetPropertyPath = targetProperty.split(".");
  109. this.dataType = dataType;
  110. this.loopMode = loopMode === undefined ? Animation.ANIMATIONLOOPMODE_CYCLE : loopMode;
  111. }
  112. Animation._PrepareAnimation = function (name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction) {
  113. var dataType = undefined;
  114. if (!isNaN(parseFloat(from)) && isFinite(from)) {
  115. dataType = Animation.ANIMATIONTYPE_FLOAT;
  116. }
  117. else if (from instanceof BABYLON.Quaternion) {
  118. dataType = Animation.ANIMATIONTYPE_QUATERNION;
  119. }
  120. else if (from instanceof BABYLON.Vector3) {
  121. dataType = Animation.ANIMATIONTYPE_VECTOR3;
  122. }
  123. else if (from instanceof BABYLON.Vector2) {
  124. dataType = Animation.ANIMATIONTYPE_VECTOR2;
  125. }
  126. else if (from instanceof BABYLON.Color3) {
  127. dataType = Animation.ANIMATIONTYPE_COLOR3;
  128. }
  129. else if (from instanceof BABYLON.Size) {
  130. dataType = Animation.ANIMATIONTYPE_SIZE;
  131. }
  132. if (dataType == undefined) {
  133. return null;
  134. }
  135. var animation = new Animation(name, targetProperty, framePerSecond, dataType, loopMode);
  136. var keys = [{ frame: 0, value: from }, { frame: totalFrame, value: to }];
  137. animation.setKeys(keys);
  138. if (easingFunction !== undefined) {
  139. animation.setEasingFunction(easingFunction);
  140. }
  141. return animation;
  142. };
  143. /**
  144. * Sets up an animation.
  145. * @param property the property to animate
  146. * @param animationType the animation type to apply
  147. * @param easingFunction the easing function used in the animation
  148. * @returns The created animation
  149. */
  150. Animation.CreateAnimation = function (property, animationType, framePerSecond, easingFunction) {
  151. var animation = new Animation(property + "Animation", property, framePerSecond, animationType, Animation.ANIMATIONLOOPMODE_CONSTANT);
  152. animation.setEasingFunction(easingFunction);
  153. return animation;
  154. };
  155. /**
  156. * Create and start an animation on a node
  157. * @param {string} name defines the name of the global animation that will be run on all nodes
  158. * @param {BABYLON.Node} node defines the root node where the animation will take place
  159. * @param {string} targetProperty defines property to animate
  160. * @param {number} framePerSecond defines the number of frame per second yo use
  161. * @param {number} totalFrame defines the number of frames in total
  162. * @param {any} from defines the initial value
  163. * @param {any} to defines the final value
  164. * @param {number} loopMode defines which loop mode you want to use (off by default)
  165. * @param {BABYLON.EasingFunction} easingFunction defines the easing function to use (linear by default)
  166. * @param onAnimationEnd defines the callback to call when animation end
  167. * @returns the animatable created for this animation
  168. */
  169. Animation.CreateAndStartAnimation = function (name, node, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction, onAnimationEnd) {
  170. var animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction);
  171. if (!animation) {
  172. return null;
  173. }
  174. return node.getScene().beginDirectAnimation(node, [animation], 0, totalFrame, (animation.loopMode === 1), 1.0, onAnimationEnd);
  175. };
  176. /**
  177. * Create and start an animation on a node and its descendants
  178. * @param {string} name defines the name of the global animation that will be run on all nodes
  179. * @param {BABYLON.Node} node defines the root node where the animation will take place
  180. * @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.
  181. * @param {string} targetProperty defines property to animate
  182. * @param {number} framePerSecond defines the number of frame per second yo use
  183. * @param {number} totalFrame defines the number of frames in total
  184. * @param {any} from defines the initial value
  185. * @param {any} to defines the final value
  186. * @param {number} loopMode defines which loop mode you want to use (off by default)
  187. * @param {BABYLON.EasingFunction} easingFunction defines the easing function to use (linear by default)
  188. * @param onAnimationEnd defines the callback to call when an animation ends (will be called once per node)
  189. * @returns the list of animatables created for all nodes
  190. * @example https://www.babylonjs-playground.com/#MH0VLI
  191. */
  192. Animation.CreateAndStartHierarchyAnimation = function (name, node, directDescendantsOnly, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction, onAnimationEnd) {
  193. var animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction);
  194. if (!animation) {
  195. return null;
  196. }
  197. var scene = node.getScene();
  198. return scene.beginDirectHierarchyAnimation(node, directDescendantsOnly, [animation], 0, totalFrame, (animation.loopMode === 1), 1.0, onAnimationEnd);
  199. };
  200. Animation.CreateMergeAndStartAnimation = function (name, node, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction, onAnimationEnd) {
  201. var animation = Animation._PrepareAnimation(name, targetProperty, framePerSecond, totalFrame, from, to, loopMode, easingFunction);
  202. if (!animation) {
  203. return null;
  204. }
  205. node.animations.push(animation);
  206. return node.getScene().beginAnimation(node, 0, totalFrame, (animation.loopMode === 1), 1.0, onAnimationEnd);
  207. };
  208. /**
  209. * Transition property of the Camera to the target Value.
  210. * @param property The property to transition
  211. * @param targetValue The target Value of the property
  212. * @param host The object where the property to animate belongs
  213. * @param scene Scene used to run the animation
  214. * @param frameRate Framerate (in frame/s) to use
  215. * @param transition The transition type we want to use
  216. * @param duration The duration of the animation, in milliseconds
  217. * @param onAnimationEnd Call back trigger at the end of the animation.
  218. */
  219. Animation.TransitionTo = function (property, targetValue, host, scene, frameRate, transition, duration, onAnimationEnd) {
  220. if (onAnimationEnd === void 0) { onAnimationEnd = null; }
  221. if (duration <= 0) {
  222. host[property] = targetValue;
  223. if (onAnimationEnd) {
  224. onAnimationEnd();
  225. }
  226. return null;
  227. }
  228. var endFrame = frameRate * (duration / 1000);
  229. transition.setKeys([{
  230. frame: 0,
  231. value: host[property].clone ? host[property].clone() : host[property]
  232. },
  233. {
  234. frame: endFrame,
  235. value: targetValue
  236. }]);
  237. if (!host.animations) {
  238. host.animations = [];
  239. }
  240. host.animations.push(transition);
  241. var animation = scene.beginAnimation(host, 0, endFrame, false);
  242. animation.onAnimationEnd = onAnimationEnd;
  243. return animation;
  244. };
  245. Object.defineProperty(Animation.prototype, "runtimeAnimations", {
  246. /**
  247. * Return the array of runtime animations currently using this animation
  248. */
  249. get: function () {
  250. return this._runtimeAnimations;
  251. },
  252. enumerable: true,
  253. configurable: true
  254. });
  255. Object.defineProperty(Animation.prototype, "hasRunningRuntimeAnimations", {
  256. get: function () {
  257. for (var _i = 0, _a = this._runtimeAnimations; _i < _a.length; _i++) {
  258. var runtimeAnimation = _a[_i];
  259. if (!runtimeAnimation.isStopped) {
  260. return true;
  261. }
  262. }
  263. return false;
  264. },
  265. enumerable: true,
  266. configurable: true
  267. });
  268. // Methods
  269. /**
  270. * @param {boolean} fullDetails - support for multiple levels of logging within scene loading
  271. */
  272. Animation.prototype.toString = function (fullDetails) {
  273. var ret = "Name: " + this.name + ", property: " + this.targetProperty;
  274. ret += ", datatype: " + (["Float", "Vector3", "Quaternion", "Matrix", "Color3", "Vector2"])[this.dataType];
  275. ret += ", nKeys: " + (this._keys ? this._keys.length : "none");
  276. ret += ", nRanges: " + (this._ranges ? Object.keys(this._ranges).length : "none");
  277. if (fullDetails) {
  278. ret += ", Ranges: {";
  279. var first = true;
  280. for (var name in this._ranges) {
  281. if (first) {
  282. ret += ", ";
  283. first = false;
  284. }
  285. ret += name;
  286. }
  287. ret += "}";
  288. }
  289. return ret;
  290. };
  291. /**
  292. * Add an event to this animation.
  293. */
  294. Animation.prototype.addEvent = function (event) {
  295. this._events.push(event);
  296. };
  297. /**
  298. * Remove all events found at the given frame
  299. * @param frame
  300. */
  301. Animation.prototype.removeEvents = function (frame) {
  302. for (var index = 0; index < this._events.length; index++) {
  303. if (this._events[index].frame === frame) {
  304. this._events.splice(index, 1);
  305. index--;
  306. }
  307. }
  308. };
  309. Animation.prototype.getEvents = function () {
  310. return this._events;
  311. };
  312. Animation.prototype.createRange = function (name, from, to) {
  313. // check name not already in use; could happen for bones after serialized
  314. if (!this._ranges[name]) {
  315. this._ranges[name] = new AnimationRange(name, from, to);
  316. }
  317. };
  318. Animation.prototype.deleteRange = function (name, deleteFrames) {
  319. if (deleteFrames === void 0) { deleteFrames = true; }
  320. var range = this._ranges[name];
  321. if (!range) {
  322. return;
  323. }
  324. if (deleteFrames) {
  325. var from = range.from;
  326. var to = range.to;
  327. // this loop MUST go high to low for multiple splices to work
  328. for (var key = this._keys.length - 1; key >= 0; key--) {
  329. if (this._keys[key].frame >= from && this._keys[key].frame <= to) {
  330. this._keys.splice(key, 1);
  331. }
  332. }
  333. }
  334. this._ranges[name] = null; // said much faster than 'delete this._range[name]'
  335. };
  336. Animation.prototype.getRange = function (name) {
  337. return this._ranges[name];
  338. };
  339. Animation.prototype.getKeys = function () {
  340. return this._keys;
  341. };
  342. Animation.prototype.getHighestFrame = function () {
  343. var ret = 0;
  344. for (var key = 0, nKeys = this._keys.length; key < nKeys; key++) {
  345. if (ret < this._keys[key].frame) {
  346. ret = this._keys[key].frame;
  347. }
  348. }
  349. return ret;
  350. };
  351. Animation.prototype.getEasingFunction = function () {
  352. return this._easingFunction;
  353. };
  354. Animation.prototype.setEasingFunction = function (easingFunction) {
  355. this._easingFunction = easingFunction;
  356. };
  357. Animation.prototype.floatInterpolateFunction = function (startValue, endValue, gradient) {
  358. return BABYLON.Scalar.Lerp(startValue, endValue, gradient);
  359. };
  360. Animation.prototype.floatInterpolateFunctionWithTangents = function (startValue, outTangent, endValue, inTangent, gradient) {
  361. return BABYLON.Scalar.Hermite(startValue, outTangent, endValue, inTangent, gradient);
  362. };
  363. Animation.prototype.quaternionInterpolateFunction = function (startValue, endValue, gradient) {
  364. return BABYLON.Quaternion.Slerp(startValue, endValue, gradient);
  365. };
  366. Animation.prototype.quaternionInterpolateFunctionWithTangents = function (startValue, outTangent, endValue, inTangent, gradient) {
  367. return BABYLON.Quaternion.Hermite(startValue, outTangent, endValue, inTangent, gradient).normalize();
  368. };
  369. Animation.prototype.vector3InterpolateFunction = function (startValue, endValue, gradient) {
  370. return BABYLON.Vector3.Lerp(startValue, endValue, gradient);
  371. };
  372. Animation.prototype.vector3InterpolateFunctionWithTangents = function (startValue, outTangent, endValue, inTangent, gradient) {
  373. return BABYLON.Vector3.Hermite(startValue, outTangent, endValue, inTangent, gradient);
  374. };
  375. Animation.prototype.vector2InterpolateFunction = function (startValue, endValue, gradient) {
  376. return BABYLON.Vector2.Lerp(startValue, endValue, gradient);
  377. };
  378. Animation.prototype.vector2InterpolateFunctionWithTangents = function (startValue, outTangent, endValue, inTangent, gradient) {
  379. return BABYLON.Vector2.Hermite(startValue, outTangent, endValue, inTangent, gradient);
  380. };
  381. Animation.prototype.sizeInterpolateFunction = function (startValue, endValue, gradient) {
  382. return BABYLON.Size.Lerp(startValue, endValue, gradient);
  383. };
  384. Animation.prototype.color3InterpolateFunction = function (startValue, endValue, gradient) {
  385. return BABYLON.Color3.Lerp(startValue, endValue, gradient);
  386. };
  387. Animation.prototype.matrixInterpolateFunction = function (startValue, endValue, gradient) {
  388. return BABYLON.Matrix.Lerp(startValue, endValue, gradient);
  389. };
  390. Animation.prototype.clone = function () {
  391. var clone = new Animation(this.name, this.targetPropertyPath.join("."), this.framePerSecond, this.dataType, this.loopMode);
  392. clone.enableBlending = this.enableBlending;
  393. clone.blendingSpeed = this.blendingSpeed;
  394. if (this._keys) {
  395. clone.setKeys(this._keys);
  396. }
  397. if (this._ranges) {
  398. clone._ranges = {};
  399. for (var name in this._ranges) {
  400. var range = this._ranges[name];
  401. if (!range) {
  402. continue;
  403. }
  404. clone._ranges[name] = range.clone();
  405. }
  406. }
  407. return clone;
  408. };
  409. Animation.prototype.setKeys = function (values) {
  410. this._keys = values.slice(0);
  411. };
  412. Animation.prototype.serialize = function () {
  413. var serializationObject = {};
  414. serializationObject.name = this.name;
  415. serializationObject.property = this.targetProperty;
  416. serializationObject.framePerSecond = this.framePerSecond;
  417. serializationObject.dataType = this.dataType;
  418. serializationObject.loopBehavior = this.loopMode;
  419. serializationObject.enableBlending = this.enableBlending;
  420. serializationObject.blendingSpeed = this.blendingSpeed;
  421. var dataType = this.dataType;
  422. serializationObject.keys = [];
  423. var keys = this.getKeys();
  424. for (var index = 0; index < keys.length; index++) {
  425. var animationKey = keys[index];
  426. var key = {};
  427. key.frame = animationKey.frame;
  428. switch (dataType) {
  429. case Animation.ANIMATIONTYPE_FLOAT:
  430. key.values = [animationKey.value];
  431. break;
  432. case Animation.ANIMATIONTYPE_QUATERNION:
  433. case Animation.ANIMATIONTYPE_MATRIX:
  434. case Animation.ANIMATIONTYPE_VECTOR3:
  435. case Animation.ANIMATIONTYPE_COLOR3:
  436. key.values = animationKey.value.asArray();
  437. break;
  438. }
  439. serializationObject.keys.push(key);
  440. }
  441. serializationObject.ranges = [];
  442. for (var name in this._ranges) {
  443. var source = this._ranges[name];
  444. if (!source) {
  445. continue;
  446. }
  447. var range = {};
  448. range.name = name;
  449. range.from = source.from;
  450. range.to = source.to;
  451. serializationObject.ranges.push(range);
  452. }
  453. return serializationObject;
  454. };
  455. Object.defineProperty(Animation, "ANIMATIONTYPE_FLOAT", {
  456. get: function () {
  457. return Animation._ANIMATIONTYPE_FLOAT;
  458. },
  459. enumerable: true,
  460. configurable: true
  461. });
  462. Object.defineProperty(Animation, "ANIMATIONTYPE_VECTOR3", {
  463. get: function () {
  464. return Animation._ANIMATIONTYPE_VECTOR3;
  465. },
  466. enumerable: true,
  467. configurable: true
  468. });
  469. Object.defineProperty(Animation, "ANIMATIONTYPE_VECTOR2", {
  470. get: function () {
  471. return Animation._ANIMATIONTYPE_VECTOR2;
  472. },
  473. enumerable: true,
  474. configurable: true
  475. });
  476. Object.defineProperty(Animation, "ANIMATIONTYPE_SIZE", {
  477. get: function () {
  478. return Animation._ANIMATIONTYPE_SIZE;
  479. },
  480. enumerable: true,
  481. configurable: true
  482. });
  483. Object.defineProperty(Animation, "ANIMATIONTYPE_QUATERNION", {
  484. get: function () {
  485. return Animation._ANIMATIONTYPE_QUATERNION;
  486. },
  487. enumerable: true,
  488. configurable: true
  489. });
  490. Object.defineProperty(Animation, "ANIMATIONTYPE_MATRIX", {
  491. get: function () {
  492. return Animation._ANIMATIONTYPE_MATRIX;
  493. },
  494. enumerable: true,
  495. configurable: true
  496. });
  497. Object.defineProperty(Animation, "ANIMATIONTYPE_COLOR3", {
  498. get: function () {
  499. return Animation._ANIMATIONTYPE_COLOR3;
  500. },
  501. enumerable: true,
  502. configurable: true
  503. });
  504. Object.defineProperty(Animation, "ANIMATIONLOOPMODE_RELATIVE", {
  505. get: function () {
  506. return Animation._ANIMATIONLOOPMODE_RELATIVE;
  507. },
  508. enumerable: true,
  509. configurable: true
  510. });
  511. Object.defineProperty(Animation, "ANIMATIONLOOPMODE_CYCLE", {
  512. get: function () {
  513. return Animation._ANIMATIONLOOPMODE_CYCLE;
  514. },
  515. enumerable: true,
  516. configurable: true
  517. });
  518. Object.defineProperty(Animation, "ANIMATIONLOOPMODE_CONSTANT", {
  519. get: function () {
  520. return Animation._ANIMATIONLOOPMODE_CONSTANT;
  521. },
  522. enumerable: true,
  523. configurable: true
  524. });
  525. Animation.Parse = function (parsedAnimation) {
  526. var animation = new Animation(parsedAnimation.name, parsedAnimation.property, parsedAnimation.framePerSecond, parsedAnimation.dataType, parsedAnimation.loopBehavior);
  527. var dataType = parsedAnimation.dataType;
  528. var keys = [];
  529. var data;
  530. var index;
  531. if (parsedAnimation.enableBlending) {
  532. animation.enableBlending = parsedAnimation.enableBlending;
  533. }
  534. if (parsedAnimation.blendingSpeed) {
  535. animation.blendingSpeed = parsedAnimation.blendingSpeed;
  536. }
  537. for (index = 0; index < parsedAnimation.keys.length; index++) {
  538. var key = parsedAnimation.keys[index];
  539. var inTangent;
  540. var outTangent;
  541. switch (dataType) {
  542. case Animation.ANIMATIONTYPE_FLOAT:
  543. data = key.values[0];
  544. if (key.values.length >= 1) {
  545. inTangent = key.values[1];
  546. }
  547. if (key.values.length >= 2) {
  548. outTangent = key.values[2];
  549. }
  550. break;
  551. case Animation.ANIMATIONTYPE_QUATERNION:
  552. data = BABYLON.Quaternion.FromArray(key.values);
  553. if (key.values.length >= 8) {
  554. var _inTangent = BABYLON.Quaternion.FromArray(key.values.slice(4, 8));
  555. if (!_inTangent.equals(BABYLON.Quaternion.Zero())) {
  556. inTangent = _inTangent;
  557. }
  558. }
  559. if (key.values.length >= 12) {
  560. var _outTangent = BABYLON.Quaternion.FromArray(key.values.slice(8, 12));
  561. if (!_outTangent.equals(BABYLON.Quaternion.Zero())) {
  562. outTangent = _outTangent;
  563. }
  564. }
  565. break;
  566. case Animation.ANIMATIONTYPE_MATRIX:
  567. data = BABYLON.Matrix.FromArray(key.values);
  568. break;
  569. case Animation.ANIMATIONTYPE_COLOR3:
  570. data = BABYLON.Color3.FromArray(key.values);
  571. break;
  572. case Animation.ANIMATIONTYPE_VECTOR3:
  573. default:
  574. data = BABYLON.Vector3.FromArray(key.values);
  575. break;
  576. }
  577. var keyData = {};
  578. keyData.frame = key.frame;
  579. keyData.value = data;
  580. if (inTangent != undefined) {
  581. keyData.inTangent = inTangent;
  582. }
  583. if (outTangent != undefined) {
  584. keyData.outTangent = outTangent;
  585. }
  586. keys.push(keyData);
  587. }
  588. animation.setKeys(keys);
  589. if (parsedAnimation.ranges) {
  590. for (index = 0; index < parsedAnimation.ranges.length; index++) {
  591. data = parsedAnimation.ranges[index];
  592. animation.createRange(data.name, data.from, data.to);
  593. }
  594. }
  595. return animation;
  596. };
  597. Animation.AppendSerializedAnimations = function (source, destination) {
  598. if (source.animations) {
  599. destination.animations = [];
  600. for (var animationIndex = 0; animationIndex < source.animations.length; animationIndex++) {
  601. var animation = source.animations[animationIndex];
  602. destination.animations.push(animation.serialize());
  603. }
  604. }
  605. };
  606. Animation.AllowMatricesInterpolation = false;
  607. // Statics
  608. Animation._ANIMATIONTYPE_FLOAT = 0;
  609. Animation._ANIMATIONTYPE_VECTOR3 = 1;
  610. Animation._ANIMATIONTYPE_QUATERNION = 2;
  611. Animation._ANIMATIONTYPE_MATRIX = 3;
  612. Animation._ANIMATIONTYPE_COLOR3 = 4;
  613. Animation._ANIMATIONTYPE_VECTOR2 = 5;
  614. Animation._ANIMATIONTYPE_SIZE = 6;
  615. Animation._ANIMATIONLOOPMODE_RELATIVE = 0;
  616. Animation._ANIMATIONLOOPMODE_CYCLE = 1;
  617. Animation._ANIMATIONLOOPMODE_CONSTANT = 2;
  618. return Animation;
  619. }());
  620. BABYLON.Animation = Animation;
  621. })(BABYLON || (BABYLON = {}));
  622. //# sourceMappingURL=babylon.animation.js.map
  623. var BABYLON;
  624. (function (BABYLON) {
  625. /**
  626. * This class defines the direct association between an animation and a target
  627. */
  628. var TargetedAnimation = /** @class */ (function () {
  629. function TargetedAnimation() {
  630. }
  631. return TargetedAnimation;
  632. }());
  633. BABYLON.TargetedAnimation = TargetedAnimation;
  634. /**
  635. * Use this class to create coordinated animations on multiple targets
  636. */
  637. var AnimationGroup = /** @class */ (function () {
  638. function AnimationGroup(name, scene) {
  639. if (scene === void 0) { scene = null; }
  640. this.name = name;
  641. this._targetedAnimations = new Array();
  642. this._animatables = new Array();
  643. this._from = Number.MAX_VALUE;
  644. this._to = Number.MIN_VALUE;
  645. this._speedRatio = 1;
  646. this.onAnimationEndObservable = new BABYLON.Observable();
  647. this._scene = scene || BABYLON.Engine.LastCreatedScene;
  648. this._scene.animationGroups.push(this);
  649. }
  650. Object.defineProperty(AnimationGroup.prototype, "isStarted", {
  651. /**
  652. * Define if the animations are started
  653. */
  654. get: function () {
  655. return this._isStarted;
  656. },
  657. enumerable: true,
  658. configurable: true
  659. });
  660. Object.defineProperty(AnimationGroup.prototype, "speedRatio", {
  661. /**
  662. * Gets or sets the speed ratio to use for all animations
  663. */
  664. get: function () {
  665. return this._speedRatio;
  666. },
  667. /**
  668. * Gets or sets the speed ratio to use for all animations
  669. */
  670. set: function (value) {
  671. if (this._speedRatio === value) {
  672. return;
  673. }
  674. this._speedRatio = value;
  675. for (var index = 0; index < this._animatables.length; index++) {
  676. var animatable = this._animatables[index];
  677. animatable.speedRatio = this._speedRatio;
  678. }
  679. },
  680. enumerable: true,
  681. configurable: true
  682. });
  683. /**
  684. * Add an animation (with its target) in the group
  685. * @param animation defines the animation we want to add
  686. * @param target defines the target of the animation
  687. * @returns the {BABYLON.TargetedAnimation} object
  688. */
  689. AnimationGroup.prototype.addTargetedAnimation = function (animation, target) {
  690. var targetedAnimation = {
  691. animation: animation,
  692. target: target
  693. };
  694. var keys = animation.getKeys();
  695. if (this._from > keys[0].frame) {
  696. this._from = keys[0].frame;
  697. }
  698. if (this._to < keys[keys.length - 1].frame) {
  699. this._to = keys[keys.length - 1].frame;
  700. }
  701. this._targetedAnimations.push(targetedAnimation);
  702. return targetedAnimation;
  703. };
  704. /**
  705. * This function will normalize every animation in the group to make sure they all go from beginFrame to endFrame
  706. * It can add constant keys at begin or end
  707. * @param beginFrame defines the new begin frame for all animations. It can't be bigger than the smaller begin frame of all animations
  708. * @param endFrame defines the new end frame for all animations. It can't be smaller than the larger end frame of all animations
  709. */
  710. AnimationGroup.prototype.normalize = function (beginFrame, endFrame) {
  711. beginFrame = Math.min(beginFrame, this._from);
  712. endFrame = Math.min(endFrame, this._to);
  713. for (var index = 0; index < this._targetedAnimations.length; index++) {
  714. var targetedAnimation = this._targetedAnimations[index];
  715. var keys = targetedAnimation.animation.getKeys();
  716. var startKey = keys[0];
  717. var endKey = keys[keys.length - 1];
  718. if (startKey.frame > beginFrame) {
  719. var newKey = {
  720. frame: beginFrame,
  721. value: startKey.value,
  722. inTangent: startKey.inTangent,
  723. outTangent: startKey.outTangent
  724. };
  725. keys.splice(0, 0, newKey);
  726. }
  727. if (endKey.frame < endFrame) {
  728. var newKey = {
  729. frame: endFrame,
  730. value: endKey.value,
  731. inTangent: startKey.outTangent,
  732. outTangent: startKey.outTangent
  733. };
  734. keys.push(newKey);
  735. }
  736. }
  737. return this;
  738. };
  739. /**
  740. * Start all animations on given targets
  741. * @param loop defines if animations must loop
  742. * @param speedRatio defines the ratio to apply to animation speed (1 by default)
  743. */
  744. AnimationGroup.prototype.start = function (loop, speedRatio) {
  745. var _this = this;
  746. if (loop === void 0) { loop = false; }
  747. if (speedRatio === void 0) { speedRatio = 1; }
  748. if (this._isStarted || this._targetedAnimations.length === 0) {
  749. return this;
  750. }
  751. var _loop_1 = function () {
  752. var targetedAnimation = this_1._targetedAnimations[index];
  753. this_1._animatables.push(this_1._scene.beginDirectAnimation(targetedAnimation.target, [targetedAnimation.animation], this_1._from, this_1._to, loop, speedRatio, function () {
  754. _this.onAnimationEndObservable.notifyObservers(targetedAnimation);
  755. }));
  756. };
  757. var this_1 = this;
  758. for (var index = 0; index < this._targetedAnimations.length; index++) {
  759. _loop_1();
  760. }
  761. this._speedRatio = speedRatio;
  762. this._isStarted = true;
  763. return this;
  764. };
  765. /**
  766. * Pause all animations
  767. */
  768. AnimationGroup.prototype.pause = function () {
  769. if (!this._isStarted) {
  770. return this;
  771. }
  772. for (var index = 0; index < this._animatables.length; index++) {
  773. var animatable = this._animatables[index];
  774. animatable.pause();
  775. }
  776. return this;
  777. };
  778. /**
  779. * Play all animations to initial state
  780. * This function will start() the animations if they were not started or will restart() them if they were paused
  781. * @param loop defines if animations must loop
  782. */
  783. AnimationGroup.prototype.play = function (loop) {
  784. if (this.isStarted) {
  785. if (loop !== undefined) {
  786. for (var index = 0; index < this._animatables.length; index++) {
  787. var animatable = this._animatables[index];
  788. animatable.loopAnimation = loop;
  789. }
  790. }
  791. this.restart();
  792. }
  793. else {
  794. this.start(loop, this._speedRatio);
  795. }
  796. return this;
  797. };
  798. /**
  799. * Reset all animations to initial state
  800. */
  801. AnimationGroup.prototype.reset = function () {
  802. if (!this._isStarted) {
  803. return this;
  804. }
  805. for (var index = 0; index < this._animatables.length; index++) {
  806. var animatable = this._animatables[index];
  807. animatable.reset();
  808. }
  809. return this;
  810. };
  811. /**
  812. * Restart animations from key 0
  813. */
  814. AnimationGroup.prototype.restart = function () {
  815. if (!this._isStarted) {
  816. return this;
  817. }
  818. for (var index = 0; index < this._animatables.length; index++) {
  819. var animatable = this._animatables[index];
  820. animatable.restart();
  821. }
  822. return this;
  823. };
  824. /**
  825. * Stop all animations
  826. */
  827. AnimationGroup.prototype.stop = function () {
  828. if (!this._isStarted) {
  829. return this;
  830. }
  831. for (var index = 0; index < this._animatables.length; index++) {
  832. var animatable = this._animatables[index];
  833. animatable.stop();
  834. }
  835. this._isStarted = false;
  836. return this;
  837. };
  838. /**
  839. * Dispose all associated resources
  840. */
  841. AnimationGroup.prototype.dispose = function () {
  842. this._targetedAnimations = [];
  843. this._animatables = [];
  844. var index = this._scene.animationGroups.indexOf(this);
  845. if (index > -1) {
  846. this._scene.animationGroups.splice(index, 1);
  847. }
  848. };
  849. return AnimationGroup;
  850. }());
  851. BABYLON.AnimationGroup = AnimationGroup;
  852. })(BABYLON || (BABYLON = {}));
  853. //# sourceMappingURL=babylon.animationGroup.js.map
  854. 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}";
  855. 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}";
  856. var BABYLON;
  857. (function (BABYLON) {
  858. var RuntimeAnimation = /** @class */ (function () {
  859. function RuntimeAnimation(target, animation) {
  860. this._offsetsCache = {};
  861. this._highLimitsCache = {};
  862. this._stopped = false;
  863. this._blendingFactor = 0;
  864. this._ratioOffset = 0;
  865. this._animation = animation;
  866. this._target = target;
  867. animation._runtimeAnimations.push(this);
  868. }
  869. Object.defineProperty(RuntimeAnimation.prototype, "animation", {
  870. get: function () {
  871. return this._animation;
  872. },
  873. enumerable: true,
  874. configurable: true
  875. });
  876. RuntimeAnimation.prototype.reset = function () {
  877. this._offsetsCache = {};
  878. this._highLimitsCache = {};
  879. this.currentFrame = 0;
  880. this._blendingFactor = 0;
  881. this._originalBlendValue = null;
  882. };
  883. RuntimeAnimation.prototype.isStopped = function () {
  884. return this._stopped;
  885. };
  886. RuntimeAnimation.prototype.dispose = function () {
  887. var index = this._animation.runtimeAnimations.indexOf(this);
  888. if (index > -1) {
  889. this._animation.runtimeAnimations.splice(index, 1);
  890. }
  891. };
  892. RuntimeAnimation.prototype._getKeyValue = function (value) {
  893. if (typeof value === "function") {
  894. return value();
  895. }
  896. return value;
  897. };
  898. RuntimeAnimation.prototype._interpolate = function (currentFrame, repeatCount, loopMode, offsetValue, highLimitValue) {
  899. if (loopMode === BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT && repeatCount > 0) {
  900. return highLimitValue.clone ? highLimitValue.clone() : highLimitValue;
  901. }
  902. this.currentFrame = currentFrame;
  903. var keys = this._animation.getKeys();
  904. // Try to get a hash to find the right key
  905. 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));
  906. if (keys[startKeyIndex].frame >= currentFrame) {
  907. while (startKeyIndex - 1 >= 0 && keys[startKeyIndex].frame >= currentFrame) {
  908. startKeyIndex--;
  909. }
  910. }
  911. for (var key = startKeyIndex; key < keys.length; key++) {
  912. var endKey = keys[key + 1];
  913. if (endKey.frame >= currentFrame) {
  914. var startKey = keys[key];
  915. var startValue = this._getKeyValue(startKey.value);
  916. var endValue = this._getKeyValue(endKey.value);
  917. var useTangent = startKey.outTangent !== undefined && endKey.inTangent !== undefined;
  918. var frameDelta = endKey.frame - startKey.frame;
  919. // gradient : percent of currentFrame between the frame inf and the frame sup
  920. var gradient = (currentFrame - startKey.frame) / frameDelta;
  921. // check for easingFunction and correction of gradient
  922. var easingFunction = this._animation.getEasingFunction();
  923. if (easingFunction != null) {
  924. gradient = easingFunction.ease(gradient);
  925. }
  926. switch (this._animation.dataType) {
  927. // Float
  928. case BABYLON.Animation.ANIMATIONTYPE_FLOAT:
  929. var floatValue = useTangent ? this._animation.floatInterpolateFunctionWithTangents(startValue, startKey.outTangent * frameDelta, endValue, endKey.inTangent * frameDelta, gradient) : this._animation.floatInterpolateFunction(startValue, endValue, gradient);
  930. switch (loopMode) {
  931. case BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE:
  932. case BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT:
  933. return floatValue;
  934. case BABYLON.Animation.ANIMATIONLOOPMODE_RELATIVE:
  935. return offsetValue * repeatCount + floatValue;
  936. }
  937. break;
  938. // Quaternion
  939. case BABYLON.Animation.ANIMATIONTYPE_QUATERNION:
  940. var quatValue = useTangent ? this._animation.quaternionInterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient) : this._animation.quaternionInterpolateFunction(startValue, endValue, gradient);
  941. switch (loopMode) {
  942. case BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE:
  943. case BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT:
  944. return quatValue;
  945. case BABYLON.Animation.ANIMATIONLOOPMODE_RELATIVE:
  946. return quatValue.add(offsetValue.scale(repeatCount));
  947. }
  948. return quatValue;
  949. // Vector3
  950. case BABYLON.Animation.ANIMATIONTYPE_VECTOR3:
  951. var vec3Value = useTangent ? this._animation.vector3InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient) : this._animation.vector3InterpolateFunction(startValue, endValue, gradient);
  952. switch (loopMode) {
  953. case BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE:
  954. case BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT:
  955. return vec3Value;
  956. case BABYLON.Animation.ANIMATIONLOOPMODE_RELATIVE:
  957. return vec3Value.add(offsetValue.scale(repeatCount));
  958. }
  959. // Vector2
  960. case BABYLON.Animation.ANIMATIONTYPE_VECTOR2:
  961. var vec2Value = useTangent ? this._animation.vector2InterpolateFunctionWithTangents(startValue, startKey.outTangent.scale(frameDelta), endValue, endKey.inTangent.scale(frameDelta), gradient) : this._animation.vector2InterpolateFunction(startValue, endValue, gradient);
  962. switch (loopMode) {
  963. case BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE:
  964. case BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT:
  965. return vec2Value;
  966. case BABYLON.Animation.ANIMATIONLOOPMODE_RELATIVE:
  967. return vec2Value.add(offsetValue.scale(repeatCount));
  968. }
  969. // Size
  970. case BABYLON.Animation.ANIMATIONTYPE_SIZE:
  971. switch (loopMode) {
  972. case BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE:
  973. case BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT:
  974. return this._animation.sizeInterpolateFunction(startValue, endValue, gradient);
  975. case BABYLON.Animation.ANIMATIONLOOPMODE_RELATIVE:
  976. return this._animation.sizeInterpolateFunction(startValue, endValue, gradient).add(offsetValue.scale(repeatCount));
  977. }
  978. // Color3
  979. case BABYLON.Animation.ANIMATIONTYPE_COLOR3:
  980. switch (loopMode) {
  981. case BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE:
  982. case BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT:
  983. return this._animation.color3InterpolateFunction(startValue, endValue, gradient);
  984. case BABYLON.Animation.ANIMATIONLOOPMODE_RELATIVE:
  985. return this._animation.color3InterpolateFunction(startValue, endValue, gradient).add(offsetValue.scale(repeatCount));
  986. }
  987. // Matrix
  988. case BABYLON.Animation.ANIMATIONTYPE_MATRIX:
  989. switch (loopMode) {
  990. case BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE:
  991. case BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT:
  992. if (BABYLON.Animation.AllowMatricesInterpolation) {
  993. return this._animation.matrixInterpolateFunction(startValue, endValue, gradient);
  994. }
  995. case BABYLON.Animation.ANIMATIONLOOPMODE_RELATIVE:
  996. return startValue;
  997. }
  998. default:
  999. break;
  1000. }
  1001. break;
  1002. }
  1003. }
  1004. return this._getKeyValue(keys[keys.length - 1].value);
  1005. };
  1006. RuntimeAnimation.prototype.setValue = function (currentValue, blend) {
  1007. if (blend === void 0) { blend = false; }
  1008. // Set value
  1009. var path;
  1010. var destination;
  1011. var targetPropertyPath = this._animation.targetPropertyPath;
  1012. if (targetPropertyPath.length > 1) {
  1013. var property = this._target[targetPropertyPath[0]];
  1014. for (var index = 1; index < targetPropertyPath.length - 1; index++) {
  1015. property = property[targetPropertyPath[index]];
  1016. }
  1017. path = targetPropertyPath[targetPropertyPath.length - 1];
  1018. destination = property;
  1019. }
  1020. else {
  1021. path = targetPropertyPath[0];
  1022. destination = this._target;
  1023. }
  1024. // Blending
  1025. if (this._animation.enableBlending && this._blendingFactor <= 1.0) {
  1026. if (!this._originalBlendValue) {
  1027. if (destination[path].clone) {
  1028. this._originalBlendValue = destination[path].clone();
  1029. }
  1030. else {
  1031. this._originalBlendValue = destination[path];
  1032. }
  1033. }
  1034. if (this._originalBlendValue.prototype) {
  1035. if (this._originalBlendValue.prototype.Lerp) {
  1036. destination[path] = this._originalBlendValue.construtor.prototype.Lerp(currentValue, this._originalBlendValue, this._blendingFactor);
  1037. }
  1038. else {
  1039. destination[path] = currentValue;
  1040. }
  1041. }
  1042. else if (this._originalBlendValue.m) {
  1043. destination[path] = BABYLON.Matrix.Lerp(this._originalBlendValue, currentValue, this._blendingFactor);
  1044. }
  1045. else {
  1046. destination[path] = this._originalBlendValue * (1.0 - this._blendingFactor) + this._blendingFactor * currentValue;
  1047. }
  1048. this._blendingFactor += this._animation.blendingSpeed;
  1049. }
  1050. else {
  1051. destination[path] = currentValue;
  1052. }
  1053. if (this._target.markAsDirty) {
  1054. this._target.markAsDirty(this._animation.targetProperty);
  1055. }
  1056. };
  1057. RuntimeAnimation.prototype.goToFrame = function (frame) {
  1058. var keys = this._animation.getKeys();
  1059. if (frame < keys[0].frame) {
  1060. frame = keys[0].frame;
  1061. }
  1062. else if (frame > keys[keys.length - 1].frame) {
  1063. frame = keys[keys.length - 1].frame;
  1064. }
  1065. var currentValue = this._interpolate(frame, 0, this._animation.loopMode);
  1066. this.setValue(currentValue);
  1067. };
  1068. RuntimeAnimation.prototype._prepareForSpeedRatioChange = function (newSpeedRatio) {
  1069. var newRatio = this._previousDelay * (this._animation.framePerSecond * newSpeedRatio) / 1000.0;
  1070. this._ratioOffset = this._previousRatio - newRatio;
  1071. };
  1072. RuntimeAnimation.prototype.animate = function (delay, from, to, loop, speedRatio, blend) {
  1073. if (blend === void 0) { blend = false; }
  1074. var targetPropertyPath = this._animation.targetPropertyPath;
  1075. if (!targetPropertyPath || targetPropertyPath.length < 1) {
  1076. this._stopped = true;
  1077. return false;
  1078. }
  1079. var returnValue = true;
  1080. var keys = this._animation.getKeys();
  1081. // Adding a start key at frame 0 if missing
  1082. if (keys[0].frame !== 0) {
  1083. var newKey = { frame: 0, value: keys[0].value };
  1084. keys.splice(0, 0, newKey);
  1085. }
  1086. // Check limits
  1087. if (from < keys[0].frame || from > keys[keys.length - 1].frame) {
  1088. from = keys[0].frame;
  1089. }
  1090. if (to < keys[0].frame || to > keys[keys.length - 1].frame) {
  1091. to = keys[keys.length - 1].frame;
  1092. }
  1093. //to and from cannot be the same key
  1094. if (from === to) {
  1095. if (from > keys[0].frame) {
  1096. from--;
  1097. }
  1098. else if (to < keys[keys.length - 1].frame) {
  1099. to++;
  1100. }
  1101. }
  1102. // Compute ratio
  1103. var range = to - from;
  1104. var offsetValue;
  1105. // ratio represents the frame delta between from and to
  1106. var ratio = (delay * (this._animation.framePerSecond * speedRatio) / 1000.0) + this._ratioOffset;
  1107. var highLimitValue = 0;
  1108. this._previousDelay = delay;
  1109. this._previousRatio = ratio;
  1110. if (((to > from && ratio > range) || (from > to && ratio < range)) && !loop) {
  1111. returnValue = false;
  1112. highLimitValue = this._getKeyValue(keys[keys.length - 1].value);
  1113. }
  1114. else {
  1115. // Get max value if required
  1116. if (this._animation.loopMode !== BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE) {
  1117. var keyOffset = to.toString() + from.toString();
  1118. if (!this._offsetsCache[keyOffset]) {
  1119. var fromValue = this._interpolate(from, 0, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
  1120. var toValue = this._interpolate(to, 0, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
  1121. switch (this._animation.dataType) {
  1122. // Float
  1123. case BABYLON.Animation.ANIMATIONTYPE_FLOAT:
  1124. this._offsetsCache[keyOffset] = toValue - fromValue;
  1125. break;
  1126. // Quaternion
  1127. case BABYLON.Animation.ANIMATIONTYPE_QUATERNION:
  1128. this._offsetsCache[keyOffset] = toValue.subtract(fromValue);
  1129. break;
  1130. // Vector3
  1131. case BABYLON.Animation.ANIMATIONTYPE_VECTOR3:
  1132. this._offsetsCache[keyOffset] = toValue.subtract(fromValue);
  1133. // Vector2
  1134. case BABYLON.Animation.ANIMATIONTYPE_VECTOR2:
  1135. this._offsetsCache[keyOffset] = toValue.subtract(fromValue);
  1136. // Size
  1137. case BABYLON.Animation.ANIMATIONTYPE_SIZE:
  1138. this._offsetsCache[keyOffset] = toValue.subtract(fromValue);
  1139. // Color3
  1140. case BABYLON.Animation.ANIMATIONTYPE_COLOR3:
  1141. this._offsetsCache[keyOffset] = toValue.subtract(fromValue);
  1142. default:
  1143. break;
  1144. }
  1145. this._highLimitsCache[keyOffset] = toValue;
  1146. }
  1147. highLimitValue = this._highLimitsCache[keyOffset];
  1148. offsetValue = this._offsetsCache[keyOffset];
  1149. }
  1150. }
  1151. if (offsetValue === undefined) {
  1152. switch (this._animation.dataType) {
  1153. // Float
  1154. case BABYLON.Animation.ANIMATIONTYPE_FLOAT:
  1155. offsetValue = 0;
  1156. break;
  1157. // Quaternion
  1158. case BABYLON.Animation.ANIMATIONTYPE_QUATERNION:
  1159. offsetValue = new BABYLON.Quaternion(0, 0, 0, 0);
  1160. break;
  1161. // Vector3
  1162. case BABYLON.Animation.ANIMATIONTYPE_VECTOR3:
  1163. offsetValue = BABYLON.Vector3.Zero();
  1164. break;
  1165. // Vector2
  1166. case BABYLON.Animation.ANIMATIONTYPE_VECTOR2:
  1167. offsetValue = BABYLON.Vector2.Zero();
  1168. break;
  1169. // Size
  1170. case BABYLON.Animation.ANIMATIONTYPE_SIZE:
  1171. offsetValue = BABYLON.Size.Zero();
  1172. break;
  1173. // Color3
  1174. case BABYLON.Animation.ANIMATIONTYPE_COLOR3:
  1175. offsetValue = BABYLON.Color3.Black();
  1176. }
  1177. }
  1178. // Compute value
  1179. var repeatCount = (ratio / range) >> 0;
  1180. var currentFrame = returnValue ? from + ratio % range : to;
  1181. var currentValue = this._interpolate(currentFrame, repeatCount, this._animation.loopMode, offsetValue, highLimitValue);
  1182. // Set value
  1183. this.setValue(currentValue);
  1184. // Check events
  1185. var events = this._animation.getEvents();
  1186. for (var index = 0; index < events.length; index++) {
  1187. // Make sure current frame has passed event frame and that event frame is within the current range
  1188. // Also, handle both forward and reverse animations
  1189. if ((range > 0 && currentFrame >= events[index].frame && events[index].frame >= from) ||
  1190. (range < 0 && currentFrame <= events[index].frame && events[index].frame <= from)) {
  1191. var event = events[index];
  1192. if (!event.isDone) {
  1193. // If event should be done only once, remove it.
  1194. if (event.onlyOnce) {
  1195. events.splice(index, 1);
  1196. index--;
  1197. }
  1198. event.isDone = true;
  1199. event.action();
  1200. } // Don't do anything if the event has already be done.
  1201. }
  1202. else if (events[index].isDone && !events[index].onlyOnce) {
  1203. // reset event, the animation is looping
  1204. events[index].isDone = false;
  1205. }
  1206. }
  1207. if (!returnValue) {
  1208. this._stopped = true;
  1209. }
  1210. return returnValue;
  1211. };
  1212. return RuntimeAnimation;
  1213. }());
  1214. BABYLON.RuntimeAnimation = RuntimeAnimation;
  1215. })(BABYLON || (BABYLON = {}));
  1216. //# sourceMappingURL=babylon.runtimeAnimation.js.map
  1217. var BABYLON;
  1218. (function (BABYLON) {
  1219. var Animatable = /** @class */ (function () {
  1220. function Animatable(scene, target, fromFrame, toFrame, loopAnimation, speedRatio, onAnimationEnd, animations) {
  1221. if (fromFrame === void 0) { fromFrame = 0; }
  1222. if (toFrame === void 0) { toFrame = 100; }
  1223. if (loopAnimation === void 0) { loopAnimation = false; }
  1224. if (speedRatio === void 0) { speedRatio = 1.0; }
  1225. this.target = target;
  1226. this.fromFrame = fromFrame;
  1227. this.toFrame = toFrame;
  1228. this.loopAnimation = loopAnimation;
  1229. this.onAnimationEnd = onAnimationEnd;
  1230. this._localDelayOffset = null;
  1231. this._pausedDelay = null;
  1232. this._runtimeAnimations = new Array();
  1233. this._paused = false;
  1234. this._speedRatio = 1;
  1235. this.animationStarted = false;
  1236. if (animations) {
  1237. this.appendAnimations(target, animations);
  1238. }
  1239. this._speedRatio = speedRatio;
  1240. this._scene = scene;
  1241. scene._activeAnimatables.push(this);
  1242. }
  1243. Object.defineProperty(Animatable.prototype, "speedRatio", {
  1244. get: function () {
  1245. return this._speedRatio;
  1246. },
  1247. set: function (value) {
  1248. for (var index = 0; index < this._runtimeAnimations.length; index++) {
  1249. var animation = this._runtimeAnimations[index];
  1250. animation._prepareForSpeedRatioChange(value);
  1251. }
  1252. this._speedRatio = value;
  1253. },
  1254. enumerable: true,
  1255. configurable: true
  1256. });
  1257. // Methods
  1258. Animatable.prototype.getAnimations = function () {
  1259. return this._runtimeAnimations;
  1260. };
  1261. Animatable.prototype.appendAnimations = function (target, animations) {
  1262. for (var index = 0; index < animations.length; index++) {
  1263. var animation = animations[index];
  1264. this._runtimeAnimations.push(new BABYLON.RuntimeAnimation(target, animation));
  1265. }
  1266. };
  1267. Animatable.prototype.getAnimationByTargetProperty = function (property) {
  1268. var runtimeAnimations = this._runtimeAnimations;
  1269. for (var index = 0; index < runtimeAnimations.length; index++) {
  1270. if (runtimeAnimations[index].animation.targetProperty === property) {
  1271. return runtimeAnimations[index].animation;
  1272. }
  1273. }
  1274. return null;
  1275. };
  1276. Animatable.prototype.getRuntimeAnimationByTargetProperty = function (property) {
  1277. var runtimeAnimations = this._runtimeAnimations;
  1278. for (var index = 0; index < runtimeAnimations.length; index++) {
  1279. if (runtimeAnimations[index].animation.targetProperty === property) {
  1280. return runtimeAnimations[index];
  1281. }
  1282. }
  1283. return null;
  1284. };
  1285. Animatable.prototype.reset = function () {
  1286. var runtimeAnimations = this._runtimeAnimations;
  1287. for (var index = 0; index < runtimeAnimations.length; index++) {
  1288. runtimeAnimations[index].reset();
  1289. }
  1290. // Reset to original value
  1291. for (index = 0; index < runtimeAnimations.length; index++) {
  1292. var animation = runtimeAnimations[index];
  1293. animation.animate(0, this.fromFrame, this.toFrame, false, this._speedRatio);
  1294. }
  1295. this._localDelayOffset = null;
  1296. this._pausedDelay = null;
  1297. };
  1298. Animatable.prototype.enableBlending = function (blendingSpeed) {
  1299. var runtimeAnimations = this._runtimeAnimations;
  1300. for (var index = 0; index < runtimeAnimations.length; index++) {
  1301. runtimeAnimations[index].animation.enableBlending = true;
  1302. runtimeAnimations[index].animation.blendingSpeed = blendingSpeed;
  1303. }
  1304. };
  1305. Animatable.prototype.disableBlending = function () {
  1306. var runtimeAnimations = this._runtimeAnimations;
  1307. for (var index = 0; index < runtimeAnimations.length; index++) {
  1308. runtimeAnimations[index].animation.enableBlending = false;
  1309. }
  1310. };
  1311. Animatable.prototype.goToFrame = function (frame) {
  1312. var runtimeAnimations = this._runtimeAnimations;
  1313. if (runtimeAnimations[0]) {
  1314. var fps = runtimeAnimations[0].animation.framePerSecond;
  1315. var currentFrame = runtimeAnimations[0].currentFrame;
  1316. var adjustTime = frame - currentFrame;
  1317. var delay = adjustTime * 1000 / fps;
  1318. if (this._localDelayOffset === null) {
  1319. this._localDelayOffset = 0;
  1320. }
  1321. this._localDelayOffset -= delay;
  1322. }
  1323. for (var index = 0; index < runtimeAnimations.length; index++) {
  1324. runtimeAnimations[index].goToFrame(frame);
  1325. }
  1326. };
  1327. Animatable.prototype.pause = function () {
  1328. if (this._paused) {
  1329. return;
  1330. }
  1331. this._paused = true;
  1332. };
  1333. Animatable.prototype.restart = function () {
  1334. this._paused = false;
  1335. };
  1336. Animatable.prototype.stop = function (animationName) {
  1337. if (animationName) {
  1338. var idx = this._scene._activeAnimatables.indexOf(this);
  1339. if (idx > -1) {
  1340. var runtimeAnimations = this._runtimeAnimations;
  1341. for (var index = runtimeAnimations.length - 1; index >= 0; index--) {
  1342. if (typeof animationName === "string" && runtimeAnimations[index].animation.name != animationName) {
  1343. continue;
  1344. }
  1345. runtimeAnimations[index].dispose();
  1346. runtimeAnimations.splice(index, 1);
  1347. }
  1348. if (runtimeAnimations.length == 0) {
  1349. this._scene._activeAnimatables.splice(idx, 1);
  1350. if (this.onAnimationEnd) {
  1351. this.onAnimationEnd();
  1352. }
  1353. }
  1354. }
  1355. }
  1356. else {
  1357. var index = this._scene._activeAnimatables.indexOf(this);
  1358. if (index > -1) {
  1359. this._scene._activeAnimatables.splice(index, 1);
  1360. var runtimeAnimations = this._runtimeAnimations;
  1361. for (var index = 0; index < runtimeAnimations.length; index++) {
  1362. runtimeAnimations[index].dispose();
  1363. }
  1364. if (this.onAnimationEnd) {
  1365. this.onAnimationEnd();
  1366. }
  1367. }
  1368. }
  1369. };
  1370. Animatable.prototype._animate = function (delay) {
  1371. if (this._paused) {
  1372. this.animationStarted = false;
  1373. if (this._pausedDelay === null) {
  1374. this._pausedDelay = delay;
  1375. }
  1376. return true;
  1377. }
  1378. if (this._localDelayOffset === null) {
  1379. this._localDelayOffset = delay;
  1380. }
  1381. else if (this._pausedDelay !== null) {
  1382. this._localDelayOffset += delay - this._pausedDelay;
  1383. this._pausedDelay = null;
  1384. }
  1385. // Animating
  1386. var running = false;
  1387. var runtimeAnimations = this._runtimeAnimations;
  1388. var index;
  1389. for (index = 0; index < runtimeAnimations.length; index++) {
  1390. var animation = runtimeAnimations[index];
  1391. var isRunning = animation.animate(delay - this._localDelayOffset, this.fromFrame, this.toFrame, this.loopAnimation, this._speedRatio);
  1392. running = running || isRunning;
  1393. }
  1394. this.animationStarted = running;
  1395. if (!running) {
  1396. // Remove from active animatables
  1397. index = this._scene._activeAnimatables.indexOf(this);
  1398. this._scene._activeAnimatables.splice(index, 1);
  1399. // Dispose all runtime animations
  1400. for (index = 0; index < runtimeAnimations.length; index++) {
  1401. runtimeAnimations[index].dispose();
  1402. }
  1403. }
  1404. if (!running && this.onAnimationEnd) {
  1405. this.onAnimationEnd();
  1406. this.onAnimationEnd = null;
  1407. }
  1408. return running;
  1409. };
  1410. return Animatable;
  1411. }());
  1412. BABYLON.Animatable = Animatable;
  1413. })(BABYLON || (BABYLON = {}));
  1414. //# sourceMappingURL=babylon.animatable.js.map
  1415. var BABYLON;
  1416. (function (BABYLON) {
  1417. var EasingFunction = /** @class */ (function () {
  1418. function EasingFunction() {
  1419. // Properties
  1420. this._easingMode = EasingFunction.EASINGMODE_EASEIN;
  1421. }
  1422. Object.defineProperty(EasingFunction, "EASINGMODE_EASEIN", {
  1423. get: function () {
  1424. return EasingFunction._EASINGMODE_EASEIN;
  1425. },
  1426. enumerable: true,
  1427. configurable: true
  1428. });
  1429. Object.defineProperty(EasingFunction, "EASINGMODE_EASEOUT", {
  1430. get: function () {
  1431. return EasingFunction._EASINGMODE_EASEOUT;
  1432. },
  1433. enumerable: true,
  1434. configurable: true
  1435. });
  1436. Object.defineProperty(EasingFunction, "EASINGMODE_EASEINOUT", {
  1437. get: function () {
  1438. return EasingFunction._EASINGMODE_EASEINOUT;
  1439. },
  1440. enumerable: true,
  1441. configurable: true
  1442. });
  1443. EasingFunction.prototype.setEasingMode = function (easingMode) {
  1444. var n = Math.min(Math.max(easingMode, 0), 2);
  1445. this._easingMode = n;
  1446. };
  1447. EasingFunction.prototype.getEasingMode = function () {
  1448. return this._easingMode;
  1449. };
  1450. EasingFunction.prototype.easeInCore = function (gradient) {
  1451. throw new Error('You must implement this method');
  1452. };
  1453. EasingFunction.prototype.ease = function (gradient) {
  1454. switch (this._easingMode) {
  1455. case EasingFunction.EASINGMODE_EASEIN:
  1456. return this.easeInCore(gradient);
  1457. case EasingFunction.EASINGMODE_EASEOUT:
  1458. return (1 - this.easeInCore(1 - gradient));
  1459. }
  1460. if (gradient >= 0.5) {
  1461. return (((1 - this.easeInCore((1 - gradient) * 2)) * 0.5) + 0.5);
  1462. }
  1463. return (this.easeInCore(gradient * 2) * 0.5);
  1464. };
  1465. //Statics
  1466. EasingFunction._EASINGMODE_EASEIN = 0;
  1467. EasingFunction._EASINGMODE_EASEOUT = 1;
  1468. EasingFunction._EASINGMODE_EASEINOUT = 2;
  1469. return EasingFunction;
  1470. }());
  1471. BABYLON.EasingFunction = EasingFunction;
  1472. var CircleEase = /** @class */ (function (_super) {
  1473. __extends(CircleEase, _super);
  1474. function CircleEase() {
  1475. return _super !== null && _super.apply(this, arguments) || this;
  1476. }
  1477. CircleEase.prototype.easeInCore = function (gradient) {
  1478. gradient = Math.max(0, Math.min(1, gradient));
  1479. return (1.0 - Math.sqrt(1.0 - (gradient * gradient)));
  1480. };
  1481. return CircleEase;
  1482. }(EasingFunction));
  1483. BABYLON.CircleEase = CircleEase;
  1484. var BackEase = /** @class */ (function (_super) {
  1485. __extends(BackEase, _super);
  1486. function BackEase(amplitude) {
  1487. if (amplitude === void 0) { amplitude = 1; }
  1488. var _this = _super.call(this) || this;
  1489. _this.amplitude = amplitude;
  1490. return _this;
  1491. }
  1492. BackEase.prototype.easeInCore = function (gradient) {
  1493. var num = Math.max(0, this.amplitude);
  1494. return (Math.pow(gradient, 3.0) - ((gradient * num) * Math.sin(3.1415926535897931 * gradient)));
  1495. };
  1496. return BackEase;
  1497. }(EasingFunction));
  1498. BABYLON.BackEase = BackEase;
  1499. var BounceEase = /** @class */ (function (_super) {
  1500. __extends(BounceEase, _super);
  1501. function BounceEase(bounces, bounciness) {
  1502. if (bounces === void 0) { bounces = 3; }
  1503. if (bounciness === void 0) { bounciness = 2; }
  1504. var _this = _super.call(this) || this;
  1505. _this.bounces = bounces;
  1506. _this.bounciness = bounciness;
  1507. return _this;
  1508. }
  1509. BounceEase.prototype.easeInCore = function (gradient) {
  1510. var y = Math.max(0.0, this.bounces);
  1511. var bounciness = this.bounciness;
  1512. if (bounciness <= 1.0) {
  1513. bounciness = 1.001;
  1514. }
  1515. var num9 = Math.pow(bounciness, y);
  1516. var num5 = 1.0 - bounciness;
  1517. var num4 = ((1.0 - num9) / num5) + (num9 * 0.5);
  1518. var num15 = gradient * num4;
  1519. var num65 = Math.log((-num15 * (1.0 - bounciness)) + 1.0) / Math.log(bounciness);
  1520. var num3 = Math.floor(num65);
  1521. var num13 = num3 + 1.0;
  1522. var num8 = (1.0 - Math.pow(bounciness, num3)) / (num5 * num4);
  1523. var num12 = (1.0 - Math.pow(bounciness, num13)) / (num5 * num4);
  1524. var num7 = (num8 + num12) * 0.5;
  1525. var num6 = gradient - num7;
  1526. var num2 = num7 - num8;
  1527. return (((-Math.pow(1.0 / bounciness, y - num3) / (num2 * num2)) * (num6 - num2)) * (num6 + num2));
  1528. };
  1529. return BounceEase;
  1530. }(EasingFunction));
  1531. BABYLON.BounceEase = BounceEase;
  1532. var CubicEase = /** @class */ (function (_super) {
  1533. __extends(CubicEase, _super);
  1534. function CubicEase() {
  1535. return _super !== null && _super.apply(this, arguments) || this;
  1536. }
  1537. CubicEase.prototype.easeInCore = function (gradient) {
  1538. return (gradient * gradient * gradient);
  1539. };
  1540. return CubicEase;
  1541. }(EasingFunction));
  1542. BABYLON.CubicEase = CubicEase;
  1543. var ElasticEase = /** @class */ (function (_super) {
  1544. __extends(ElasticEase, _super);
  1545. function ElasticEase(oscillations, springiness) {
  1546. if (oscillations === void 0) { oscillations = 3; }
  1547. if (springiness === void 0) { springiness = 3; }
  1548. var _this = _super.call(this) || this;
  1549. _this.oscillations = oscillations;
  1550. _this.springiness = springiness;
  1551. return _this;
  1552. }
  1553. ElasticEase.prototype.easeInCore = function (gradient) {
  1554. var num2;
  1555. var num3 = Math.max(0.0, this.oscillations);
  1556. var num = Math.max(0.0, this.springiness);
  1557. if (num == 0) {
  1558. num2 = gradient;
  1559. }
  1560. else {
  1561. num2 = (Math.exp(num * gradient) - 1.0) / (Math.exp(num) - 1.0);
  1562. }
  1563. return (num2 * Math.sin(((6.2831853071795862 * num3) + 1.5707963267948966) * gradient));
  1564. };
  1565. return ElasticEase;
  1566. }(EasingFunction));
  1567. BABYLON.ElasticEase = ElasticEase;
  1568. var ExponentialEase = /** @class */ (function (_super) {
  1569. __extends(ExponentialEase, _super);
  1570. function ExponentialEase(exponent) {
  1571. if (exponent === void 0) { exponent = 2; }
  1572. var _this = _super.call(this) || this;
  1573. _this.exponent = exponent;
  1574. return _this;
  1575. }
  1576. ExponentialEase.prototype.easeInCore = function (gradient) {
  1577. if (this.exponent <= 0) {
  1578. return gradient;
  1579. }
  1580. return ((Math.exp(this.exponent * gradient) - 1.0) / (Math.exp(this.exponent) - 1.0));
  1581. };
  1582. return ExponentialEase;
  1583. }(EasingFunction));
  1584. BABYLON.ExponentialEase = ExponentialEase;
  1585. var PowerEase = /** @class */ (function (_super) {
  1586. __extends(PowerEase, _super);
  1587. function PowerEase(power) {
  1588. if (power === void 0) { power = 2; }
  1589. var _this = _super.call(this) || this;
  1590. _this.power = power;
  1591. return _this;
  1592. }
  1593. PowerEase.prototype.easeInCore = function (gradient) {
  1594. var y = Math.max(0.0, this.power);
  1595. return Math.pow(gradient, y);
  1596. };
  1597. return PowerEase;
  1598. }(EasingFunction));
  1599. BABYLON.PowerEase = PowerEase;
  1600. var QuadraticEase = /** @class */ (function (_super) {
  1601. __extends(QuadraticEase, _super);
  1602. function QuadraticEase() {
  1603. return _super !== null && _super.apply(this, arguments) || this;
  1604. }
  1605. QuadraticEase.prototype.easeInCore = function (gradient) {
  1606. return (gradient * gradient);
  1607. };
  1608. return QuadraticEase;
  1609. }(EasingFunction));
  1610. BABYLON.QuadraticEase = QuadraticEase;
  1611. var QuarticEase = /** @class */ (function (_super) {
  1612. __extends(QuarticEase, _super);
  1613. function QuarticEase() {
  1614. return _super !== null && _super.apply(this, arguments) || this;
  1615. }
  1616. QuarticEase.prototype.easeInCore = function (gradient) {
  1617. return (gradient * gradient * gradient * gradient);
  1618. };
  1619. return QuarticEase;
  1620. }(EasingFunction));
  1621. BABYLON.QuarticEase = QuarticEase;
  1622. var QuinticEase = /** @class */ (function (_super) {
  1623. __extends(QuinticEase, _super);
  1624. function QuinticEase() {
  1625. return _super !== null && _super.apply(this, arguments) || this;
  1626. }
  1627. QuinticEase.prototype.easeInCore = function (gradient) {
  1628. return (gradient * gradient * gradient * gradient * gradient);
  1629. };
  1630. return QuinticEase;
  1631. }(EasingFunction));
  1632. BABYLON.QuinticEase = QuinticEase;
  1633. var SineEase = /** @class */ (function (_super) {
  1634. __extends(SineEase, _super);
  1635. function SineEase() {
  1636. return _super !== null && _super.apply(this, arguments) || this;
  1637. }
  1638. SineEase.prototype.easeInCore = function (gradient) {
  1639. return (1.0 - Math.sin(1.5707963267948966 * (1.0 - gradient)));
  1640. };
  1641. return SineEase;
  1642. }(EasingFunction));
  1643. BABYLON.SineEase = SineEase;
  1644. var BezierCurveEase = /** @class */ (function (_super) {
  1645. __extends(BezierCurveEase, _super);
  1646. function BezierCurveEase(x1, y1, x2, y2) {
  1647. if (x1 === void 0) { x1 = 0; }
  1648. if (y1 === void 0) { y1 = 0; }
  1649. if (x2 === void 0) { x2 = 1; }
  1650. if (y2 === void 0) { y2 = 1; }
  1651. var _this = _super.call(this) || this;
  1652. _this.x1 = x1;
  1653. _this.y1 = y1;
  1654. _this.x2 = x2;
  1655. _this.y2 = y2;
  1656. return _this;
  1657. }
  1658. BezierCurveEase.prototype.easeInCore = function (gradient) {
  1659. return BABYLON.BezierCurve.interpolate(gradient, this.x1, this.y1, this.x2, this.y2);
  1660. };
  1661. return BezierCurveEase;
  1662. }(EasingFunction));
  1663. BABYLON.BezierCurveEase = BezierCurveEase;
  1664. })(BABYLON || (BABYLON = {}));
  1665. //# sourceMappingURL=babylon.easing.js.map
  1666. BABYLON.Effect.IncludesShadersStore['depthPrePass'] = "#ifdef DEPTHPREPASS\ngl_FragColor=vec4(0.,0.,0.,1.0);\nreturn;\n#endif";
  1667. 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";
  1668. 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";
  1669. BABYLON.Effect.IncludesShadersStore['pointCloudVertexDeclaration'] = "#ifdef POINTSIZE\nuniform float pointSize;\n#endif";
  1670. BABYLON.Effect.IncludesShadersStore['bumpVertexDeclaration'] = "#if defined(BUMP) || defined(PARALLAX)\n#if defined(TANGENT) && defined(NORMAL) \nvarying mat3 vTBN;\n#endif\n#endif\n";
  1671. BABYLON.Effect.IncludesShadersStore['clipPlaneVertexDeclaration'] = "#ifdef CLIPPLANE\nuniform vec4 vClipPlane;\nvarying float fClipDistance;\n#endif";
  1672. BABYLON.Effect.IncludesShadersStore['fogVertexDeclaration'] = "#ifdef FOG\nvarying vec3 vFogDistance;\n#endif";
  1673. BABYLON.Effect.IncludesShadersStore['morphTargetsVertexGlobalDeclaration'] = "#ifdef MORPHTARGETS\nuniform float morphTargetInfluences[NUM_MORPH_INFLUENCERS];\n#endif";
  1674. 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";
  1675. BABYLON.Effect.IncludesShadersStore['logDepthDeclaration'] = "#ifdef LOGARITHMICDEPTH\nuniform float logarithmicDepthConstant;\nvarying float vFragmentDepth;\n#endif";
  1676. 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";
  1677. BABYLON.Effect.IncludesShadersStore['instancesVertex'] = "#ifdef INSTANCES\nmat4 finalWorld=mat4(world0,world1,world2,world3);\n#else\nmat4 finalWorld=world;\n#endif";
  1678. 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";
  1679. 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";
  1680. BABYLON.Effect.IncludesShadersStore['clipPlaneVertex'] = "#ifdef CLIPPLANE\nfClipDistance=dot(worldPos,vClipPlane);\n#endif";
  1681. BABYLON.Effect.IncludesShadersStore['fogVertex'] = "#ifdef FOG\nvFogDistance=(view*worldPos).xyz;\n#endif";
  1682. 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";
  1683. BABYLON.Effect.IncludesShadersStore['pointCloudVertex'] = "#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif";
  1684. BABYLON.Effect.IncludesShadersStore['logDepthVertex'] = "#ifdef LOGARITHMICDEPTH\nvFragmentDepth=1.0+gl_Position.w;\ngl_Position.z=log2(max(0.000001,vFragmentDepth))*logarithmicDepthConstant;\n#endif";
  1685. 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}";
  1686. 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";
  1687. 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";
  1688. 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";
  1689. 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";
  1690. 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";
  1691. 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};";
  1692. 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";
  1693. 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";
  1694. 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}";
  1695. 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";
  1696. 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}";
  1697. 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";
  1698. BABYLON.Effect.IncludesShadersStore['clipPlaneFragmentDeclaration'] = "#ifdef CLIPPLANE\nvarying float fClipDistance;\n#endif";
  1699. 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";
  1700. BABYLON.Effect.IncludesShadersStore['clipPlaneFragment'] = "#ifdef CLIPPLANE\nif (fClipDistance>0.0)\n{\ndiscard;\n}\n#endif";
  1701. 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";
  1702. 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";
  1703. BABYLON.Effect.IncludesShadersStore['logDepthFragment'] = "#ifdef LOGARITHMICDEPTH\ngl_FragDepthEXT=log2(vFragmentDepth)*logarithmicDepthConstant*0.5;\n#endif";
  1704. BABYLON.Effect.IncludesShadersStore['fogFragment'] = "#ifdef FOG\nfloat fog=CalcFogFactor();\ncolor.rgb=fog*color.rgb+(1.0-fog)*vFogColor;\n#endif";
  1705. (function() {
  1706. var EXPORTS = {};EXPORTS['AnimationRange'] = BABYLON['AnimationRange'];EXPORTS['AnimationEvent'] = BABYLON['AnimationEvent'];EXPORTS['PathCursor'] = BABYLON['PathCursor'];EXPORTS['Animation'] = BABYLON['Animation'];EXPORTS['TargetedAnimation'] = BABYLON['TargetedAnimation'];EXPORTS['AnimationGroup'] = BABYLON['AnimationGroup'];EXPORTS['RuntimeAnimation'] = BABYLON['RuntimeAnimation'];EXPORTS['Animatable'] = BABYLON['Animatable'];EXPORTS['EasingFunction'] = BABYLON['EasingFunction'];EXPORTS['CircleEase'] = BABYLON['CircleEase'];EXPORTS['BackEase'] = BABYLON['BackEase'];EXPORTS['BounceEase'] = BABYLON['BounceEase'];EXPORTS['CubicEase'] = BABYLON['CubicEase'];EXPORTS['ElasticEase'] = BABYLON['ElasticEase'];EXPORTS['ExponentialEase'] = BABYLON['ExponentialEase'];EXPORTS['PowerEase'] = BABYLON['PowerEase'];EXPORTS['QuadraticEase'] = BABYLON['QuadraticEase'];EXPORTS['QuarticEase'] = BABYLON['QuarticEase'];EXPORTS['QuinticEase'] = BABYLON['QuinticEase'];EXPORTS['SineEase'] = BABYLON['SineEase'];EXPORTS['BezierCurveEase'] = BABYLON['BezierCurveEase'];
  1707. globalObject["BABYLON"] = globalObject["BABYLON"] || BABYLON;
  1708. module.exports = EXPORTS;
  1709. })();
  1710. }