Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_setShaderOptions: function(shaderName) {
var options = require('mage-engine').engine.fx.shadersEngine.get(shaderName).options,
container = document.querySelector('#shaderOptions');
if (options) {
// now creating form for shader option
for (var k in options) {
var input = app.interface.sidebarHelper.createFormInput(k, options[k]);
container.appendChild(input);
}
container.appendChild(app.interface.sidebarHelper.createButton('update', app.interface.rightSidebar.meshListener.changeShaderOption))
} else {
console.warn('Selected shader doesn\'t have options.');
}
},
onKeyPress = ({ event }) => {
switch (event.key) {
case "q": // Q
this.transform.setSpace(this.transform.space === "local" ? "world" : "local");
break;
case "ctrl": // Ctrl
this.transform.setTranslationSnap(100);
this.transform.setRotationSnap(THREE.Math.degToRad(15));
break;
case "w": // W
this.transform.setMode("translate");
break;
case "e": // E
this.transform.setMode("rotate");
break;
case "r": // R
this.transform.setMode("scale");
break;
case 187:
case 107: // +, =, num+
this.transform.setSize(this.transform.size + 0.1);
break;
case 189:
case 109: // -, _, num-
onCreate() {
//ControlsManager.setOrbitControl();
const cube = this.sceneHelper.addCube(20, 0xffffff);
this.sceneHelper.addCube(40, 0x00ffff);
SceneManager.camera.position({y: 70, z: 150});
SceneManager.camera.lookAt(0, 0, 0);
cube.position({y: 40});
}
}
onCreate() {
SceneManager.camera.position({y: 70, z: 150});
SceneManager.camera.lookAt(0, 0, 0);
this.setTranformControls();
this.enableInput();
this.sceneHelper.addGrid(2000, 100);
}
}
onCreate() {
ControlsManager.setOrbitControl();
window.cube = this.sceneHelper.addCube(20, 0xffffff);
SceneManager.camera.position({y: 70, z: 150});
SceneManager.camera.lookAt(0, 0, 0);
this.sceneHelper.addGrid(200, 20);
cube.position({z: 10});
}
}
onCreate() {
ControlsManager.setOrbitControl();
window.cube = this.sceneHelper.addCube(20, 0xffffff);
SceneManager.camera.position({y: 70, z: 150});
SceneManager.camera.lookAt(0, 0, 0);
this.sceneHelper.addGrid(200, 20);
cube.position({z: 10});
}
}
onCreate() {
SceneManager.camera.position({y: 70, z: 150});
SceneManager.camera.lookAt(0, 0, 0);
this.setTranformControls();
this.enableInput();
this.sceneHelper.addGrid(2000, 100);
}
}
onCreate() {
//ControlsManager.setOrbitControl();
const cube = this.sceneHelper.addCube(20, 0xffffff);
this.sceneHelper.addCube(40, 0x00ffff);
SceneManager.camera.position({y: 70, z: 150});
SceneManager.camera.lookAt(0, 0, 0);
cube.position({y: 40});
}
}
setTranformControls() {
ControlsManager.setOrbitControl();
ControlsManager.setTransformControl();
this.transform = ControlsManager.getControl('transform');
this.transform.addEventListener('objectChange', this.dispatchMeshChange.bind(this));
}
onCreate() {
ControlsManager.setOrbitControl();
window.cube = this.sceneHelper.addCube(20, 0xffffff);
SceneManager.camera.position({y: 70, z: 150});
SceneManager.camera.lookAt(0, 0, 0);
this.sceneHelper.addGrid(200, 20);
cube.position({z: 10});
}
}