123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237 |
- /**
- * Generated by Verge3D Puzzles v.2.12.5
- <<<<<<< HEAD
- * Mon Jun 10 2019 15:45:13 GMT+0200 (Mitteleuropäische Sommerzeit)
- =======
- * Mon Jun 10 2019 05:49:05 GMT+0200 (Mitteleuropäische Sommerzeit)
- >>>>>>> 83c2b9870597ee999f38d78b893a91a035ffe4af
- * Do not edit this file - your changes may get overridden when Puzzles are saved.
- * Refer to https://www.soft8soft.com/docs/manual/en/introduction/Using-JavaScript.html
- * for information on how to add your own JavaScript to Verge3D apps.
- */
-
- "use strict";
-
- (function() {
-
- // global variables/constants used by puzzles' functions
- var _pGlob = {};
-
- _pGlob.objCache = {};
- _pGlob.fadeAnnotations = true;
- _pGlob.objClickCallbacks = [];
- _pGlob.pickedObject = '';
- _pGlob.objHoverCallbacks = [];
- _pGlob.hoveredObject = '';
- _pGlob.objMovementInfos = {};
- _pGlob.objDragOverCallbacks = [];
- _pGlob.objDragOverInfoByBlock = {}
- _pGlob.dragMoveOrigins = {};
- _pGlob.dragScaleOrigins = {};
- _pGlob.mediaElements = {};
- _pGlob.loadedFiles = {};
- _pGlob.loadedFile = '';
- _pGlob.animMixerCallbacks = [];
- _pGlob.arHitPoint = new v3d.Vector3(0, 0, 0);
- _pGlob.states = [];
- _pGlob.percentage = 0;
- _pGlob.animateParamUpdate = null;
- _pGlob.openedFile = '';
- _pGlob.xrSessionAcquired = false;
- _pGlob.xrSessionCallbacks = [];
- _pGlob.screenCoords = new v3d.Vector2();
-
- _pGlob.AXIS_X = new v3d.Vector3(1, 0, 0);
- _pGlob.AXIS_Y = new v3d.Vector3(0, 1, 0);
- _pGlob.AXIS_Z = new v3d.Vector3(0, 0, 1);
- _pGlob.MIN_DRAG_SCALE = 10e-4;
-
- _pGlob.vec2Tmp = new v3d.Vector2();
- _pGlob.vec2Tmp2 = new v3d.Vector2();
- _pGlob.vec3Tmp = new v3d.Vector3();
- _pGlob.vec3Tmp2 = new v3d.Vector3();
- _pGlob.quatTmp = new v3d.Quaternion();
- _pGlob.quatTmp2 = new v3d.Quaternion();
- _pGlob.mat4Tmp = new v3d.Matrix4();
- _pGlob.planeTmp = new v3d.Plane();
- _pGlob.raycasterTmp = new v3d.Raycaster();
- _pGlob.timers = {};
-
- var _pPhysics = {};
-
- _pPhysics.syncList = [];
-
- // internal info
- _pPhysics.collisionData = [];
-
- // goes to collision callback
- _pPhysics.collisionInfo = {
- objectA: '',
- objectB: '',
- distance: 0,
- positionOnA: [0, 0, 0],
- positionOnB: [0, 0, 0],
- normalOnB: [0, 0, 0]
- };
-
- var PL = v3d.PL = v3d.PL || {};
-
- PL.legacyMode = false;
-
- PL.execInitPuzzles = function() {
-
- var _initGlob = {};
- _initGlob.percentage = 0;
- _initGlob.output = {
- initOptions: {
- fadeAnnotations: true,
- useBkgTransp: false,
- preserveDrawBuf: false,
- useCompAssets: false,
- useFullscreen: true,
- useCustomPreloader: false,
- preloaderStartCb: function() {},
- preloaderProgressCb: function() {},
- preloaderEndCb: function() {},
- }
- }
- <<<<<<< HEAD
-
- // utility functions envoked by the HTML puzzles
- function getElements(ids, isParent) {
- var elems = [];
- if (Array.isArray(ids) && ids[0] != "WINDOW" && ids[0] != "DOCUMENT" && ids[0] != "BODY") {
- for (var i = 0; i < ids.length; i++)
- elems.push(getElement(ids[i], isParent));
- } else {
- elems.push(getElement(ids, isParent));
- }
- return elems;
- }
-
- function getElement(id, isParent) {
- var elem;
- if (Array.isArray(id) && id[0] == "WINDOW") {
- if (isParent)
- elem = parent;
- else
- elem = window;
- } else if (Array.isArray(id) && id[0] == "DOCUMENT") {
- if (isParent)
- elem = parent.document;
- else
- elem = document;
- } else if (Array.isArray(id) && id[0] == "BODY") {
- if (isParent)
- elem = parent.document.body;
- else
- elem = document.body;
- } else {
- if (isParent)
- elem = parent.document.getElementById(id);
- else
- elem = document.getElementById(id);
- }
- return elem;
- }
-
-
-
- // setHTMLElemStyle puzzle
- function setHTMLElemStyle(prop, value, ids, isParent) {
- var elems = getElements(ids, isParent);
- for (var i = 0; i < elems.length; i++) {
- var elem = elems[i];
- if (!elem || !elem.style)
- continue;
- elem.style[prop] = value;
- }
- }
-
-
-
-
- // initSettings puzzle
- =======
- // initSettings puzzle
- >>>>>>> 83c2b9870597ee999f38d78b893a91a035ffe4af
- _initGlob.output.initOptions.fadeAnnotations = true;
- _initGlob.output.initOptions.useBkgTransp = true;
- _initGlob.output.initOptions.preserveDrawBuf = false;
- _initGlob.output.initOptions.useCompAssets = false;
- _initGlob.output.initOptions.useFullscreen = false;
-
- <<<<<<< HEAD
-
- // initPreloader puzzle
- _initGlob.output.initOptions.useCustomPreloader = true;
- _initGlob.output.initOptions.preloaderStartCb = function() {
- _initGlob.percentage = 0;
- (function() {
- setHTMLElemStyle('visibility', 'hidden', 'curtain', false);
- setHTMLElemStyle('display', 'none', 'curtain', false);
- })();
- };
- _initGlob.output.initOptions.preloaderProgressCb = function(percentage) {
- _initGlob.percentage = percentage;
- (function() {})();
- };
- _initGlob.output.initOptions.preloaderEndCb = function() {
- _initGlob.percentage = 100;
- (function() {})();
- };
-
- =======
- >>>>>>> 83c2b9870597ee999f38d78b893a91a035ffe4af
- return _initGlob.output;
- }
-
- PL.init = function(appInstance, initOptions) {
-
- initOptions = initOptions || {};
-
- if ('fadeAnnotations' in initOptions) {
- _pGlob.fadeAnnotations = initOptions.fadeAnnotations;
- }
-
- // bloom puzzle
- function bloom(threshold, strength, radius) {
- appInstance.enablePostprocessing([{
- type: 'bloom',
- threshold: threshold,
- strength: strength,
- radius: radius
- }]);
- }
-
-
-
- <<<<<<< HEAD
- bloom(0.4, 0.15, 0.2);
- =======
- // callJSFunction puzzle
- function getJSFunction(funcName) {
- var jsFunc = appInstance.ExternalInterface[funcName];
- if (typeof jsFunc == "function")
- return jsFunc;
- else
- return function() {};
- }
-
-
-
- bloom(0.4, 0.25, 0.2);
- getJSFunction('startVideo')();
- >>>>>>> 83c2b9870597ee999f38d78b893a91a035ffe4af
-
- } // end of PL.init function
-
- if (window.v3dApp) {
- // backwards compatibility for old player projects
- PL.legacyMode = true;
- PL.init(window.v3dApp);
- }
-
- })(); // end of closure
-
- /* ================================ end of code ============================= */
|