Files
iris/visual_logic.js
2019-06-10 14:32:49 +02:00

149 lines
3.7 KiB
JavaScript

/**
* Generated by Verge3D Puzzles v.2.12.5
* Mon Jun 10 2019 05:49:05 GMT+0200 (Mitteleuropäische Sommerzeit)
* 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() {},
}
}
// initSettings puzzle
_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;
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
}]);
}
// 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')();
} // 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 ============================= */