mirror of
https://github.com/liabru/matter-js.git
synced 2024-11-23 09:26:51 -05:00
434 lines
72 KiB
JavaScript
434 lines
72 KiB
JavaScript
|
/*!
|
||
|
* matter-tools 0.7.0 by Liam Brummitt 2016-11-18
|
||
|
* https://github.com/liabru/matter-tools
|
||
|
* License MIT
|
||
|
*/
|
||
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||
|
module.exports = factory(require("MatterTools"), require("Matter"));
|
||
|
else if(typeof define === 'function' && define.amd)
|
||
|
define(["MatterTools", "Matter"], factory);
|
||
|
else if(typeof exports === 'object')
|
||
|
exports["Gui"] = factory(require("MatterTools"), require("Matter"));
|
||
|
else
|
||
|
root["MatterTools"] = root["MatterTools"] || {}, root["MatterTools"]["Gui"] = factory(root["MatterTools"], root["Matter"]);
|
||
|
})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_5__) {
|
||
|
return /******/ (function(modules) { // webpackBootstrap
|
||
|
/******/ // The module cache
|
||
|
/******/ var installedModules = {};
|
||
|
|
||
|
/******/ // The require function
|
||
|
/******/ function __webpack_require__(moduleId) {
|
||
|
|
||
|
/******/ // Check if module is in cache
|
||
|
/******/ if(installedModules[moduleId])
|
||
|
/******/ return installedModules[moduleId].exports;
|
||
|
|
||
|
/******/ // Create a new module (and put it into the cache)
|
||
|
/******/ var module = installedModules[moduleId] = {
|
||
|
/******/ exports: {},
|
||
|
/******/ id: moduleId,
|
||
|
/******/ loaded: false
|
||
|
/******/ };
|
||
|
|
||
|
/******/ // Execute the module function
|
||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||
|
|
||
|
/******/ // Flag the module as loaded
|
||
|
/******/ module.loaded = true;
|
||
|
|
||
|
/******/ // Return the exports of the module
|
||
|
/******/ return module.exports;
|
||
|
/******/ }
|
||
|
|
||
|
|
||
|
/******/ // expose the modules object (__webpack_modules__)
|
||
|
/******/ __webpack_require__.m = modules;
|
||
|
|
||
|
/******/ // expose the module cache
|
||
|
/******/ __webpack_require__.c = installedModules;
|
||
|
|
||
|
/******/ // __webpack_public_path__
|
||
|
/******/ __webpack_require__.p = "/demo/lib";
|
||
|
|
||
|
/******/ // Load entry module and return exports
|
||
|
/******/ return __webpack_require__(0);
|
||
|
/******/ })
|
||
|
/************************************************************************/
|
||
|
/******/ ([
|
||
|
/* 0 */
|
||
|
/***/ function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
/**
|
||
|
* A tool for modifying the properties of an engine and renderer.
|
||
|
* @module Gui
|
||
|
*/
|
||
|
|
||
|
var Gui = module.exports = {};
|
||
|
|
||
|
var dat = __webpack_require__(4);
|
||
|
var ToolsCommon = __webpack_require__(2);
|
||
|
var Serializer = __webpack_require__(1).Serializer;
|
||
|
var Matter = __webpack_require__(5);
|
||
|
var Engine = Matter.Engine;
|
||
|
var Detector = Matter.Detector;
|
||
|
var Grid = Matter.Grid;
|
||
|
var World = Matter.World;
|
||
|
var Bodies = Matter.Bodies;
|
||
|
var Events = Matter.Events;
|
||
|
|
||
|
/**
|
||
|
* Creates a Gui
|
||
|
* @function Gui.create
|
||
|
* @param {engine} [engine]
|
||
|
* @param {runner} [runner]
|
||
|
* @param {render} [render]
|
||
|
* @return {gui} The created gui instance
|
||
|
*/
|
||
|
Gui.create = function (engine, runner, render) {
|
||
|
dat.GUI.TEXT_CLOSED = '▲';
|
||
|
dat.GUI.TEXT_OPEN = '▼';
|
||
|
|
||
|
var datGui = new dat.GUI();
|
||
|
|
||
|
var gui = {
|
||
|
engine: engine,
|
||
|
runner: runner,
|
||
|
render: render,
|
||
|
datGui: datGui,
|
||
|
broadphase: 'grid',
|
||
|
broadphaseCache: {
|
||
|
grid: engine.broadphase.controller === Grid ? engine.broadphase : Grid.create(),
|
||
|
bruteForce: {
|
||
|
detector: Detector.bruteForce
|
||
|
}
|
||
|
},
|
||
|
amount: 1,
|
||
|
size: 40,
|
||
|
sides: 4,
|
||
|
density: 0.001,
|
||
|
restitution: 0,
|
||
|
friction: 0.1,
|
||
|
frictionStatic: 0.5,
|
||
|
frictionAir: 0.01,
|
||
|
offset: { x: 0, y: 0 },
|
||
|
renderer: 'canvas',
|
||
|
chamfer: 0,
|
||
|
isRecording: false
|
||
|
};
|
||
|
|
||
|
if (Serializer) {
|
||
|
gui.serializer = Serializer.create();
|
||
|
}
|
||
|
|
||
|
var styles = __webpack_require__(6);
|
||
|
ToolsCommon.injectStyles(styles, 'matter-gui-style');
|
||
|
|
||
|
_initDatGui(gui);
|
||
|
|
||
|
return gui;
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* Updates the Gui
|
||
|
* @function Gui.update
|
||
|
* @param {gui} gui
|
||
|
*/
|
||
|
Gui.update = function (gui) {
|
||
|
var i;
|
||
|
var datGui = gui.datGui;
|
||
|
|
||
|
for (i in datGui.__folders) {
|
||
|
Gui.update(gui, datGui.__folders[i]);
|
||
|
}
|
||
|
|
||
|
for (i in datGui.__controllers) {
|
||
|
var controller = datGui.__controllers[i];
|
||
|
if (controller.updateDisplay) controller.updateDisplay();
|
||
|
}
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* Closes all sections of the Gui
|
||
|
* @function Gui.closeAll
|
||
|
* @param {gui} gui
|
||
|
*/
|
||
|
Gui.closeAll = function (gui) {
|
||
|
var datGui = gui.datGui;
|
||
|
|
||
|
for (var i in datGui.__folders) {
|
||
|
datGui.__folders[i].close();
|
||
|
}
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* Destroys the GUI
|
||
|
* @function Gui.destroy
|
||
|
* @param {gui} gui
|
||
|
*/
|
||
|
Gui.destroy = function (gui) {
|
||
|
gui.datGui.destroy();
|
||
|
};
|
||
|
|
||
|
var _initDatGui = function _initDatGui(gui) {
|
||
|
var engine = gui.engine,
|
||
|
runner = gui.runner,
|
||
|
datGui = gui.datGui;
|
||
|
|
||
|
var funcs = {
|
||
|
addBody: function addBody() {
|
||
|
_addBody(gui);
|
||
|
},
|
||
|
clear: function clear() {
|
||
|
_clear(gui);
|
||
|
},
|
||
|
save: function save() {
|
||
|
Serializer.saveState(gui.serializer, engine, 'guiState');Events.trigger(gui, 'save');
|
||
|
},
|
||
|
load: function load() {
|
||
|
Serializer.loadState(gui.serializer, engine, 'guiState');Events.trigger(gui, 'load');
|
||
|
}
|
||
|
};
|
||
|
|
||
|
var metrics = datGui.addFolder('Metrics');
|
||
|
|
||
|
if (runner) {
|
||
|
metrics.add(runner, 'fps').listen();
|
||
|
}
|
||
|
|
||
|
if (engine.metrics.extended) {
|
||
|
if (runner) {
|
||
|
metrics.add(runner, 'delta').listen();
|
||
|
metrics.add(runner, 'correction').listen();
|
||
|
}
|
||
|
|
||
|
if (engine) {
|
||
|
metrics.add(engine.metrics, 'bodies').listen();
|
||
|
metrics.add(engine.metrics, 'collisions').listen();
|
||
|
metrics.add(engine.metrics, 'pairs').listen();
|
||
|
metrics.add(engine.metrics, 'broadEff').listen();
|
||
|
metrics.add(engine.metrics, 'midEff').listen();
|
||
|
metrics.add(engine.metrics, 'narrowEff').listen();
|
||
|
metrics.add(engine.metrics, 'narrowReuse').listen();
|
||
|
}
|
||
|
metrics.close();
|
||
|
} else {
|
||
|
metrics.open();
|
||
|
}
|
||
|
|
||
|
if (engine) {
|
||
|
var controls = datGui.addFolder('Add Body');
|
||
|
controls.add(gui, 'amount', 1, 5).step(1);
|
||
|
controls.add(gui, 'size', 5, 150).step(1);
|
||
|
controls.add(gui, 'sides', 1, 8).step(1);
|
||
|
controls.add(gui, 'density', 0.0001, 0.01).step(0.001);
|
||
|
controls.add(gui, 'friction', 0, 1).step(0.05);
|
||
|
controls.add(gui, 'frictionStatic', 0, 10).step(0.1);
|
||
|
controls.add(gui, 'frictionAir', 0, gui.frictionAir * 10).step(gui.frictionAir / 10);
|
||
|
controls.add(gui, 'restitution', 0, 1).step(0.1);
|
||
|
controls.add(gui, 'chamfer', 0, 30).step(2);
|
||
|
controls.add(funcs, 'addBody');
|
||
|
controls.open();
|
||
|
|
||
|
var worldGui = datGui.addFolder('World');
|
||
|
|
||
|
if (gui.serializer) {
|
||
|
worldGui.add(funcs, 'load');
|
||
|
worldGui.add(funcs, 'save');
|
||
|
}
|
||
|
|
||
|
worldGui.add(funcs, 'clear');
|
||
|
worldGui.open();
|
||
|
|
||
|
var gravity = worldGui.addFolder('Gravity');
|
||
|
gravity.add(engine.world.gravity, 'x', -1, 1).step(0.01);
|
||
|
gravity.add(engine.world.gravity, 'y', -1, 1).step(0.01);
|
||
|
gravity.open();
|
||
|
|
||
|
var physics = datGui.addFolder('Engine');
|
||
|
physics.add(engine, 'enableSleeping');
|
||
|
|
||
|
physics.add(engine.timing, 'timeScale', 0, 1.2).step(0.05).listen();
|
||
|
physics.add(engine, 'velocityIterations', 1, 10).step(1);
|
||
|
physics.add(engine, 'positionIterations', 1, 10).step(1);
|
||
|
|
||
|
if (runner) {
|
||
|
physics.add(runner, 'enabled');
|
||
|
}
|
||
|
|
||
|
physics.open();
|
||
|
}
|
||
|
|
||
|
if (gui.render) {
|
||
|
var render = datGui.addFolder('Render');
|
||
|
render.add(gui.render.options, 'wireframes');
|
||
|
render.add(gui.render.options, 'showDebug');
|
||
|
render.add(gui.render.options, 'showPositions');
|
||
|
render.add(gui.render.options, 'showBroadphase');
|
||
|
render.add(gui.render.options, 'showBounds');
|
||
|
render.add(gui.render.options, 'showVelocity');
|
||
|
render.add(gui.render.options, 'showCollisions');
|
||
|
render.add(gui.render.options, 'showSeparations');
|
||
|
render.add(gui.render.options, 'showAxes');
|
||
|
render.add(gui.render.options, 'showAngleIndicator');
|
||
|
render.add(gui.render.options, 'showSleeping');
|
||
|
render.add(gui.render.options, 'showIds');
|
||
|
render.add(gui.render.options, 'showVertexNumbers');
|
||
|
render.add(gui.render.options, 'showConvexHulls');
|
||
|
render.add(gui.render.options, 'showInternalEdges');
|
||
|
render.add(gui.render.options, 'enabled');
|
||
|
render.open();
|
||
|
}
|
||
|
};
|
||
|
|
||
|
var _addBody = function _addBody(gui) {
|
||
|
var engine = gui.engine;
|
||
|
|
||
|
var options = {
|
||
|
density: gui.density,
|
||
|
friction: gui.friction,
|
||
|
frictionStatic: gui.frictionStatic,
|
||
|
frictionAir: gui.frictionAir,
|
||
|
restitution: gui.restitution
|
||
|
};
|
||
|
|
||
|
if (gui.chamfer && gui.sides > 2) {
|
||
|
options.chamfer = {
|
||
|
radius: gui.chamfer
|
||
|
};
|
||
|
}
|
||
|
|
||
|
for (var i = 0; i < gui.amount; i++) {
|
||
|
World.add(engine.world, Bodies.polygon(gui.offset.x + 120 + i * gui.size + i * 50, gui.offset.y + 200, gui.sides, gui.size, options));
|
||
|
}
|
||
|
};
|
||
|
|
||
|
var _clear = function _clear(gui) {
|
||
|
var engine = gui.engine;
|
||
|
|
||
|
World.clear(engine.world, true);
|
||
|
Engine.clear(engine);
|
||
|
|
||
|
// clear scene graph (if defined in controller)
|
||
|
if (gui.render) {
|
||
|
var renderController = gui.render.controller;
|
||
|
if (renderController.clear) renderController.clear(gui.render);
|
||
|
}
|
||
|
|
||
|
Events.trigger(gui, 'clear');
|
||
|
};
|
||
|
|
||
|
/*
|
||
|
*
|
||
|
* Events Documentation
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
* Fired after the gui's clear button pressed
|
||
|
*
|
||
|
* @event clear
|
||
|
* @param {} event An event object
|
||
|
* @param {} event.source The source object of the event
|
||
|
* @param {} event.name The name of the event
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
* Fired after the gui's save button pressed
|
||
|
*
|
||
|
* @event save
|
||
|
* @param {} event An event object
|
||
|
* @param {} event.source The source object of the event
|
||
|
* @param {} event.name The name of the event
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
* Fired after the gui's load button pressed
|
||
|
*
|
||
|
* @event load
|
||
|
* @param {} event An event object
|
||
|
* @param {} event.source The source object of the event
|
||
|
* @param {} event.name The name of the event
|
||
|
*/
|
||
|
|
||
|
/*** EXPORTS FROM exports-loader ***/
|
||
|
|
||
|
/***/ },
|
||
|
/* 1 */
|
||
|
/***/ function(module, exports) {
|
||
|
|
||
|
module.exports = __WEBPACK_EXTERNAL_MODULE_1__;
|
||
|
|
||
|
/***/ },
|
||
|
/* 2 */
|
||
|
/***/ function(module, exports) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
/**
|
||
|
* @class Common
|
||
|
*/
|
||
|
|
||
|
var Common = module.exports = {};
|
||
|
|
||
|
Common.injectStyles = function (styles, id) {
|
||
|
if (document.getElementById(id)) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
var root = document.createElement('div');
|
||
|
root.innerHTML = '<style id="' + id + '" type="text/css">' + styles + '</style>';
|
||
|
|
||
|
var lastStyle = document.head.querySelector('style:last-child');
|
||
|
Common.domInsertBefore(root.firstElementChild, lastStyle);
|
||
|
};
|
||
|
|
||
|
Common.injectScript = function (url, id, callback) {
|
||
|
if (document.getElementById(id)) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
var script = document.createElement('script');
|
||
|
script.id = id;
|
||
|
script.src = url;
|
||
|
script.onload = callback;
|
||
|
|
||
|
document.body.appendChild(script);
|
||
|
};
|
||
|
|
||
|
Common.domRemove = function (element) {
|
||
|
return element.parentElement.removeChild(element);
|
||
|
};
|
||
|
|
||
|
Common.domInsertBefore = function (element, before) {
|
||
|
return before.parentNode.insertBefore(element, before.previousElementSibling);
|
||
|
};
|
||
|
|
||
|
/*** EXPORTS FROM exports-loader ***/
|
||
|
|
||
|
/***/ },
|
||
|
/* 3 */,
|
||
|
/* 4 */
|
||
|
/***/ function(module, exports, __webpack_require__) {
|
||
|
|
||
|
!function(e,t){ true?module.exports=t():"function"==typeof define&&define.amd?define(t):"object"==typeof exports?exports.dat=t():e.dat=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";e.exports=n(1)},function(e,t,n){"use strict";e.exports={color:{Color:n(2),math:n(6),interpret:n(3)},controllers:{Controller:n(7),BooleanController:n(8),OptionController:n(10),StringController:n(11),NumberController:n(12),NumberControllerBox:n(13),NumberControllerSlider:n(14),FunctionController:n(20),ColorController:n(21)},dom:{dom:n(9)},gui:{GUI:n(22)},GUI:n(22)}},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t,n){Object.defineProperty(e,t,{get:function(){return"RGB"===this.__state.space?this.__state[t]:(_.recalculateRGB(this,t,n),this.__state[t])},set:function(e){"RGB"!==this.__state.space&&(_.recalculateRGB(this,t,n),this.__state.space="RGB"),this.__state[t]=e}})}function a(e,t){Object.defineProperty(e,t,{get:function(){return"HSV"===this.__state.space?this.__state[t]:(_.recalculateHSV(this),this.__state[t])},set:function(e){"HSV"!==this.__state.space&&(_.recalculateHSV(this),this.__state.space="HSV"),this.__state[t]=e}})}t.__esModule=!0;var s=n(3),l=o(s),u=n(6),d=o(u),c=n(4),f=o(c),h=n(5),p=o(h),_=function(){function e(){if(i(this,e),this.__state=l["default"].apply(this,arguments),this.__state===!1)throw"Failed to interpret color arguments";this.__state.a=this.__state.a||1}return e.prototype.toString=function(){return f["default"](this)},e.prototype.toOriginal=function(){return this.__state.conversion.write(this)},e}();_.recalculateRGB=function(e,t,n){if("HEX"===e.__state.space)e.__state[t]=d["default"].component_from_hex(e.__state.hex,n);else{if("HSV"!==e.__state.space)throw"Corrupted color state";p["default"].extend(e.__state,d["default"].hsv_to_rgb(e.__state.h,e.__state.s,e.__state.v))}},_.recalculateHSV=function(e){var t=d["default"].rgb_to_hsv(e.r,e.g,e.b);p["default"].extend(e.__state,{s:t.s,v:t.v}),p["default"].isNaN(t.h)?p["default"].isUndefined(e.__state.h)&&(e.__state.h=0):e.__state.h=t.h},_.COMPONENTS=["r","g","b","h","s","v","hex","a"],r(_.prototype,"r",2),r(_.prototype,"g",1),r(_.prototype,"b",0),a(_.prototype,"h"),a(_.prototype,"s"),a(_.prototype,"v"),Object.defineProperty(_.prototype,"a",{get:function(){return this.__state.a},set:function(e){this.__state.a=e}}),Object.defineProperty(_.prototype,"hex",{get:function(){return"HEX"!==!this.__state.space&&(this.__state.hex=d["default"].rgb_to_hex(this.r,this.g,this.b)),this.__state.hex},set:function(e){this.__state.space="HEX",this.__state.hex=e}}),t["default"]=_,e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var i=n(4),r=o(i),a=n(5),s=o(a),l=[{litmus:s["default"].isString,conversions:{THREE_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return null===t?!1:{space:"HEX",hex:parseInt("0x"+t[1].toString()+t[1].toString()+t[2].toString()+t[2].toString()+t[3].toString()+t[3].toString(),0)}},write:r["default"]},SIX_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9]{6})$/i);return null===t?!1:{space:"HEX",hex:parseInt("0x"+t[1].toString(),0)}},write:r["default"]},CSS_RGB:{read:function(e){var t=e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null===t?!1:{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3])}},write:r["default"]},CSS_RGBA:{read:function(e){var t=e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);return null===t?!1:{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3]),a:parseFloat(t[4])}},write:r["default"]}}},{litmus:s["default"].isNumber,conversions:{HEX:{read:function(e){return{space:"HEX",hex:e,conversionName:"HEX"}},write:function(e){return e.hex}}}},{litmu
|
||
|
this.domElement.appendChild(this.__input),this.domElement.appendChild(this.__selector),this.updateDisplay()}return r(t,e),t.prototype.updateDisplay=function(){var e=_["default"](this.getValue());if(e!==!1){var t=!1;g["default"].each(h["default"].COMPONENTS,function(n){return g["default"].isUndefined(e[n])||g["default"].isUndefined(this.__color.__state[n])||e[n]===this.__color.__state[n]?void 0:(t=!0,{})},this),t&&g["default"].extend(this.__color.__state,e)}g["default"].extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var n=this.__color.v<.5||this.__color.s>.5?255:0,o=255-n;g["default"].extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toString(),border:this.__field_knob_border+"rgb("+n+","+n+","+n+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,a(this.__saturation_field,"left","#fff",this.__temp.toString()),g["default"].extend(this.__input.style,{backgroundColor:this.__input.value=this.__color.toString(),color:"rgb("+n+","+n+","+n+")",textShadow:this.__input_textShadow+"rgba("+o+","+o+","+o+",.7)"})},t}(u["default"]),v=["-moz-","-o-","-webkit-","-ms-",""];t["default"]=b,e.exports=t["default"]},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n){var o=document.createElement("li");return t&&o.appendChild(t),n?e.__ul.insertBefore(o,params.before):e.__ul.appendChild(o),e.onResize(),o}function r(e,t){var n=e.__preset_select[e.__preset_select.selectedIndex];t?n.innerHTML=n.value+"*":n.innerHTML=n.value}function a(e,t,n){if(n.__li=t,n.__gui=e,K["default"].extend(n,{options:function(t){return arguments.length>1?(n.remove(),l(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[K["default"].toArray(arguments)]})):K["default"].isArray(t)||K["default"].isObject(t)?(n.remove(),l(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[t]})):void 0},name:function(e){return n.__li.firstElementChild.firstElementChild.innerHTML=e,n},listen:function(){return n.__gui.listen(n),n},remove:function(){return n.__gui.remove(n),n}}),n instanceof j["default"])!function(){var e=new M["default"](n.object,n.property,{min:n.__min,max:n.__max,step:n.__step});K["default"].each(["updateDisplay","onChange","onFinishChange"],function(t){var o=n[t],i=e[t];n[t]=e[t]=function(){var t=Array.prototype.slice.call(arguments);return o.apply(n,t),i.apply(e,t)}}),G["default"].addClass(t,"has-slider"),n.domElement.insertBefore(e.domElement,n.domElement.firstElementChild)}();else if(n instanceof M["default"]){var o=function(t){return K["default"].isNumber(n.__min)&&K["default"].isNumber(n.__max)?(n.remove(),l(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[n.__min,n.__max,n.__step]})):t};n.min=K["default"].compose(o,n.min),n.max=K["default"].compose(o,n.max)}else n instanceof T["default"]?(G["default"].bind(t,"click",function(){G["default"].fakeEvent(n.__checkbox,"click")}),G["default"].bind(n.__checkbox,"click",function(e){e.stopPropagation()})):n instanceof R["default"]?(G["default"].bind(t,"click",function(){G["default"].fakeEvent(n.__button,"click")}),G["default"].bind(t,"mouseover",function(){G["default"].addClass(n.__button,"hover")}),G["default"].bind(t,"mouseout",function(){G["default"].removeClass(n.__button,"hover")})):n instanceof D["default"]&&(G["default"].addClass(t,"color"),n.updateDisplay=K["default"].compose(function(e){return t.style.borderLeftColor=n.__color.toString(),e},n.updateDisplay),n.updateDisplay());n.setValue=K["default"].compose(function(t){return e.getRoot().__preset_select&&n.isModified()&&r(e.getRoot(),!0),t},n.setValue)}function s(e,t){var n=e.getRoot(),o=n.__rememberedObjects.indexOf(t.object);if(-1!==o){var i=n.__rememberedObjectIndecesToControllers[o];if(void 0===i&&(i={},n.__rememberedObjectIndecesToControllers[o]=i),i[t.property]=t,n.load&&n.load.remembered){var r=n.load.remembered,a=void 0;if(r[e.preset])a=r[e.preset];else{if(!r[Z])return;a=r[Z]}if(a[o]&&void 0!==a[o][t.proper
|
||
|
|
||
|
/***/ },
|
||
|
/* 5 */
|
||
|
/***/ function(module, exports) {
|
||
|
|
||
|
module.exports = __WEBPACK_EXTERNAL_MODULE_5__;
|
||
|
|
||
|
/***/ },
|
||
|
/* 6 */
|
||
|
/***/ function(module, exports) {
|
||
|
|
||
|
module.exports = "/*\n*\tMatterTools.Gui\n*/\n\nbody .dg .c,\nbody .dg .cr.function,\nbody .dg .c select,\nbody .dg .property-name,\nbody .dg .title {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\nbody .dg.main {\n z-index: 10;\n box-shadow: 0 0 30px rgba(0,0,0,0.2);\n height: 100%;\n background: rgb(28, 29, 47);\n position: fixed;\n top: 0;\n right: 0;\n}\n\nbody .dg.ac {\n position: static;\n top: inherit;\n left: inherit;\n bottom: inherit;\n right: inherit;\n}\n\n@media only screen and (max-width : 1500px) {\n body .dg.main {\n transform: translate(230px, 0);\n }\n\n body .dg.main:hover {\n transform: translate(0, 0);\n }\n\n body .dg.main {\n -webkit-transition: transform 500ms cubic-bezier(0.965, 0.025, 0.735, 0.415); \n -moz-transition: transform 500ms cubic-bezier(0.965, 0.025, 0.735, 0.415); \n -o-transition: transform 500ms cubic-bezier(0.965, 0.025, 0.735, 0.415); \n transition: transform 500ms cubic-bezier(0.965, 0.025, 0.735, 0.415);\n\n -webkit-transition-timing-function: cubic-bezier(0.965, 0.025, 0.735, 0.415); \n -moz-transition-timing-function: cubic-bezier(0.965, 0.025, 0.735, 0.415); \n -o-transition-timing-function: cubic-bezier(0.965, 0.025, 0.735, 0.415); \n transition-timing-function: cubic-bezier(0.965, 0.025, 0.735, 0.415);\n \n transition-delay: 2s;\n -webkit-transition-delay: 2s;\n }\n\n body .dg.main:hover {\n -webkit-transition: transform 500ms cubic-bezier(0.095, 0.665, 0.400, 0.835); \n -moz-transition: transform 500ms cubic-bezier(0.095, 0.665, 0.400, 0.835); \n -o-transition: transform 500ms cubic-bezier(0.095, 0.665, 0.400, 0.835); \n transition: transform 500ms cubic-bezier(0.095, 0.665, 0.400, 0.835);\n\n -webkit-transition-timing-function: cubic-bezier(0.095, 0.665, 0.400, 0.835); \n -moz-transition-timing-function: cubic-bezier(0.095, 0.665, 0.400, 0.835); \n -o-transition-timing-function: cubic-bezier(0.095, 0.665, 0.400, 0.835); \n transition-timing-function: cubic-bezier(0.095, 0.665, 0.400, 0.835);\n\n transition-delay: 0;\n -webkit-transition-delay: 0;\n }\n}\n\nbody .dg.main .close-button {\n display: none;\n}\n\nbody .dg.main::-webkit-scrollbar {\n background: #1c1c25;\n width: 12px;\n}\n\nbody .dg.main::-webkit-scrollbar-thumb {\n background: transparent;\n width: 5px;\n border-left: 5px solid transparent;\n border-right: 6px solid #2a2a31;\n border-radius: 0;\n}\n \nbody .dg {\n color: #9196ad;\n text-shadow: none !important;\n}\n\nbody .dg li:not(.folder) {\n height: 28px;\n background: #1c1c25;\n border-bottom: 0px;\n padding: 0 0 0 12px;\n}\n \nbody .dg li.save-row .button {\n text-shadow: none !important;\n}\n\nbody .dg li.title {\n padding-left: 22px;\n color: #6f7388;\n border-bottom: 1px solid #29292d;\n background: #0d0f1b url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 10px 10px no-repeat;\n}\n\nbody .dg .cr.boolean:hover {\n background: #232431;\n}\n\nbody .dg .cr.function {\n background: #262731;\n color: #6d7082;\n border-bottom: 1px solid #222535;\n border-top: 1px solid #3c3e48;\n}\n\nbody .dg .cr.function:hover {\n background: #30313e;\n}\n\nbody .dg .cr.function:active {\n transform: translateY(1px);\n}\n\nbody .dg .c,\nbody .dg .property-name {\n width: 50%;\n}\n\nbody .dg .c select {\n margin-top: 2px;\n margin-left: -5px;\n padding: 3px 5px;\n}\n\nbody .dg .c select,\nbody .dg .c input[type=text],\nbody .dg .cr.number input[type=text] {\n text-align: right;\n background: #191a23;\n color: #686c7b;\n border: 0;\n font-size: 10px;\n}\n\nbody .dg .cr.number,\nbody .dg .cr.boolean,\nbody .dg .cr.function {\n border-left: 0;\n}\n\nbody .dg .c select,\nbody .dg .c select:focus {\n width: 88px;\n outline: 0;\n}\n \nbody .dg .c input[type=text]:hover {\n background: #1c1d2f;\n}\n \nbody .dg .c input[type=text]
|
||
|
|
||
|
/***/ }
|
||
|
/******/ ])
|
||
|
});
|
||
|
;
|