UNPKG

matrix-engine

Version:

basic_timeline improved, VT func setup vide html element id with name arg.- DISABLE RAYCAST DEBUG TEST [2.3.3] Fix for GUI win desktop [2.3.0] DestrucMesh solution & loading convex objs for physics BASIC, SpriteAnimation CPU/texture solution added, Improv

1,036 lines (968 loc) 1.79 MB
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var matrixEngine = _interopRequireWildcard(require("./index")); var _cube_tex_arrays = require("./apps/cube_tex_arrays"); var _adding_color_cube = require("./apps/adding_color_cube"); var _adding_color_piramyde = require("./apps/adding_color_piramyde"); var _adding_color_triangle = require("./apps/adding_color_triangle"); var _adding_tex_square_raycast = require("./apps/adding_tex_square_raycast"); var _adding_more_texture_samplers = require("./apps/adding_more_texture_samplers"); var _adding_square_texture = require("./apps/adding_square_texture"); var _all_variant_of_blending = require("./apps/all_variant_of_blending"); var _audio_manipulation = require("./apps/audio_manipulation"); var _audio_manipulation2 = require("./apps/audio_manipulation2"); var _camera_texture = require("./apps/camera_texture"); var _cube_experimental = require("./apps/cube_experimental"); var _cube_geometry = require("./apps/cube_geometry"); var _cube_light_and_texture = require("./apps/cube_light_and_texture"); var _cube_light_dinamic = require("./apps/cube_light_dinamic"); var _custom_texture = require("./apps/custom_texture"); var _first_person_controller = require("./apps/first_person_controller"); var _load_obj_file = require("./apps/load_obj_file"); var _my_world = require("./apps/my_world"); var _obj_animation = require("./apps/obj_animation"); var _obj_animation_build_mesh_effect = require("./apps/obj_animation_build_mesh_effect"); var _oneKilo = require("./apps/one-kilo"); var _porting2d = require("./apps/porting2d"); var _porting2d_particle = require("./apps/porting2d_particle"); var _porting2d_text = require("./apps/porting2d_text"); var _sphere_geometry = require("./apps/sphere_geometry"); var _texture_dinamic_manipulation = require("./apps/texture_dinamic_manipulation"); var _video_texture = require("./apps/video_texture"); var _adding_color_square = require("./apps/adding_color_square"); var _bvhLoader = require("./apps/bvh-loader"); var _bvhAnimationClass = require("./apps/bvh-animation-class"); var _active_editor = require("./apps/active_editor"); var _porting2d_micro_draw = require("./apps/porting2d_micro_draw"); var _physics_cube = require("./apps/physics_cube"); var _physics_sphere = require("./apps/physics_sphere"); var _spot_light_basic = require("./apps/spot_light_basic"); var _networking_basic = require("./apps/networking_basic"); var _load_obj_sequence = require("./apps/load_obj_sequence"); var _opengles_native_cubemap = require("./apps/opengles_native_cubemap"); var _opengles_native_cubemap_images = require("./apps/opengles_native_cubemap_images"); var _lens_effect = require("./apps/lens_effect"); var _fps_player_controller = require("./apps/fps_player_controller"); var _basic_fbo = require("./apps/basic_fbo"); var _video_texture_lava = require("./apps/video_texture_lava"); var _matrix_chat_room = require("./apps/matrix_chat_room"); var _torus_geometry = require("./apps/torus_geometry"); var _physics_cube_active_textures = require("./apps/physics_cube_active_textures"); var _fbo_manipulation = require("./apps/fbo_manipulation"); var _welcomeGuiEditor = require("./apps/welcome-gui-editor"); var _rolling_the_dice = require("./apps/rolling_the_dice"); var _shader1_direct = require("./apps/shader1_direct"); var _shaders = require("./apps/shaders"); var _shader2_direct = require("./apps/shader2_direct"); var _basic_timeline = require("./apps/basic_timeline"); var _networking2_basic = require("./apps/networking2_basic"); var _public_3d_video_chat = require("./apps/public_3d_video_chat"); var _custom_geometry = require("./apps/custom_geometry"); var _load_obj_file_groups = require("./apps/load_obj_file_groups"); var _maps = require("./apps/maps"); var _matrix_skeletal = require("./apps/matrix_skeletal"); var _sprite_animation_2d = require("./apps/sprite_animation_2d"); var _destruct_cube = require("./apps/destruct_cube"); function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } /** * @description * All examples instances. * This schema can be used for any website. * It is good for switching big independent parts of app. * @example for query-build.html?u=NAME_OF_EXAMPLE * public/query-build.html?u=spot_light_shadows */ var Examples = { destruct_cube: _destruct_cube.runThis, sprite_animation_2d: _sprite_animation_2d.runThis, matrix_skeletal: _matrix_skeletal.runThis, maps: _maps.runThis, load_obj_file_groups: _load_obj_file_groups.runThis, custom_geometry: _custom_geometry.runThis, public_3d_video_chat: _public_3d_video_chat.runThis, networking2_basic: _networking2_basic.runThis, basic_timeline: _basic_timeline.runThis, shaders: _shaders.runThis, shader1_direct: _shader1_direct.runThis, shader2_direct: _shader2_direct.runThis, rolling_the_dice: _rolling_the_dice.runThis, fbo_manipulation: _fbo_manipulation.runThis, physics_cube_active_textures: _physics_cube_active_textures.runThis, torus_geometry: _torus_geometry.runThis, matrix_chat_room: _matrix_chat_room.runThis, video_texture_lava: _video_texture_lava.runThis, basic_fbo: _basic_fbo.runThis, fps_player_controller: _fps_player_controller.runThis, lens_effect: _lens_effect.runThis, opengles_native_cubemap_images: _opengles_native_cubemap_images.runThis, opengles_native_cubemap: _opengles_native_cubemap.runThis, load_obj_sequence: _load_obj_sequence.runThis, networking_basic: _networking_basic.runThis, spot_light_basic: _spot_light_basic.runThis, physics_sphere: _physics_sphere.runThis, physics_cube: _physics_cube.runThis, porting2d_micro_draw: _porting2d_micro_draw.runThis, active_editor: _active_editor.runThis, bvh_animation_class: _bvhAnimationClass.runThis, bvh_loader: _bvhLoader.runThis, adding_tex_square_raycast: _adding_tex_square_raycast.runThis, cube_tex_arrays: _cube_tex_arrays.runThis, adding_color_cube: _adding_color_cube.runThis, adding_color_piramyde: _adding_color_piramyde.runThis, adding_color_triangle: _adding_color_triangle.runThis, adding_color_square: _adding_color_square.runThis, adding_more_texture_samplers: _adding_more_texture_samplers.runThis, adding_square_texture: _adding_square_texture.runThis, all_variant_of_blending: _all_variant_of_blending.runThis, audio_manipulation: _audio_manipulation.runThis, audio_manipulation2: _audio_manipulation2.runThis, camera_texture: _camera_texture.runThis, cube_experimental: _cube_experimental.runThis, cube_geometry: _cube_geometry.runThis, cube_light_and_texture: _cube_light_and_texture.runThis, cube_light_dinamic: _cube_light_dinamic.runThis, custom_texture: _custom_texture.runThis, first_person_controller: _first_person_controller.runThis, load_obj_file: _load_obj_file.runThis, my_world: _my_world.runThis, obj_animation: _obj_animation.runThis, obj_animation_build_mesh_effect: _obj_animation_build_mesh_effect.runThis, one_kilo: _oneKilo.runThis, porting2d: _porting2d.runThis, porting2d_particle: _porting2d_particle.runThis, porting2d_text: _porting2d_text.runThis, sphere_geometry: _sphere_geometry.runThis, texture_dinamic_manipulation: _texture_dinamic_manipulation.runThis, video_texture: _video_texture.runThis, welcome_gui_editor: _welcomeGuiEditor.runThis }; /** * @description * Little help func. */ const QueryString = matrixEngine.utility.QueryString; const scriptManager = matrixEngine.utility.scriptManager; //https://webglfundamentals.org/webgl/resources/m4.js var world; var App = matrixEngine.App; if ('serviceWorker' in navigator) { // navigator.serviceWorker.register('worker.js'); } else { console.warn('Matrix Engine: No support for web workers in this browser.'); } window.addEventListener('load', function () { setTimeout(() => { matrixEngine.Engine.initApp(webGLStart); }, 1000); }); function webGLStart() { world = matrixEngine.matrixWorld.defineworld(canvas); if (world) { world.callReDraw(); if (typeof QueryString.u != 'undefined' && typeof Examples[QueryString.u] != 'undefined') { setTimeout(() => { try { Examples[QueryString.u](world); } catch (err) { // Examples['adding_color_cube'](world); } }, 100); } else { setTimeout(() => { Examples['adding_color_cube'](world); }, 100); } } else { console.error(' Canvas has not been initialized, contact your programmer... '); } // Make it global for console easy access. // Remove this line for final prodc. window.App = App; } // Make it global for console easy access. // Remove this line for final prodc. window.matrixEngine = matrixEngine; var App = matrixEngine.App; var _default = exports.default = App; },{"./apps/active_editor":2,"./apps/adding_color_cube":3,"./apps/adding_color_piramyde":4,"./apps/adding_color_square":5,"./apps/adding_color_triangle":6,"./apps/adding_more_texture_samplers":7,"./apps/adding_square_texture":8,"./apps/adding_tex_square_raycast":9,"./apps/all_variant_of_blending":10,"./apps/audio_manipulation":12,"./apps/audio_manipulation2":13,"./apps/basic_fbo":14,"./apps/basic_timeline":15,"./apps/bvh-animation-class":16,"./apps/bvh-loader":17,"./apps/camera_texture":18,"./apps/cube_experimental":19,"./apps/cube_geometry":20,"./apps/cube_light_and_texture":21,"./apps/cube_light_dinamic":22,"./apps/cube_tex_arrays":23,"./apps/custom_geometry":24,"./apps/custom_texture":25,"./apps/destruct_cube":26,"./apps/fbo_manipulation":27,"./apps/first_person_controller":28,"./apps/fps_player_controller":29,"./apps/lens_effect":30,"./apps/load_obj_file":31,"./apps/load_obj_file_groups":32,"./apps/load_obj_sequence":33,"./apps/maps":34,"./apps/matrix_chat_room":36,"./apps/matrix_skeletal":37,"./apps/my_world":38,"./apps/networking2_basic":39,"./apps/networking_basic":40,"./apps/obj_animation":41,"./apps/obj_animation_build_mesh_effect":42,"./apps/one-kilo":43,"./apps/opengles_native_cubemap":44,"./apps/opengles_native_cubemap_images":45,"./apps/physics_cube":46,"./apps/physics_cube_active_textures":47,"./apps/physics_sphere":48,"./apps/porting2d":49,"./apps/porting2d_micro_draw":50,"./apps/porting2d_particle":51,"./apps/porting2d_text":52,"./apps/public_3d_video_chat":53,"./apps/rolling_the_dice":56,"./apps/shader1_direct":57,"./apps/shader2_direct":58,"./apps/shaders":59,"./apps/sphere_geometry":60,"./apps/spot_light_basic":61,"./apps/sprite_animation_2d":62,"./apps/texture_dinamic_manipulation":63,"./apps/torus_geometry":64,"./apps/video_texture":65,"./apps/video_texture_lava":66,"./apps/welcome-gui-editor":67,"./index":69}],2:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.runThis = void 0; var _manifest = _interopRequireDefault(require("../program/manifest")); var matrixEngine = _interopRequireWildcard(require("../index.js")); var CANNON = _interopRequireWildcard(require("cannon")); function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /** * @Author Nikola Lukic * @Description Matrix Engine Api Example. * How to use texture editor */ let ENUMERATORS = matrixEngine.utility.ENUMERATORS; let Vjs3 = matrixEngine.Engine.Vjs3; let E = matrixEngine.utility.E; var runThis = world => { _manifest.default.camera.SceneController = true; // eslint-disable-next-line no-unused-vars var tex = { source: ["res/images/complex_texture_1/diffuse.webp", "res/images/semi_pack/gradiend_half2.png"], mix_operation: "multiply" }; var texStone = { source: ["res/images/n-stone.png"], mix_operation: "multiply" }; canvas.addEventListener('mousedown', ev => { matrixEngine.raycaster.checkingProcedure(ev); }); window.addEventListener('ray.hit.event', ev => { console.log("You shoot the object! Nice!", ev); // Physics force apply if (ev.detail.hitObject.physics.enabled == true) { ev.detail.hitObject.physics.currentBody.force.set(0, 0, 1000); _manifest.default.scene.outsideBox.playerHits++; var actualTexFrame = document.getElementById('actualTexture'); actualTexFrame.contentWindow.title.TEXTBOX.TEXT = 'HITS:' + _manifest.default.scene.outsideBox.playerHits; // double - this is deep from raycaster _manifest.default.scene.outsideBox2.playerHits++; var tex1 = document.getElementById('tex1'); tex1.contentWindow.hits.TEXTBOX.TEXT = 'HITS:' + _manifest.default.scene.outsideBox2.playerHits; } }); // Matrix Engine use visual-js game engine like texture editor. world.Add("cubeLightTex", 1, "outsideBox", tex); _manifest.default.scene.outsideBox.playerHits = 0; _manifest.default.scene.outsideBox.rotation.rotz = -90; _manifest.default.scene.outsideBox.position.y = 0; _manifest.default.scene.outsideBox.position.z = -55; _manifest.default.scene.outsideBox.LightsData.ambientLight.set(1, 1, 1); _manifest.default.scene.outsideBox.glBlend.blendEnabled = true; _manifest.default.scene.outsideBox.glBlend.blendParamSrc = ENUMERATORS.glBlend.param[5]; _manifest.default.scene.outsideBox.glBlend.blendParamDest = ENUMERATORS.glBlend.param[5]; E("webcam_beta").style.display = "none"; _manifest.default.scene.outsideBox.streamTextures = new Vjs3("http://localhost/PRIVATE_SERVER/me/me/2DTextureEditor/actual.html", "actualTexture"); _manifest.default.scene.outsideBox.streamTextures.showTextureEditor(); setTimeout(() => { E("HOLDER_STREAMS").style.display = 'none'; }, 450); // Matrix Engine use visual-js game engine like texture editor in multiply times. world.Add("cubeLightTex", 1, "outsideBox2", tex); _manifest.default.scene.outsideBox2.playerHits = 0; _manifest.default.scene.outsideBox2.rotation.rotz = -90; _manifest.default.scene.outsideBox2.position.y = 0; _manifest.default.scene.outsideBox2.position.z = -55; _manifest.default.scene.outsideBox2.LightsData.ambientLight.set(1, 1, 1); _manifest.default.scene.outsideBox2.glBlend.blendEnabled = true; _manifest.default.scene.outsideBox2.glBlend.blendParamSrc = ENUMERATORS.glBlend.param[5]; _manifest.default.scene.outsideBox2.glBlend.blendParamDest = ENUMERATORS.glBlend.param[6]; _manifest.default.scene.outsideBox2.streamTextures = new Vjs3("http://localhost/PRIVATE_SERVER/me/me/2DTextureEditor/tex1.html", "tex1"); // App.scene.outsideBox2.streamTextures.showTextureEditor(); // Walls world.Add("cubeLightTex", 1, "WALLRIGHT", texStone); _manifest.default.scene.WALLRIGHT.geometry.setScaleByX(0.5); _manifest.default.scene.WALLRIGHT.geometry.setScaleByY(4); _manifest.default.scene.WALLRIGHT.geometry.setScaleByZ(14); _manifest.default.scene.WALLRIGHT.position.SetX(14); _manifest.default.scene.WALLRIGHT.position.SetY(3); _manifest.default.scene.WALLRIGHT.position.SetZ(-15); _manifest.default.scene.WALLRIGHT.geometry.setTexCoordScaleXFactor(1); world.Add("cubeLightTex", 1, "WALLLEFT", texStone); _manifest.default.scene.WALLLEFT.geometry.setScaleByX(0.5); _manifest.default.scene.WALLLEFT.geometry.setScaleByY(4); _manifest.default.scene.WALLLEFT.geometry.setScaleByZ(14); _manifest.default.scene.WALLLEFT.position.SetX(-14); _manifest.default.scene.WALLLEFT.position.SetY(3); _manifest.default.scene.WALLLEFT.position.SetZ(-15); _manifest.default.scene.WALLLEFT.geometry.setTexCoordScaleYFactor(1); world.Add("cubeLightTex", 1, "WALLFRONT", texStone); _manifest.default.scene.WALLFRONT.geometry.setScaleByX(14); _manifest.default.scene.WALLFRONT.geometry.setScaleByY(4); _manifest.default.scene.WALLFRONT.geometry.setScaleByZ(0.5); _manifest.default.scene.WALLFRONT.position.SetX(0); _manifest.default.scene.WALLFRONT.position.SetY(3); _manifest.default.scene.WALLFRONT.position.SetZ(-27); _manifest.default.scene.WALLFRONT.geometry.setTexCoordScaleXFactor(1); // Load Physics world let gravityVector = [0, 0, -9.82]; let physics = world.loadPhysics(gravityVector); // Add ground (this func create scene object FLOOR_STATIC) physics.addGround(_manifest.default, world, tex); var b = new CANNON.Body({ mass: 5, position: new CANNON.Vec3(0, -5, 1), shape: new CANNON.Box(new CANNON.Vec3(1, 1, 1)) }); physics.world.addBody(b); // Physics _manifest.default.scene.outsideBox.physics.currentBody = b; _manifest.default.scene.outsideBox.physics.enabled = true; var b2 = new CANNON.Body({ mass: 5, position: new CANNON.Vec3(0, -5, 1), shape: new CANNON.Box(new CANNON.Vec3(1, 1, 1)) }); physics.world.addBody(b2); // Physics _manifest.default.scene.outsideBox2.physics.currentBody = b2; _manifest.default.scene.outsideBox2.physics.enabled = true; _manifest.default.scene.FLOOR_STATIC.geometry.setTexCoordScaleFactor(1); }; exports.runThis = runThis; },{"../index.js":69,"../program/manifest":109,"cannon":106}],3:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.runThis = void 0; var _manifest = _interopRequireDefault(require("../program/manifest")); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /** *@Author Nikola Lukic *@Description Matrix Engine Api Example * Adding default color cube. */ /* globals world App */ var runThis = world => { world.Add("cube", 1, "MyColoredCube1"); world.Add("cube", 1, "MyColoredCube2"); world.Add("cube", 1, "MyColoredCube3"); canvas.addEventListener('mousedown', ev => { matrixEngine.raycaster.checkingProcedure(ev); }); matrixEngine.raycaster.touchCoordinate.stopOnFirstDetectedHit = true; addEventListener("ray.hit.event", function (e) { console.info(e.detail); }); _manifest.default.scene.MyColoredCube1.position.SetX(0); _manifest.default.scene.MyColoredCube2.position.SetX(-2.5); _manifest.default.scene.MyColoredCube3.position.SetX(2.5); _manifest.default.scene.MyColoredCube1.rotation.rotationSpeed.x = 15; _manifest.default.scene.MyColoredCube2.rotation.rotationSpeed.y = 15; _manifest.default.scene.MyColoredCube3.rotation.rotationSpeed.z = 15; }; exports.runThis = runThis; },{"../program/manifest":109}],4:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.runThis = void 0; var _manifest = _interopRequireDefault(require("../program/manifest")); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /** *@Author Nikola Lukic *@Description Matrix Engine Api Example */ /* globals world App world */ var runThis = world => { world.Add("pyramid", 1, "MyPyramid1"); world.Add("pyramid", 1, "MyPyramid2"); world.Add("pyramid", 1, "MyPyramid3"); _manifest.default.scene.MyPyramid1.position.SetX(2.5); _manifest.default.scene.MyPyramid2.position.SetX(0); _manifest.default.scene.MyPyramid3.position.SetX(-2.5); _manifest.default.scene.MyPyramid1.rotation.rotationSpeed.y = 20; _manifest.default.scene.MyPyramid2.rotation.rotationSpeed.y = 20; _manifest.default.scene.MyPyramid3.rotation.rotationSpeed.y = 20; canvas.addEventListener('mousedown', ev => { matrixEngine.raycaster.checkingProcedure(ev); }); addEventListener("ray.hit.event", function (e) { console.info(e.detail); }); }; exports.runThis = runThis; },{"../program/manifest":109}],5:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.runThis = void 0; var _manifest = _interopRequireDefault(require("../program/manifest")); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /** *@Author Nikola Lukic *@Description Matrix Engine Api Example */ /* globals world App world */ var runThis = world => { world.Add("square", 1, "MyColoredSquare1"); world.Add("square", 1.1, "MyColoredSquare2"); world.Add("square", 1.2, "MyColoredSquare3"); _manifest.default.scene.MyColoredSquare1.position.SetX(2.5); _manifest.default.scene.MyColoredSquare2.position.SetX(0); _manifest.default.scene.MyColoredSquare3.position.SetX(-2.5); _manifest.default.scene.MyColoredSquare1.rotation.rotationSpeed.x = 15; _manifest.default.scene.MyColoredSquare2.rotation.rotationSpeed.x = 15; _manifest.default.scene.MyColoredSquare3.rotation.rotationSpeed.x = 15; }; exports.runThis = runThis; },{"../program/manifest":109}],6:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.runThis = void 0; var _manifest = _interopRequireDefault(require("../program/manifest")); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /** *@Author Nikola Lukic *@Description Matrix Engine Api Example */ /* globals world App world */ var runThis = world => { world.Add("triangle", 1, "MyColoredTriangle1"); world.Add("triangle", 1, "MyColoredTriangle2"); world.Add("triangle", 1, "MyColoredTriangle3"); canvas.addEventListener('mousedown', ev => { matrixEngine.raycaster.checkingProcedure(ev); }); _manifest.default.scene.MyColoredTriangle1.position.SetZ(-4); _manifest.default.scene.MyColoredTriangle1.position.SetX(0); _manifest.default.scene.MyColoredTriangle1.position.SetY(0); _manifest.default.scene.MyColoredTriangle1.position.SetX(2.5); _manifest.default.scene.MyColoredTriangle2.position.SetX(0); _manifest.default.scene.MyColoredTriangle3.position.SetX(-2.5); _manifest.default.scene.MyColoredTriangle1.rotation.rotationSpeed.z = -10; _manifest.default.scene.MyColoredTriangle2.rotation.rotationSpeed.z = -10; _manifest.default.scene.MyColoredTriangle3.rotation.rotationSpeed.z = -10; }; exports.runThis = runThis; },{"../program/manifest":109}],7:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.runThis = void 0; var _manifest = _interopRequireDefault(require("../program/manifest")); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /** *@Author Nikola Lukic *@Description Matrix Engine Api Example */ /* globals world App world */ var runThis = world => { var textuteImageSamplers = { source: ["res/images/complex_texture_1/diffuse.webp", "res/images/texture_spiral1.png"], mix_operation: "multiply" }; world.Add("cubeLightTex", 1, "MyCubeTex", textuteImageSamplers); setTimeout(function () { var textuteImageSamplers = { source: ["res/images/complex_texture_1/diffuse.webp", "res/images/texture_spiral1.png", "res/images/icon2.png"], mix_operation: "divide" }; _manifest.default.scene.MyCubeTex.changeMaterial(textuteImageSamplers); }, 5000); }; exports.runThis = runThis; },{"../program/manifest":109}],8:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.runThis = void 0; var _manifest = _interopRequireDefault(require("../program/manifest")); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /** *@Author Nikola Lukic *@Description Matrix Engine Api Example */ /* globals world App world */ var runThis = world => { var textuteImageSamplers = { source: ["res/images/complex_texture_1/diffuse.webp"], mix_operation: "multiply" }; world.Add("squareTex", 1, "MySquareTexure1", textuteImageSamplers); _manifest.default.scene.MySquareTexure1.rotation.rotationSpeed.x = 10; canvas.addEventListener('mousedown', ev => { matrixEngine.raycaster.checkingProcedure(ev); }); addEventListener("ray.hit.event", function (e) { console.info("HIT: " + e.detail.hitObject.rotation.rotx); }); }; exports.runThis = runThis; },{"../program/manifest":109}],9:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.runThis = void 0; var _manifest = _interopRequireDefault(require("../program/manifest")); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /** *@Author Nikola Lukic *@Description Matrix Engine Api Example */ var runThis = world => { var textuteImageSamplers = { source: ["res/images/complex_texture_1/diffuse.webp"], mix_operation: "multiply" }; world.Add("squareTex", 1, "MyColoredSquareRayObject", textuteImageSamplers); _manifest.default.scene.MyColoredSquareRayObject.position.SetX(0); }; exports.runThis = runThis; },{"../program/manifest":109}],10:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.runThis = void 0; var matrixEngine = _interopRequireWildcard(require("../index.js")); function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } /** * @Author Nikola Lukic * @Description Matrix Engine Api Example. */ var runThis = world => { var App = matrixEngine.App; var textuteImageSamplers2 = { source: ['res/images/semi_pack/gradiend_half1.png'], mix_operation: 'multiply' }; var textuteImageSamplers = { source: ['res/images/semi_pack/gradiend_half2.png'], mix_operation: 'multiply' }; world.Add('cubeLightTex', 15, 'cube', textuteImageSamplers2); App.scene.cube.position.z = -13; App.scene.cube.rotation.rotationSpeed.x = 10; App.scene.cube.glBlend.blendParamSrc = matrixEngine.utility.ENUMERATORS.glBlend.param[4]; App.scene.cube.glBlend.blendParamDest = matrixEngine.utility.ENUMERATORS.glBlend.param[4]; for (var f = 0; f < matrixEngine.utility.ENUMERATORS.glBlend.param.length; f++) { world.Add('cubeLightTex', 0.65, 'test' + f, textuteImageSamplers); App.scene['test' + f].glBlend.blendEnabled = true; App.scene['test' + f].rotation.rotationSpeed.x = 20; App.scene['test' + f].position.y = f - 5.5; App.scene['test' + f].position.z = -13; App.scene['test' + f].position.x = f - 5; App.scene['test' + f].glBlend.blendParamSrc = matrixEngine.utility.ENUMERATORS.glBlend.param[f]; App.scene['test' + f].glBlend.blendParamDest = matrixEngine.utility.ENUMERATORS.glBlend.param[4]; } }; exports.runThis = runThis; },{"../index.js":69}],11:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.bvhAnimations = void 0; /** Auto generated file */ var bvhAnimations = exports.bvhAnimations = ['./res/bvh/Female1_A01_Stand.bvh', './res/bvh/Female1_A02_Sway.bvh', './res/bvh/Female1_A02_SwayT2.bvh', './res/bvh/Female1_A03_Swing.bvh', './res/bvh/Female1_A03_SwingT2.bvh', './res/bvh/Female1_A04_Look.bvh', './res/bvh/Female1_A05_PickUpBox.bvh', './res/bvh/Female1_A06_LiftBox.bvh', './res/bvh/Female1_A06_LiftBoxT2.bvh', './res/bvh/Female1_A07_Crouch.bvh', './res/bvh/Female1_A08_CrouchToLie.bvh', './res/bvh/Female1_A09_LieT2.bvh', './res/bvh/Female1_A10_LieToCrouch.bvh', './res/bvh/Female1_A11_CrawlForward.bvh', './res/bvh/Female1_A12_CrawlBackwards.bvh', './res/bvh/Female1_A13_Skipping.bvh', './res/bvh/Female1_A14_StandToSkip.bvh', './res/bvh/Female1_A15_SkipToStand.bvh', './res/bvh/Female1_B01_StandToWalk.bvh', './res/bvh/Female1_B02_WalkToStand.bvh', './res/bvh/Female1_B02_WalkToStandT2.bvh', './res/bvh/Female1_B03_Walk1.bvh', './res/bvh/Female1_B04_StandToWalkBack.bvh', './res/bvh/Female1_B05_WalkBackwards.bvh', './res/bvh/Female1_B06_WalkBackwardsToStand.bvh', './res/bvh/Female1_B07_WalkBackwardsTurnForwards.bvh', './res/bvh/Female1_B08_WalkBackwardsStopForwards.bvh', './res/bvh/Female1_B09_WalkTurnLeft90.bvh', './res/bvh/Female1_B10_WalkTurnLeft45.bvh', './res/bvh/Female1_B11_WalkTurnLeft135.bvh', './res/bvh/Female1_B12_WalkTurnRight90.bvh', './res/bvh/Female1_B13_WalkTurnRight45.bvh', './res/bvh/Female1_B14_WalkTurnRight135.bvh', './res/bvh/Female1_B15_WalkTurnAround180.bvh', './res/bvh/Female1_B16_WalkTurnChangeDirection.bvh', './res/bvh/Female1_B17_WalkToHopToWalk1.bvh', './res/bvh/Female1_B18_WalkToLeapToWalk.bvh', './res/bvh/Female1_B19_WalkToPickUpBox.bvh', './res/bvh/Female1_B20_WalkWithBox.bvh', './res/bvh/Female1_B21_PutDownBoxToWalk.bvh', './res/bvh/Female1_B21_S2_PutDownBoxToWalk.bvh', './res/bvh/Female1_B21_S3_PutDownBoxToWalk.bvh', './res/bvh/Female1_B22_SideStepLeft.bvh', './res/bvh/Female1_B23_SideStepRight.bvh', './res/bvh/Female1_B24_WalkToCrouch.bvh', './res/bvh/Female1_B25_CrouchToWalk.bvh', './res/bvh/Female1_B26_WalkToSkip.bvh', './res/bvh/Female1_B27_SkipToWalk1.bvh', './res/bvh/Female1_C02_RunToStand.bvh', './res/bvh/Female1_C03_Run.bvh', './res/bvh/Female1_C04_RunToWalk1.bvh', './res/bvh/Female1_C05_WalkToRun.bvh', './res/bvh/Female1_C06_StandToRunBackwards.bvh', './res/bvh/Female1_C07_RunBackwards.bvh', './res/bvh/Female1_C08_RunBackwardsToStand.bvh', './res/bvh/Female1_C09_RunBackwardsTurnRunForward.bvh', './res/bvh/Female1_C10_RunBackwardsStopRunForward.bvh', './res/bvh/Female1_C11_RunTurnLeft90.bvh', './res/bvh/Female1_C12_RunTurnLeft45.bvh', './res/bvh/Female1_C13_RunTurnLeft135.bvh', './res/bvh/Female1_C14_RunTurnRight90.bvh', './res/bvh/Female1_C15_RunTurnRight45.bvh', './res/bvh/Female1_C16_RunTurnRight135.bvh', './res/bvh/Female1_C17_RunTurnAround.bvh', './res/bvh/Female1_C18_RunChangeDirection.bvh', './res/bvh/Female1_C19_RunToHopToWalk.bvh', './res/bvh/Female1_C20_RunToJumpToWalk.bvh', './res/bvh/Female1_C21_RunToPickUpBox.bvh', './res/bvh/Female1_C21_S2_RunToPickUpBox.bvh', './res/bvh/Female1_C22_RunWithBox.bvh', './res/bvh/Female1_C23_PutDownBoxToRun.bvh', './res/bvh/Female1_C24_SideStepLeft.bvh', './res/bvh/Female1_C25_SideStepRight.bvh', './res/bvh/Female1_C26_RunToCrouch.bvh', './res/bvh/Female1_C27_CrouchToRun1.bvh', './res/bvh/Female1_D1_Urban.bvh', './res/bvh/Female1_D2_Wait.bvh', './res/bvh/Female1_D3_ConversationGestures.bvh', './res/bvh/Female1_D4_RandomStuff.bvh', './res/bvh/Female1_D5_RandomStuff2.bvh', './res/bvh/Female1_D6_CartWheel.bvh', './res/bvh/readme.txt']; },{}],12:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.runThis = void 0; var matrixEngine = _interopRequireWildcard(require("../index.js")); function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } /* eslint-disable no-unused-vars */ /** * @Author Nikola Lukic * @Description Matrix Engine Api Example. */ /* globals world App ENUMERATORS SWITCHER OSCILLATOR OBJ ACCESS_CAMERA Galactic*/ let ENUMERATORS = matrixEngine.utility.ENUMERATORS; let E = matrixEngine.utility.E; var runThis = world => { var App = matrixEngine.App; console.log("world", world); for (var i = 1; i < 1024; i = i + 70) { world.Add("pyramid", 0.1 + i / 1000, "MyPyramid" + i); // eval( "App.scene.MyPyramid"+i+".position.x = 5.5-i/100"); console.log("App.scene", App.scene); } for (var i = 1; i < 1024; i = i + 70) { // world.Add("pyramid", 0.1 + i / 1000, "MyPyramid" + i); // eval( "App.scene.MyPyramid"+i+".position.x = 5.5-i/100"); console.log("App.scene", App.scene); App.scene["MyPyramid" + i].position.y = 0; App.scene["MyPyramid" + i].rotation.rotationSpeed.y = 5; App.scene["MyPyramid" + i].glBlend.blendEnabled = true; App.scene["MyPyramid" + i].glBlend.blendParamSrc = ENUMERATORS.glBlend.param[7]; App.scene["MyPyramid" + i].glBlend.blendParamDest = ENUMERATORS.glBlend.param[2]; } App.onload = function (e) { console.log(e); var test = App.audioSystem.createVideoAsset("Galactic", "Epiclogue.mp3"); test.then(() => { console.log(test + "<<<<GOOD<<<"); }).catch(() => { console.log(test + "BAD"); }); window.Galactic = App.audioSystem.Assets.Galactic; var source = Galactic.context.createMediaElementSource(Galactic.video); source.connect(Galactic.gainNode); Galactic.gainNode.connect(Galactic.filter); Galactic.filter.connect(Galactic.context.destination); Galactic.analyser = Galactic.context.createAnalyser(); source.connect(Galactic.analyser); Galactic.frequencyData = new Uint8Array(Galactic.analyser.frequencyBinCount); Galactic.UPDATE = function () { Galactic.analyser.getByteFrequencyData(Galactic.frequencyData); var PARAMETER1 = 0.1; for (var i = 1, j = 1; i < 1024; i = i + 70, j = j + 35) { App.scene["MyPyramid" + i].rotation.rotationSpeed.z = Galactic.frequencyData[i] / PARAMETER1; } // console.log(frequencyData) }; App.updateBeforeDraw.push(Galactic); }; App.onload(); }; exports.runThis = runThis; },{"../index.js":69}],13:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.runThis = void 0; var matrixEngine = _interopRequireWildcard(require("../index.js")); function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } /** * @Author Nikola Lukic * @Description Matrix Engine Api Example. */ let ENUMERATORS = matrixEngine.utility.ENUMERATORS; var runThis = world => { // need to be removed from bvh-loader npm package! var logHTML = document.createElement('div'); logHTML.id = 'log'; // logHTML.style.position = 'absolute'; document.body.appendChild(logHTML); var App = matrixEngine.App; var effectOsci = new matrixEngine.utility.OSCILLATOR(3, 10, 1); var effectOsci2 = new matrixEngine.utility.OSCILLATOR(3, 10, 1); effectOsci2.value_ = 6; const options = { world: world, // [Required] autoPlay: true, // [Optimal] showOnLoad: false, // [Optimal] if autoPLay is true then showOnLoad is inactive. type: 'ANIMATION', // [Optimal] 'ANIMATION' | "TPOSE' loop: 'playInverse', // [Optimal] true | 'stopOnEnd' | 'playInverse' | 'stopAndReset' globalOffset: [-10, -14, -245], // [Optimal] skeletalBoneScale: 2, // [Optimal] skeletalBlend: { // [Optimal] remove arg for no blend paramDest: 3, paramSrc: 4 }, boneTex: { source: ['res/images/complex_texture_1/diffuse.webp'], mix_operation: 'multiply' }, drawTypeBone: 'sphereLightTex' // pyramid | triangle | cube | square | squareTex | cubeLightTex | sphereLightTex }; const filePath = 'https://raw.githubusercontent.com/zlatnaspirala/Matrix-Engine-BVH-test/main/javascript-bvh/example.bvh'; var myFirstBvhAnimation = new matrixEngine.MEBvhAnimation(filePath, options); // 2 const options2 = { world: world, autoPlay: true, myFrameRate: 10, showOnLoad: false, // if autoPLay is true then showOnLoad is inactive. type: 'ANIMATION', // "TPOSE' | 'ANIMATION' loop: 'playInverse', // true | 'stopOnEnd' | 'playInverse' | 'stopAndReset' globalOffset: [40, -180, -155], skeletalBoneScale: 6, boneNameBasePrefix: 'backWalk', skeletalBlend: { paramDest: 7, paramSrc: 6 }, // remove arg for no blend boneTex: { source: ['res/images/512.png'], mix_operation: 'multiply' }, drawTypeBone: 'squareTex' // pyramid | triangle | cube | square | squareTex | cubeLightTex | sphereLightTex' }; window.myFirstBvhAnimation = myFirstBvhAnimation; const filePath2 = 'res/bvh/Female1_B04_StandToWalkBack.bvh'; var myBvhAnimation = new matrixEngine.MEBvhAnimation(filePath2, options2); // 3 const options3 = { world: world, autoPlay: true, myFrameRate: 10, showOnLoad: false, // if autoPLay is true then showOnLoad is inactive. type: 'ANIMATION', // "TPOSE' | 'ANIMATION' loop: 'playInverse', // true | 'stopOnEnd' | 'playInverse' | 'stopAndReset' globalOffset: [-30, -180, -255], skeletalBoneScale: 6, boneNameBasePrefix: 'stand3', skeletalBlend: { paramDest: 7, paramSrc: 6 }, // remove arg for no blend boneTex: { source: ['res/images/512.png'], mix_operation: 'multiply' }, drawTypeBone: 'cubeLightTex' // pyramid | triangle | cube | square | squareTex | cubeLightTex | sphereLightTex' }; const filePath3 = 'res/bvh/Female1_A01_Stand.bvh'; var myBvhAnimation3 = new matrixEngine.MEBvhAnimation(filePath3, options3); window.myBvhAnimation3 = myBvhAnimation3; // 3 const options4 = { world: world, autoPlay: true, myFrameRate: 10, showOnLoad: false, // if autoPLay is true then showOnLoad is inactive. type: 'ANIMATION', // "TPOSE' | 'ANIMATION' loop: 'playInverse', // true | 'stopOnEnd' | 'playInverse' | 'stopAndReset' globalOffset: [-170, -180, -295], skeletalBoneScale: 6, boneNameBasePrefix: 'standUraban', skeletalBlend: { paramDest: 7, paramSrc: 6 }, // remove arg for no blend boneTex: { source: ['res/images/512.png'], mix_operation: 'multiply' }, drawTypeBone: 'cubeLightTex' // pyramid | triangle | cube | square | squareTex | cubeLightTex | sphereLightTex' }; const filePath4 = 'res/bvh/Female1_D1_Urban.bvh'; var myBvhAnimation4 = new matrixEngine.MEBvhAnimation(filePath4, options4); var matrixIcon = { source: ['res/images/512.png'], mix_operation: 'multiply' }; var matrixIcon2 = { source: ['res/images/semi_pack/gradiend_half1.png'], mix_operation: 'multiply' }; for (var i = 1; i < 1024; i = i + 80) { world.Add('pyramid', 0.1 + i / 500, 'MyPyramid' + i); world.Add('cubeLightTex', 0.1 + i / 100, 'MyCube' + i, matrixIcon); world.Add('cubeLightTex', 0.1 + i / 100, 'MyCube2__' + i, matrixIcon2); } var myMarginY = -5; var mymarginYCube = -10; for (var i = 1; i < 1024; i = i + 80) { App.scene['MyPyramid' + i].position.SetY(myMarginY); App.scene['MyPyramid' + i].position.SetZ(-16); App.scene['MyPyramid' + i].rotation.rotationSpeed.y = 15; App.scene['MyPyramid' + i].glBlend.blendEnabled = true; App.scene['MyPyramid' + i].glBlend.blendParamSrc = ENUMERATORS.glBlend.param[6]; App.scene['MyPyramid' + i].glBlend.blendParamDest = ENUMERATORS.glBlend.param[6]; App.scene['MyCube' + i].glBlend.blendEnabled = true; App.scene['MyCube' + i].glBlend.blendParamSrc = ENUMERATORS.glBlend.param[4]; App.scene['MyCube' + i].glBlend.blendParamDest = ENUMERATORS.glBlend.param[4]; App.scene['MyCube' + i].position.SetZ(-70); App.scene['MyCube' + i].position.SetX(-32); App.scene['MyCube' + i].rotation.rotateY(45); App.scene['MyCube2__' + i].glBlend.blendEnabled = true; App.scene['MyCube2__' + i].glBlend.blendParamSrc = ENUMERATORS.glBlend.param[4]; App.scene['MyCube2__' + i].glBlend.blendParamDest = ENUMERATORS.glBlend.param[6]; App.scene['MyCube2__' + i].position.SetZ(-70); App.scene['MyCube2__' + i].position.SetX(27); // App.scene['MyCube2__' + i].position.SetY(mymarginYCube); App.scene['MyCube2__' + i].rotation.rotateY(-45); App.scene['MyCube2__' + i].rotation.rotationSpeed.y = 10; } matrixEngine.utility.byId('debugBox').style.display = 'block'; matrixEngine.utility.byId('debugBox').style.width = '100%'; matrixEngine.utility.byId('debugBox').style.height = '37px'; matrixEngine.utility.byId('debugBox').innerHTML = ` Music used: BLACK FLY by Audionautix | http://audionautix.com Music promoted by https://www.free-stock-music.com Creative Commons Attribution-ShareAlike 3.0 Unported https://creativecommons.org/licenses/by-sa/3.0/deed.en_US <p> Mix of audio vs bvh operation. @zlatnaspirala </p> `; App.onload = function (e) { var test = App.audioSystem.createMusicAsset('blackfly', 'audionautix-black-fly.mp3'); test.then(() => { console.log('Audio context access successed!'); }).catch(() => { console.log('Ok there is no auto play for audio context. User need to click any where .'); function userRequest() { App.onload(); removeEventListener('click', userRequest); } addEventListener('click', userRequest, false); }); // Just for dev window.blackfly = App.audioSystem.Assets.blackfly; var source = blackfly.context.createMediaElementSource(blackfly.video); source.connect(blackfly.gainNode); blackfly.gainNode.connect(blackfly.filter); blackfly.filter.connect(blackfly.context.destination); blackfly.analyser = blackfly.context.createAnalyser(); source.connect(blackfly.analyser); blackfly.frequencyData = new Uint8Array(blackfly.analyser.frequencyBinCount); var PARAMETER1 = 20; var PARAMETER2 = 6; var mymarginYCubeLeft = 35; blackfly.UPDATE = function () { blackfly.analyser.getByteFrequencyData(blackfly.frequencyData); for (var i = 1, j = 1; i < 1024; i = i + 80, j = j + 40) { App.scene['MyPyramid' + i].position.SetY(blackfly.frequencyData[i] / PARAMETER1 + myMarginY); App.scene['MyCube' + i].position.SetY(blackfly.frequencyData[i] / PARAMETER2 + mymarginYCube); App.scene['MyCube2__' + i].position.SetY(blackfly.frequencyData[i] / PARAMETER2 + mymarginYCube); App.scene['MyPyramid' + i].glBlend.blendParamSrc = matrixEngine.utility.ENUMERATORS.glBlend.param[effectOsci.value_ - 1]; App.scene['MyPyramid' + i].glBlend.blendParamDest = matrixEngine.utility.ENUMERATORS.glBlend.param[effectOsci2.value_ - 1]; App.scene['MyCube' + i].glBlend.blendParamSrc = matrixEngine.utility.ENUMERATORS.glBlend.param[effectOsci.value_]; App.scene['MyCube' + i].glBlend.blendParamDest = matrixEngine.utility.ENUMERATORS.glBlend.param[effectOsci2.value_]; App.scene['MyCube2__' + i].glBlend.blendParamSrc = matrixEngine.utility.ENUMERATORS.glBlend.param[effectOsci.value_]; App.scene['MyCube2__' + i].glBlend.blendParamDest = matrixEngine.utility.ENUMERATORS.glBlend.param[effectOsci2.value_]; } }; setInterval(() => { effectOsci.UPDATE(); effectOsci2.UPDATE(); }, 1000); App.updateBeforeDraw.push(blackfly); }; App.onload(); }; exports.runThis = runThis; },{"../index.js":69}],14:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.runThis = void 0; var _manifest = _interopRequireDefault(require("../program/manifest")); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /** *@Author Nikola Lukic *@Description Matrix Engine Api Example @name basic_FBO */ var runThis = world => { // Camera _manifest.default.camera.SceneController = true; // Image texs var tex = { source: ["res/images/complex_texture_1/diffuse.webp"], mix_operation: "multiply", params: { TEXTURE_MAG_FILTER: world.GL.gl.NEAREST, TEXTURE_MIN_FILTER: world.GL.gl.NEAREST } }; world.Add("cubeLightTex", 0.2, "myCube", tex); _manifest.default.scene.myCube.position.SetZ(-11); _manifest.default.scene.myCube.position.SetX(1); _manifest.default.scene.myCube.position.SetY(0.6); // App.scene.myCube.activateShadows('spot'); var textuteImageSamplers2 = { source: ["res/bvh-skeletal-base/swat-guy/textures/Ch15_1001_Diffuse.png", "res/bvh-skeletal-base/swat-guy/textures/Ch15_1001_Diffuse.png"], mix_operation: "multiply" }; // Load obj seq animation const createObjSequence = objName => { function onLoadObj(meshes) { _manifest.default.meshes = meshes; for (let key in meshes) { matrixEngine.objLoader.initMeshBuffers(world.GL.gl, meshes[key]); } var textuteImageSamplers2 = { source: ["res/bvh-skeletal-base/swat-guy/textures/Ch15_1001_Diffuse.png"], mix_operation: "multiply", // ENUM : multiply , divide params: { TEXTURE_MAG_FILTER: world.GL.gl.NEAREST, TEXTURE_MIN_FILTER: world.GL.gl.NEAREST } }; setTimeout(function () { var animArg = { id: objName, meshList: meshes, // sumOfAniFrames: 61, No need if `animations` exist! currentAni: 0, // speed: 3, No need if `animations` exist! // upgrade - optimal animations: { active: 'walk', walk: { from: 0, to: 35, speed: 3 }, walkPistol: { from: 36, to: 60, speed: 3 } } }; world.Add("obj", 1, objName, textuteImageSamplers2, meshes[objName], animArg); _manifest.default.scene[objName].position.y = -1; _manifest.default.scene[objName].position.z = -2; _manifest.default.scene[objName].rotation.rotationSpeed.y = 50; }, 1); } matrixEngine.objLoader.downloadMeshes(matrixEngine.objLoader.makeObjSeqArg({ id: objName, path: "res/bvh-skeletal-base/swat-guy/anims/swat-multi", from: 1, to: 61 }), onLoadObj); }; createObjSequence('player'); // FBO BASIC world.Add("squareTex", 3, "myMirror", tex); _manifest.default.scene.myMirror.position.SetZ(-12); _manifest.default.scene.myMirror.position.SetX(0); _manifest.default.scene.myMirror.position.SetY(0); _manifest.default.scene.myMirror.setFBO(); world.Add("cubeLightTex", 0.5, "myMirrorBottom", tex); _manifest.default.scene.myMirrorBottom.position.SetZ(-5); _manifest.default.scene.myMirrorBottom.position.SetX(2); _manifest.default.scene.myMirrorBottom.position.SetY(2); _manifest.default.scene.myMirrorBottom.rotation.rotx = 20; // App.scene.myMirrorBottom.setFBO(); // App.scene.myMirror.rotation.rotationSpeed.z = 10; _manifest.default.scene.myMirrorBottom.activateShadows(); // TEST ALSO ANIMATIONLINE matrixEngine.matrixWorld.world.useAnimationLine({ sequenceSize: 500, totalSequence: 2 }); // Click event canvas.addEventListener('mousedown', ev => { matrixEngine.raycaster.checkingProcedure(ev); }); addEventListener("ray.hit.event", function (e) { e.detail.hitObject.LightsData.ambientLight.r = matrixEngine.utility.randomFloatFromTo(0, 2); e.detai