Skip to content

Commit

Permalink
Merge pull request #3304 from BabylonJS/master
Browse files Browse the repository at this point in the history
Nightly #1 (there will be a lot today :))
  • Loading branch information
deltakosh committed Dec 5, 2017
2 parents 3e030b3 + 7829ae4 commit 2ac4a37
Show file tree
Hide file tree
Showing 21 changed files with 379 additions and 233 deletions.
3 changes: 2 additions & 1 deletion Tools/Gulp/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,8 @@
"../../src/Physics/Plugins/babylon.oimoJSPlugin.js"
],
"dependUpon": [
"core"
"core",
"picking"
]
},
"textureFormats": {
Expand Down
17 changes: 7 additions & 10 deletions dist/inspector/babylon.inspector.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
@import url(https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css);
@import url(https://fonts.googleapis.com/css?family=Inconsolata);

@import url(https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css);
@import url(https://fonts.googleapis.com/css?family=Inconsolata);
.insp-wrapper {
Expand All @@ -9,14 +6,14 @@
font-size: 0.9em;
font-family: "Inconsolata", sans-serif;
background-color: #242424;
/**
* A tool contained in the tree panel (available for each item of the tree)
/**
* A tool contained in the tree panel (available for each item of the tree)
*/
/**
* The toolbar contains :
* - a refresh tool - refresh the whole panel
* - a popup tool - Open the inspector in a new panel
* ...
/**
* The toolbar contains :
* - a refresh tool - refresh the whole panel
* - a popup tool - Open the inspector in a new panel
* ...
*/ }
.insp-wrapper .gutter {
background-color: #2c2c2c; }
Expand Down
6 changes: 3 additions & 3 deletions dist/preview release/inspector/babylon.inspector.bundle.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/preview release/inspector/babylon.inspector.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,10 @@ declare module INSPECTOR {
* Returns true if the user browser is edge.
*/
static IsBrowserEdge(): boolean;
/**
* Returns true if the user browser is IE.
*/
static IsBrowserIE(): boolean;
/**
* Returns the name of the type of the given object, where the name
* is in PROPERTIES constant.
Expand Down
13 changes: 11 additions & 2 deletions dist/preview release/inspector/babylon.inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -1562,8 +1562,9 @@ var INSPECTOR;
PropertyLine.prototype._createElements = function () {
// Colors
if (this.type == 'Color3' || this.type == 'Color4') {
this._elements.push(new INSPECTOR.ColorPickerElement(this.value, this));
//this._elements.push(new ColorElement(this.value));
if (!INSPECTOR.Helpers.IsBrowserIE()) {
this._elements.push(new INSPECTOR.ColorPickerElement(this.value, this));
}
}
// Texture
if (this.type == 'Texture') {
Expand Down Expand Up @@ -2258,6 +2259,14 @@ var INSPECTOR;
var regexp = /Edge/;
return regexp.test(navigator.userAgent);
};
/**
* Returns true if the user browser is IE.
*/
Helpers.IsBrowserIE = function () {
//Detect if we are running on a faulty buggy OS.
var regexp = /Trident.*rv\:11\./;
return regexp.test(navigator.userAgent);
};
/**
* Returns the name of the type of the given object, where the name
* is in PROPERTIES constant.
Expand Down
8 changes: 4 additions & 4 deletions dist/preview release/inspector/babylon.inspector.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gui/src/controls/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ module BABYLON.GUI {
this._onImageLoaded();
}
if (value) {
this._domImage.crossOrigin = "anonymous";
Tools.SetCorsBehavior(value, this._domImage);
this._domImage.src = value;
}
}
Expand Down
5 changes: 3 additions & 2 deletions inspector/src/details/PropertyLine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,9 @@ module INSPECTOR {
private _createElements() {
// Colors
if (this.type == 'Color3' || this.type == 'Color4') {
this._elements.push(new ColorPickerElement(this.value, this));
//this._elements.push(new ColorElement(this.value));
if (!Helpers.IsBrowserIE()) {
this._elements.push(new ColorPickerElement(this.value, this));
}
}
// Texture
if (this.type == 'Texture') {
Expand Down
8 changes: 8 additions & 0 deletions inspector/src/helpers/Helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ module INSPECTOR {
var regexp = /Edge/
return regexp.test(navigator.userAgent);
}
/**
* Returns true if the user browser is IE.
*/
public static IsBrowserIE(): boolean {
//Detect if we are running on a faulty buggy OS.
var regexp = /Trident.*rv\:11\./
return regexp.test(navigator.userAgent);
}

/**
* Returns the name of the type of the given object, where the name
Expand Down
35 changes: 18 additions & 17 deletions inspector/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var Test = (function () {
var _this = this;
var canvas = document.getElementById(canvasId);
this.engine = new BABYLON.Engine(canvas, true);
BABYLONDEVTOOLS.Loader.debugShortcut(this.engine);
// BABYLONDEVTOOLS.Loader.debugShortcut(this.engine);
this.scene = null;
window.addEventListener("resize", function () {
_this.engine.resize();
Expand All @@ -15,17 +15,17 @@ var Test = (function () {
Test.prototype._run = function () {
var _this = this;
this._initScene();
this.scene.debugLayer.show({
popup: false,
parentElement: document.getElementById('inspector'),
newColors: {
backgroundColor: '#eee',
backgroundColorLighter: '#fff',
backgroundColorLighter2: '#fff',
backgroundColorLighter3: '#fff',
color: '#333'
}
});
// this.scene.debugLayer.show({
// popup: false,
// parentElement: document.getElementById('inspector'),
// newColors: {
// backgroundColor: '#eee',
// backgroundColorLighter: '#fff',
// backgroundColorLighter2: '#fff',
// backgroundColorLighter3: '#fff',
// color: '#333'
// }
// });
this.scene.executeWhenReady(function () {
_this.engine.runRenderLoop(function () {
_this.scene.render();
Expand All @@ -51,7 +51,7 @@ var Test = (function () {
let p = sceneRoot;
for (let i = 0; i < num; i++) {
// Our built-in 'sphere' shape. Params: name, subdivs, size, scene
let sphere = BABYLON.Mesh.CreateSphere(`sphere${i}`, 16, 2, scene);
let sphere = BABYLON.Mesh.CreateSphere('sphere' + i, 16, 2, scene);

// Move the sphere upward 1/2 its height
sphere.position.y = 0.2;
Expand All @@ -62,13 +62,14 @@ var Test = (function () {
}

let t = 0;
scene.registerBeforeRender(() => {
ground.rotation.y += 0.01;
ground.position.y = Math.cos(t += 0.01);
});
// scene.registerBeforeRender(() => {
// ground.rotation.y += 0.01;
// ground.position.y = Math.cos(t += 0.01);
// });

scene.createDefaultCameraOrLight(true);
scene.activeCamera.attachControl(canvas);
scene.debugLayer.show();

this.scene = scene;
};
Expand Down
2 changes: 1 addition & 1 deletion src/Audio/babylon.sound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ module BABYLON {
this._htmlAudioElement = new Audio(url);
this._htmlAudioElement.controls = false;
this._htmlAudioElement.loop = this.loop;
this._htmlAudioElement.crossOrigin = "anonymous";
Tools.SetCorsBehavior(url, this._htmlAudioElement);
this._htmlAudioElement.preload = "auto";
this._htmlAudioElement.addEventListener("canplaythrough", () => {
this._isReadyToPlay = true;
Expand Down

0 comments on commit 2ac4a37

Please sign in to comment.