"Sleeping" "artificial intelligence". Spoiler: Will not wake up. Seems to generate art. Finished work. https://victorgiers.com/iris
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

visual_logic.js 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. /**
  2. * Generated by Verge3D Puzzles v.2.12.5
  3. <<<<<<< HEAD
  4. * Mon Jun 10 2019 15:45:13 GMT+0200 (Mitteleuropäische Sommerzeit)
  5. =======
  6. * Mon Jun 10 2019 05:49:05 GMT+0200 (Mitteleuropäische Sommerzeit)
  7. >>>>>>> 83c2b9870597ee999f38d78b893a91a035ffe4af
  8. * Do not edit this file - your changes may get overridden when Puzzles are saved.
  9. * Refer to https://www.soft8soft.com/docs/manual/en/introduction/Using-JavaScript.html
  10. * for information on how to add your own JavaScript to Verge3D apps.
  11. */
  12. "use strict";
  13. (function() {
  14. // global variables/constants used by puzzles' functions
  15. var _pGlob = {};
  16. _pGlob.objCache = {};
  17. _pGlob.fadeAnnotations = true;
  18. _pGlob.objClickCallbacks = [];
  19. _pGlob.pickedObject = '';
  20. _pGlob.objHoverCallbacks = [];
  21. _pGlob.hoveredObject = '';
  22. _pGlob.objMovementInfos = {};
  23. _pGlob.objDragOverCallbacks = [];
  24. _pGlob.objDragOverInfoByBlock = {}
  25. _pGlob.dragMoveOrigins = {};
  26. _pGlob.dragScaleOrigins = {};
  27. _pGlob.mediaElements = {};
  28. _pGlob.loadedFiles = {};
  29. _pGlob.loadedFile = '';
  30. _pGlob.animMixerCallbacks = [];
  31. _pGlob.arHitPoint = new v3d.Vector3(0, 0, 0);
  32. _pGlob.states = [];
  33. _pGlob.percentage = 0;
  34. _pGlob.animateParamUpdate = null;
  35. _pGlob.openedFile = '';
  36. _pGlob.xrSessionAcquired = false;
  37. _pGlob.xrSessionCallbacks = [];
  38. _pGlob.screenCoords = new v3d.Vector2();
  39. _pGlob.AXIS_X = new v3d.Vector3(1, 0, 0);
  40. _pGlob.AXIS_Y = new v3d.Vector3(0, 1, 0);
  41. _pGlob.AXIS_Z = new v3d.Vector3(0, 0, 1);
  42. _pGlob.MIN_DRAG_SCALE = 10e-4;
  43. _pGlob.vec2Tmp = new v3d.Vector2();
  44. _pGlob.vec2Tmp2 = new v3d.Vector2();
  45. _pGlob.vec3Tmp = new v3d.Vector3();
  46. _pGlob.vec3Tmp2 = new v3d.Vector3();
  47. _pGlob.quatTmp = new v3d.Quaternion();
  48. _pGlob.quatTmp2 = new v3d.Quaternion();
  49. _pGlob.mat4Tmp = new v3d.Matrix4();
  50. _pGlob.planeTmp = new v3d.Plane();
  51. _pGlob.raycasterTmp = new v3d.Raycaster();
  52. _pGlob.timers = {};
  53. var _pPhysics = {};
  54. _pPhysics.syncList = [];
  55. // internal info
  56. _pPhysics.collisionData = [];
  57. // goes to collision callback
  58. _pPhysics.collisionInfo = {
  59. objectA: '',
  60. objectB: '',
  61. distance: 0,
  62. positionOnA: [0, 0, 0],
  63. positionOnB: [0, 0, 0],
  64. normalOnB: [0, 0, 0]
  65. };
  66. var PL = v3d.PL = v3d.PL || {};
  67. PL.legacyMode = false;
  68. PL.execInitPuzzles = function() {
  69. var _initGlob = {};
  70. _initGlob.percentage = 0;
  71. _initGlob.output = {
  72. initOptions: {
  73. fadeAnnotations: true,
  74. useBkgTransp: false,
  75. preserveDrawBuf: false,
  76. useCompAssets: false,
  77. useFullscreen: true,
  78. useCustomPreloader: false,
  79. preloaderStartCb: function() {},
  80. preloaderProgressCb: function() {},
  81. preloaderEndCb: function() {},
  82. }
  83. }
  84. <<<<<<< HEAD
  85. // utility functions envoked by the HTML puzzles
  86. function getElements(ids, isParent) {
  87. var elems = [];
  88. if (Array.isArray(ids) && ids[0] != "WINDOW" && ids[0] != "DOCUMENT" && ids[0] != "BODY") {
  89. for (var i = 0; i < ids.length; i++)
  90. elems.push(getElement(ids[i], isParent));
  91. } else {
  92. elems.push(getElement(ids, isParent));
  93. }
  94. return elems;
  95. }
  96. function getElement(id, isParent) {
  97. var elem;
  98. if (Array.isArray(id) && id[0] == "WINDOW") {
  99. if (isParent)
  100. elem = parent;
  101. else
  102. elem = window;
  103. } else if (Array.isArray(id) && id[0] == "DOCUMENT") {
  104. if (isParent)
  105. elem = parent.document;
  106. else
  107. elem = document;
  108. } else if (Array.isArray(id) && id[0] == "BODY") {
  109. if (isParent)
  110. elem = parent.document.body;
  111. else
  112. elem = document.body;
  113. } else {
  114. if (isParent)
  115. elem = parent.document.getElementById(id);
  116. else
  117. elem = document.getElementById(id);
  118. }
  119. return elem;
  120. }
  121. // setHTMLElemStyle puzzle
  122. function setHTMLElemStyle(prop, value, ids, isParent) {
  123. var elems = getElements(ids, isParent);
  124. for (var i = 0; i < elems.length; i++) {
  125. var elem = elems[i];
  126. if (!elem || !elem.style)
  127. continue;
  128. elem.style[prop] = value;
  129. }
  130. }
  131. // initSettings puzzle
  132. =======
  133. // initSettings puzzle
  134. >>>>>>> 83c2b9870597ee999f38d78b893a91a035ffe4af
  135. _initGlob.output.initOptions.fadeAnnotations = true;
  136. _initGlob.output.initOptions.useBkgTransp = true;
  137. _initGlob.output.initOptions.preserveDrawBuf = false;
  138. _initGlob.output.initOptions.useCompAssets = false;
  139. _initGlob.output.initOptions.useFullscreen = false;
  140. <<<<<<< HEAD
  141. // initPreloader puzzle
  142. _initGlob.output.initOptions.useCustomPreloader = true;
  143. _initGlob.output.initOptions.preloaderStartCb = function() {
  144. _initGlob.percentage = 0;
  145. (function() {
  146. setHTMLElemStyle('visibility', 'hidden', 'curtain', false);
  147. setHTMLElemStyle('display', 'none', 'curtain', false);
  148. })();
  149. };
  150. _initGlob.output.initOptions.preloaderProgressCb = function(percentage) {
  151. _initGlob.percentage = percentage;
  152. (function() {})();
  153. };
  154. _initGlob.output.initOptions.preloaderEndCb = function() {
  155. _initGlob.percentage = 100;
  156. (function() {})();
  157. };
  158. =======
  159. >>>>>>> 83c2b9870597ee999f38d78b893a91a035ffe4af
  160. return _initGlob.output;
  161. }
  162. PL.init = function(appInstance, initOptions) {
  163. initOptions = initOptions || {};
  164. if ('fadeAnnotations' in initOptions) {
  165. _pGlob.fadeAnnotations = initOptions.fadeAnnotations;
  166. }
  167. // bloom puzzle
  168. function bloom(threshold, strength, radius) {
  169. appInstance.enablePostprocessing([{
  170. type: 'bloom',
  171. threshold: threshold,
  172. strength: strength,
  173. radius: radius
  174. }]);
  175. }
  176. <<<<<<< HEAD
  177. bloom(0.4, 0.15, 0.2);
  178. =======
  179. // callJSFunction puzzle
  180. function getJSFunction(funcName) {
  181. var jsFunc = appInstance.ExternalInterface[funcName];
  182. if (typeof jsFunc == "function")
  183. return jsFunc;
  184. else
  185. return function() {};
  186. }
  187. bloom(0.4, 0.25, 0.2);
  188. getJSFunction('startVideo')();
  189. >>>>>>> 83c2b9870597ee999f38d78b893a91a035ffe4af
  190. } // end of PL.init function
  191. if (window.v3dApp) {
  192. // backwards compatibility for old player projects
  193. PL.legacyMode = true;
  194. PL.init(window.v3dApp);
  195. }
  196. })(); // end of closure
  197. /* ================================ end of code ============================= */