unsure about commit

beta.r3js.org
-=yb4f310 2018-02-19 23:33:00 +01:00
parent 7a8cfc87a6
commit 92f124e623
5 changed files with 67 additions and 40 deletions

View File

@ -35,25 +35,25 @@ if (typeof GameLib.D3.Runtime === 'undefined') {
GameLib.D3.Runtime = function(){}; GameLib.D3.Runtime = function(){};
} }
if (typeof Q === 'undefined') { // if (typeof Q === 'undefined') {
//
if (typeof require === 'undefined') { // if (typeof require === 'undefined') {
console.warn('You need the Q promise library for the GameLib.D3'); // console.warn('You need the Q promise library for the GameLib.D3');
throw new Error('You need the Q promise library for the GameLib.D3'); // throw new Error('You need the Q promise library for the GameLib.D3');
} // }
//
var Q = require('q'); // var Q = require('q');
} // }
//
if (typeof _ === 'undefined') { // if (typeof _ === 'undefined') {
//
if (typeof require === 'undefined') { // if (typeof require === 'undefined') {
console.warn('You need the lodash library for the GameLib.D3'); // console.warn('You need the lodash library for the GameLib.D3');
throw new Error('You need the lodash library for the GameLib.D3'); // throw new Error('You need the lodash library for the GameLib.D3');
} // }
//
var _ = require('lodash'); // var _ = require('lodash');
} // }
// This gets injected by gulp // This gets injected by gulp
console.log("Loading GameLib compiled at: " + __DATE__); console.log("Loading GameLib compiled at: " + __DATE__);

View File

@ -139,8 +139,6 @@ GameLib.CustomCode.prototype.launchEditor = function(){
); );
} }
this.editor.on('change', function(){ this.editor.on('change', function(){
this.code = this.editor.getValue(); this.code = this.editor.getValue();

View File

@ -18,6 +18,8 @@
* @constructor * @constructor
* @param apiCamera * @param apiCamera
* @param aspectRatioMode * @param aspectRatioMode
* @param minWidth
* @param minHeight
* @param width * @param width
* @param height * @param height
* @param near * @param near

View File

@ -207,20 +207,40 @@ GameLib.D3.Camera.Orthographic.prototype.updateFromInstance = function() {
GameLib.D3.Camera.Orthographic.prototype.updateFromAspectRatio = function() { GameLib.D3.Camera.Orthographic.prototype.updateFromAspectRatio = function() {
if (this.aspect < 1) { var requiredAspect = this.minWidth / this.minHeight;
if (this.aspect < requiredAspect) {
/** /**
* Make height dependend on width * Make height dependend on width
*/ */
this.width = this.minWidth; this.width = this.minWidth;
this.height = this.minWidth / this.aspect; this.height = this.minWidth / this.aspect;
if (this.height < this.minHeight) { // if (this.height < this.minHeight) {
/** // /**
* We have a problem - our new height is less than our minimum height // * We have a problem - our new height is less than our minimum height
*/ // */
this.height = this.minHeight; //
this.width = this.aspect * this.height; //
} // ;
//
// if (requiredAspect < this.aspect) {
// this.width = requiredAspect * this.height;
// } else {
// this.height = this.minHeight;
// this.width = this.aspect * this.height;
// }
//
//
// } else {
//
// /**
// * Try to fit our game into the window
// * @type {number}
// */
// // var requiredAspect = this.minWidth / this.minHeight;
// // this.width = requiredAspect * this.height;
// }
} else { } else {
/** /**
@ -228,14 +248,14 @@ GameLib.D3.Camera.Orthographic.prototype.updateFromAspectRatio = function() {
*/ */
this.height = this.minHeight; this.height = this.minHeight;
this.width = this.aspect * this.minHeight; this.width = this.aspect * this.minHeight;
//
if (this.width < this.minWidth) { // if (this.width < this.minWidth) {
/** // /**
* We have a problem - our new width is less than our minimum width // * We have a problem - our new width is less than our minimum width
*/ // */
this.width = this.minWidth; // this.width = this.minWidth;
this.height = this.width / this.aspect; // this.height = this.width / this.aspect;
} // }
} }
this.left = this.width / -2; this.left = this.width / -2;

View File

@ -1609,7 +1609,13 @@ GameLib.System.GUI.prototype.buildControl = function(folder, componentTemplate,
property === 'depth' || property === 'depth' ||
property === 'radius' property === 'radius'
) { ) {
controllers.push(folder.add(object, property, 0, 1000, 0.1));
if (object instanceof GameLib.D3.Pass.Bloom) {
controllers.push(folder.add(object, property, -10, 10, 0.001));
} else {
controllers.push(folder.add(object, property, 0, 1000, 0.1));
}
} else if ( } else if (
property === 'near' || property === 'near' ||
property === 'distanceGrain' || property === 'distanceGrain' ||
@ -1617,7 +1623,8 @@ GameLib.System.GUI.prototype.buildControl = function(folder, componentTemplate,
) { ) {
controllers.push(folder.add(object, property, -10, 100, 0.001)); controllers.push(folder.add(object, property, -10, 100, 0.001));
} else if ( } else if (
property === 'bumpScale' property === 'bumpScale' ||
property === 'speed'
) { ) {
controllers.push(folder.add(object, property, 0, 20, 0.001)); controllers.push(folder.add(object, property, 0, 20, 0.001));
} else if ( } else if (
@ -1652,7 +1659,7 @@ GameLib.System.GUI.prototype.buildControl = function(folder, componentTemplate,
property === 'strength' || property === 'strength' ||
property === 'power' property === 'power'
) { ) {
controllers.push(folder.add(object, property, 0, 50, 0.001)); controllers.push(folder.add(object, property, 0, 25, 0.01));
} else if ( } else if (
property === 'thetaLength' || property === 'thetaLength' ||
property === 'angle' property === 'angle'