|
@@ -371,17 +371,14 @@ var INSPECTOR;
|
|
},
|
|
},
|
|
'Vector2': {
|
|
'Vector2': {
|
|
type: BABYLON.Vector2,
|
|
type: BABYLON.Vector2,
|
|
- properties: ['x', 'y'],
|
|
|
|
format: function (vec) { return "x:" + INSPECTOR.Helpers.Trunc(vec.x) + ", y:" + INSPECTOR.Helpers.Trunc(vec.y); }
|
|
format: function (vec) { return "x:" + INSPECTOR.Helpers.Trunc(vec.x) + ", y:" + INSPECTOR.Helpers.Trunc(vec.y); }
|
|
},
|
|
},
|
|
'Vector3': {
|
|
'Vector3': {
|
|
type: BABYLON.Vector3,
|
|
type: BABYLON.Vector3,
|
|
- properties: ['x', 'y', 'z'],
|
|
|
|
format: function (vec) { return "x:" + INSPECTOR.Helpers.Trunc(vec.x) + ", y:" + INSPECTOR.Helpers.Trunc(vec.y) + ", z:" + INSPECTOR.Helpers.Trunc(vec.z); }
|
|
format: function (vec) { return "x:" + INSPECTOR.Helpers.Trunc(vec.x) + ", y:" + INSPECTOR.Helpers.Trunc(vec.y) + ", z:" + INSPECTOR.Helpers.Trunc(vec.z); }
|
|
},
|
|
},
|
|
'Color3': {
|
|
'Color3': {
|
|
type: BABYLON.Color3,
|
|
type: BABYLON.Color3,
|
|
- properties: ['r', 'g', 'b'],
|
|
|
|
format: function (color) { return "R:" + color.r + ", G:" + color.g + ", B:" + color.b; },
|
|
format: function (color) { return "R:" + color.r + ", G:" + color.g + ", B:" + color.b; },
|
|
slider: {
|
|
slider: {
|
|
r: { min: 0, max: 1, step: 0.01 },
|
|
r: { min: 0, max: 1, step: 0.01 },
|
|
@@ -391,7 +388,6 @@ var INSPECTOR;
|
|
},
|
|
},
|
|
'Color4': {
|
|
'Color4': {
|
|
type: BABYLON.Color4,
|
|
type: BABYLON.Color4,
|
|
- properties: ['r', 'g', 'b'],
|
|
|
|
format: function (color) { return "R:" + color.r + ", G:" + color.g + ", B:" + color.b; },
|
|
format: function (color) { return "R:" + color.r + ", G:" + color.g + ", B:" + color.b; },
|
|
slider: {
|
|
slider: {
|
|
r: { min: 0, max: 1, step: 0.01 },
|
|
r: { min: 0, max: 1, step: 0.01 },
|
|
@@ -400,30 +396,14 @@ var INSPECTOR;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
'Quaternion': {
|
|
'Quaternion': {
|
|
- type: BABYLON.Quaternion,
|
|
|
|
- properties: ['x', 'y', 'z', 'w']
|
|
|
|
|
|
+ type: BABYLON.Quaternion
|
|
},
|
|
},
|
|
'Size': {
|
|
'Size': {
|
|
type: BABYLON.Size,
|
|
type: BABYLON.Size,
|
|
- properties: ['width', 'height'],
|
|
|
|
format: function (size) { return "Size - w:" + INSPECTOR.Helpers.Trunc(size.width) + ", h:" + INSPECTOR.Helpers.Trunc(size.height); }
|
|
format: function (size) { return "Size - w:" + INSPECTOR.Helpers.Trunc(size.width) + ", h:" + INSPECTOR.Helpers.Trunc(size.height); }
|
|
},
|
|
},
|
|
'Texture': {
|
|
'Texture': {
|
|
type: BABYLON.Texture,
|
|
type: BABYLON.Texture,
|
|
- properties: [
|
|
|
|
- 'hasAlpha',
|
|
|
|
- 'level',
|
|
|
|
- 'name',
|
|
|
|
- 'wrapU',
|
|
|
|
- 'wrapV',
|
|
|
|
- 'uScale',
|
|
|
|
- 'vScale',
|
|
|
|
- 'uAng',
|
|
|
|
- 'vAng',
|
|
|
|
- 'wAng',
|
|
|
|
- 'uOffset',
|
|
|
|
- 'vOffset'
|
|
|
|
- ],
|
|
|
|
format: function (tex) { return tex.name; }
|
|
format: function (tex) { return tex.name; }
|
|
},
|
|
},
|
|
'RenderTargetTexture': {
|
|
'RenderTargetTexture': {
|
|
@@ -442,45 +422,10 @@ var INSPECTOR;
|
|
type: BABYLON.HDRCubeTexture
|
|
type: BABYLON.HDRCubeTexture
|
|
},
|
|
},
|
|
'Sound': {
|
|
'Sound': {
|
|
- type: BABYLON.Sound,
|
|
|
|
- properties: [
|
|
|
|
- 'name',
|
|
|
|
- 'autoplay',
|
|
|
|
- 'loop',
|
|
|
|
- 'useCustomAttenuation',
|
|
|
|
- 'soundTrackId',
|
|
|
|
- 'spatialSound',
|
|
|
|
- 'refDistance',
|
|
|
|
- 'rolloffFactor',
|
|
|
|
- 'maxDistance',
|
|
|
|
- 'distanceModel',
|
|
|
|
- 'isPlaying',
|
|
|
|
- 'isPaused'
|
|
|
|
- ]
|
|
|
|
|
|
+ type: BABYLON.Sound
|
|
},
|
|
},
|
|
'ArcRotateCamera': {
|
|
'ArcRotateCamera': {
|
|
type: BABYLON.ArcRotateCamera,
|
|
type: BABYLON.ArcRotateCamera,
|
|
- properties: [
|
|
|
|
- 'position',
|
|
|
|
- 'alpha',
|
|
|
|
- 'beta',
|
|
|
|
- 'radius',
|
|
|
|
- 'angularSensibilityX',
|
|
|
|
- 'angularSensibilityY',
|
|
|
|
- 'angularTouchSensibilityX',
|
|
|
|
- 'angularTouchSensibilityY',
|
|
|
|
- 'target',
|
|
|
|
- 'lowerAlphaLimit',
|
|
|
|
- 'lowerBetaLimit',
|
|
|
|
- 'upperAlphaLimit',
|
|
|
|
- 'upperBetaLimit',
|
|
|
|
- 'lowerRadiusLimit',
|
|
|
|
- 'upperRadiusLimit',
|
|
|
|
- 'pinchPrecision',
|
|
|
|
- 'wheelPrecision',
|
|
|
|
- 'allowUpsideDown',
|
|
|
|
- 'checkCollisions'
|
|
|
|
- ],
|
|
|
|
slider: {
|
|
slider: {
|
|
alpha: { min: 0, max: 2 * Math.PI, step: 0.01 },
|
|
alpha: { min: 0, max: 2 * Math.PI, step: 0.01 },
|
|
beta: { min: -Math.PI, max: Math.PI, step: 0.01 },
|
|
beta: { min: -Math.PI, max: Math.PI, step: 0.01 },
|
|
@@ -489,97 +434,15 @@ var INSPECTOR;
|
|
},
|
|
},
|
|
'FreeCamera': {
|
|
'FreeCamera': {
|
|
type: BABYLON.FreeCamera,
|
|
type: BABYLON.FreeCamera,
|
|
- properties: [
|
|
|
|
- 'position',
|
|
|
|
- 'rotation',
|
|
|
|
- 'rotationQuaternion',
|
|
|
|
- 'cameraDirection',
|
|
|
|
- 'cameraRotation',
|
|
|
|
- 'ellipsoid',
|
|
|
|
- 'applyGravity',
|
|
|
|
- 'angularSensibility',
|
|
|
|
- 'keysUp',
|
|
|
|
- 'keysDown',
|
|
|
|
- 'keysLeft',
|
|
|
|
- 'keysRight',
|
|
|
|
- 'checkCollisions',
|
|
|
|
- 'speed',
|
|
|
|
- 'lockedTarget',
|
|
|
|
- 'noRotationConstraint',
|
|
|
|
- 'fov',
|
|
|
|
- 'inertia',
|
|
|
|
- 'minZ', 'maxZ',
|
|
|
|
- 'layerMask',
|
|
|
|
- 'mode',
|
|
|
|
- 'orthoBottom',
|
|
|
|
- 'orthoTop',
|
|
|
|
- 'orthoLeft',
|
|
|
|
- 'orthoRight'
|
|
|
|
- ],
|
|
|
|
slider: {
|
|
slider: {
|
|
fov: { min: 0, max: 180, step: 1 }
|
|
fov: { min: 0, max: 180, step: 1 }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
'Scene': {
|
|
'Scene': {
|
|
type: BABYLON.Scene,
|
|
type: BABYLON.Scene,
|
|
- properties: [
|
|
|
|
- 'actionManager',
|
|
|
|
- 'activeCamera',
|
|
|
|
- 'ambientColor',
|
|
|
|
- 'clearColor',
|
|
|
|
- 'forceWireframe',
|
|
|
|
- 'forcePointsCloud',
|
|
|
|
- 'forceShowBoundingBoxes',
|
|
|
|
- 'useRightHandedSystem',
|
|
|
|
- 'hoverCursor',
|
|
|
|
- 'cameraToUseForPointers',
|
|
|
|
- 'fogEnabled',
|
|
|
|
- 'fogColor',
|
|
|
|
- 'fogDensity',
|
|
|
|
- 'fogStart',
|
|
|
|
- 'fogEnd',
|
|
|
|
- 'shadowsEnabled',
|
|
|
|
- 'lightsEnabled',
|
|
|
|
- 'collisionsEnabled',
|
|
|
|
- 'gravity',
|
|
|
|
- 'meshUnderPointer',
|
|
|
|
- 'pointerX',
|
|
|
|
- 'pointerY',
|
|
|
|
- 'uid'
|
|
|
|
- ]
|
|
|
|
},
|
|
},
|
|
'Mesh': {
|
|
'Mesh': {
|
|
type: BABYLON.Mesh,
|
|
type: BABYLON.Mesh,
|
|
- properties: [
|
|
|
|
- 'name',
|
|
|
|
- 'position',
|
|
|
|
- 'rotation',
|
|
|
|
- 'rotationQuaternion',
|
|
|
|
- 'absolutePosition',
|
|
|
|
- 'material',
|
|
|
|
- 'actionManager',
|
|
|
|
- 'visibility',
|
|
|
|
- 'isVisible',
|
|
|
|
- 'isPickable',
|
|
|
|
- 'renderingGroupId',
|
|
|
|
- 'receiveShadows',
|
|
|
|
- 'renderOutline',
|
|
|
|
- 'outlineColor',
|
|
|
|
- 'outlineWidth',
|
|
|
|
- 'renderOverlay',
|
|
|
|
- 'overlayColor',
|
|
|
|
- 'overlayAlpha',
|
|
|
|
- 'hasVertexAlpha',
|
|
|
|
- 'useVertexColors',
|
|
|
|
- 'layerMask',
|
|
|
|
- 'alwaysSelectAsActiveMesh',
|
|
|
|
- 'ellipsoid',
|
|
|
|
- 'ellipsoidOffset',
|
|
|
|
- 'edgesWidth',
|
|
|
|
- 'edgesColor',
|
|
|
|
- 'checkCollisions',
|
|
|
|
- 'hasLODLevels'
|
|
|
|
- ],
|
|
|
|
format: function (m) { return m.name; },
|
|
format: function (m) { return m.name; },
|
|
slider: {
|
|
slider: {
|
|
visibility: { min: 0, max: 1, step: 0.1 }
|
|
visibility: { min: 0, max: 1, step: 0.1 }
|
|
@@ -587,36 +450,6 @@ var INSPECTOR;
|
|
},
|
|
},
|
|
'StandardMaterial': {
|
|
'StandardMaterial': {
|
|
type: BABYLON.StandardMaterial,
|
|
type: BABYLON.StandardMaterial,
|
|
- properties: [
|
|
|
|
- 'name',
|
|
|
|
- 'alpha',
|
|
|
|
- 'alphaMode',
|
|
|
|
- 'wireframe',
|
|
|
|
- 'isFrozen',
|
|
|
|
- 'zOffset',
|
|
|
|
- 'ambientColor',
|
|
|
|
- 'emissiveColor',
|
|
|
|
- 'diffuseColor',
|
|
|
|
- 'specularColor',
|
|
|
|
- 'specularPower',
|
|
|
|
- 'useAlphaFromDiffuseTexture',
|
|
|
|
- 'linkEmissiveWithDiffuse',
|
|
|
|
- 'useSpecularOverAlpha',
|
|
|
|
- 'diffuseFresnelParameters',
|
|
|
|
- 'opacityFresnelParameters',
|
|
|
|
- 'reflectionFresnelParameters',
|
|
|
|
- 'refractionFresnelParameters',
|
|
|
|
- 'emissiveFresnelParameters',
|
|
|
|
- 'diffuseTexture',
|
|
|
|
- 'emissiveTexture',
|
|
|
|
- 'specularTexture',
|
|
|
|
- 'ambientTexture',
|
|
|
|
- 'bumpTexture',
|
|
|
|
- 'lightMapTexture',
|
|
|
|
- 'opacityTexture',
|
|
|
|
- 'reflectionTexture',
|
|
|
|
- 'refractionTexture'
|
|
|
|
- ],
|
|
|
|
format: function (mat) { return mat.name; },
|
|
format: function (mat) { return mat.name; },
|
|
slider: {
|
|
slider: {
|
|
alpha: { min: 0, max: 1, step: 0.01 }
|
|
alpha: { min: 0, max: 1, step: 0.01 }
|
|
@@ -624,52 +457,12 @@ var INSPECTOR;
|
|
},
|
|
},
|
|
'PBRMaterial': {
|
|
'PBRMaterial': {
|
|
type: BABYLON.PBRMaterial,
|
|
type: BABYLON.PBRMaterial,
|
|
- properties: [
|
|
|
|
- 'name',
|
|
|
|
- 'albedoColor',
|
|
|
|
- 'albedoTexture',
|
|
|
|
- 'opacityTexture',
|
|
|
|
- 'reflectionTexture',
|
|
|
|
- 'emissiveTexture',
|
|
|
|
- 'bumpTexture',
|
|
|
|
- 'lightmapTexture',
|
|
|
|
- 'opacityFresnelParameters',
|
|
|
|
- 'emissiveFresnelParameters',
|
|
|
|
- 'linkEmissiveWithAlbedo',
|
|
|
|
- 'useLightmapAsShadowmap',
|
|
|
|
- 'useAlphaFromAlbedoTexture',
|
|
|
|
- 'useSpecularOverAlpha',
|
|
|
|
- 'useAutoMicroSurfaceFromReflectivityMap',
|
|
|
|
- 'useLogarithmicDepth',
|
|
|
|
- 'reflectivityColor',
|
|
|
|
- 'reflectivityTexture',
|
|
|
|
- 'reflectionTexture',
|
|
|
|
- 'reflectionColor',
|
|
|
|
- 'alpha',
|
|
|
|
- 'linkRefractionWithTransparency',
|
|
|
|
- 'indexOfRefraction',
|
|
|
|
- 'microSurface',
|
|
|
|
- 'useMicroSurfaceFromReflectivityMapAlpha',
|
|
|
|
- 'directIntensity',
|
|
|
|
- 'emissiveIntensity',
|
|
|
|
- 'specularIntensity',
|
|
|
|
- 'environmentIntensity',
|
|
|
|
- 'cameraExposure',
|
|
|
|
- 'cameraContrast',
|
|
|
|
- 'cameraColorGradingTexture',
|
|
|
|
- 'cameraColorCurves'
|
|
|
|
- ],
|
|
|
|
slider: {
|
|
slider: {
|
|
alpha: { min: 0, max: 1, step: 0.01 }
|
|
alpha: { min: 0, max: 1, step: 0.01 }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
'PhysicsImpostor': {
|
|
'PhysicsImpostor': {
|
|
- type: BABYLON.PhysicsImpostor,
|
|
|
|
- properties: [
|
|
|
|
- 'friction',
|
|
|
|
- 'mass',
|
|
|
|
- 'restitution',
|
|
|
|
- ]
|
|
|
|
|
|
+ type: BABYLON.PhysicsImpostor
|
|
},
|
|
},
|
|
};
|
|
};
|
|
})(INSPECTOR || (INSPECTOR = {}));
|
|
})(INSPECTOR || (INSPECTOR = {}));
|
|
@@ -833,14 +626,6 @@ var INSPECTOR;
|
|
function Adapter(obj) {
|
|
function Adapter(obj) {
|
|
this._obj = obj;
|
|
this._obj = obj;
|
|
}
|
|
}
|
|
- Object.defineProperty(Adapter.prototype, "actualObject", {
|
|
|
|
- /** Returns the actual object behind this adapter */
|
|
|
|
- get: function () {
|
|
|
|
- return this._obj;
|
|
|
|
- },
|
|
|
|
- enumerable: true,
|
|
|
|
- configurable: true
|
|
|
|
- });
|
|
|
|
/** Returns true if the given object correspond to this */
|
|
/** Returns true if the given object correspond to this */
|
|
Adapter.prototype.correspondsTo = function (obj) {
|
|
Adapter.prototype.correspondsTo = function (obj) {
|
|
return obj === this._obj;
|
|
return obj === this._obj;
|
|
@@ -1267,8 +1052,10 @@ var INSPECTOR;
|
|
var tools = [];
|
|
var tools = [];
|
|
tools.push(new INSPECTOR.Checkbox(this));
|
|
tools.push(new INSPECTOR.Checkbox(this));
|
|
tools.push(new INSPECTOR.DebugArea(this));
|
|
tools.push(new INSPECTOR.DebugArea(this));
|
|
- if (this._obj.getTotalVertices() > 0) {
|
|
|
|
- tools.push(new INSPECTOR.BoundingBox(this));
|
|
|
|
|
|
+ if (this._obj instanceof BABYLON.AbstractMesh) {
|
|
|
|
+ if (this._obj.getTotalVertices() > 0) {
|
|
|
|
+ tools.push(new INSPECTOR.BoundingBox(this));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
tools.push(new INSPECTOR.Info(this));
|
|
tools.push(new INSPECTOR.Info(this));
|
|
return tools;
|
|
return tools;
|
|
@@ -1301,7 +1088,10 @@ var INSPECTOR;
|
|
};
|
|
};
|
|
/** Returns some information about this mesh */
|
|
/** Returns some information about this mesh */
|
|
MeshAdapter.prototype.getInfo = function () {
|
|
MeshAdapter.prototype.getInfo = function () {
|
|
- return this._obj.getTotalVertices() + " vertices";
|
|
|
|
|
|
+ if (this._obj instanceof BABYLON.AbstractMesh) {
|
|
|
|
+ return this._obj.getTotalVertices() + " vertices";
|
|
|
|
+ }
|
|
|
|
+ return '0 vertices';
|
|
};
|
|
};
|
|
/** Draw X, Y and Z axis for the actual object if this adapter.
|
|
/** Draw X, Y and Z axis for the actual object if this adapter.
|
|
* Should be called only one time as it will fill this._axis
|
|
* Should be called only one time as it will fill this._axis
|
|
@@ -1309,15 +1099,18 @@ var INSPECTOR;
|
|
MeshAdapter.prototype._drawAxis = function () {
|
|
MeshAdapter.prototype._drawAxis = function () {
|
|
var _this = this;
|
|
var _this = this;
|
|
this._obj.computeWorldMatrix();
|
|
this._obj.computeWorldMatrix();
|
|
- var mesh = this._obj;
|
|
|
|
// Axis
|
|
// Axis
|
|
var x = new BABYLON.Vector3(1, 0, 0);
|
|
var x = new BABYLON.Vector3(1, 0, 0);
|
|
var y = new BABYLON.Vector3(0, 1, 0);
|
|
var y = new BABYLON.Vector3(0, 1, 0);
|
|
var z = new BABYLON.Vector3(0, 0, 1);
|
|
var z = new BABYLON.Vector3(0, 0, 1);
|
|
this._axesViewer = new BABYLON.Debug.AxesViewer(this._obj.getScene());
|
|
this._axesViewer = new BABYLON.Debug.AxesViewer(this._obj.getScene());
|
|
|
|
+ var mesh = this._obj;
|
|
this.onBeforeRenderObserver = mesh.getScene().onBeforeRenderObservable.add(function () {
|
|
this.onBeforeRenderObserver = mesh.getScene().onBeforeRenderObservable.add(function () {
|
|
var matrix = mesh.getWorldMatrix();
|
|
var matrix = mesh.getWorldMatrix();
|
|
- var extend = mesh.getBoundingInfo().boundingBox.extendSizeWorld;
|
|
|
|
|
|
+ var extend = new BABYLON.Vector3(1, 1, 1);
|
|
|
|
+ if (mesh instanceof BABYLON.AbstractMesh) {
|
|
|
|
+ extend = mesh.getBoundingInfo().boundingBox.extendSizeWorld;
|
|
|
|
+ }
|
|
_this._axesViewer.scaleLines = Math.max(extend.x, extend.y, extend.z) * 2;
|
|
_this._axesViewer.scaleLines = Math.max(extend.x, extend.y, extend.z) * 2;
|
|
_this._axesViewer.update(_this._obj.position, BABYLON.Vector3.TransformNormal(x, matrix), BABYLON.Vector3.TransformNormal(y, matrix), BABYLON.Vector3.TransformNormal(z, matrix));
|
|
_this._axesViewer.update(_this._obj.position, BABYLON.Vector3.TransformNormal(x, matrix), BABYLON.Vector3.TransformNormal(y, matrix), BABYLON.Vector3.TransformNormal(z, matrix));
|
|
});
|
|
});
|
|
@@ -1893,7 +1686,9 @@ var INSPECTOR;
|
|
this._div.classList.toggle('unfolded');
|
|
this._div.classList.toggle('unfolded');
|
|
if (this._children.length == 0) {
|
|
if (this._children.length == 0) {
|
|
var objToDetail = this.value;
|
|
var objToDetail = this.value;
|
|
- var propToDisplay = INSPECTOR.PROPERTIES[INSPECTOR.Helpers.GET_TYPE(objToDetail)].properties.slice().reverse();
|
|
|
|
|
|
+ // Display all properties that are not functions
|
|
|
|
+ var propToDisplay = INSPECTOR.Helpers.GetAllLinesPropertiesAsString(objToDetail);
|
|
|
|
+ propToDisplay.sort().reverse();
|
|
for (var _b = 0, propToDisplay_1 = propToDisplay; _b < propToDisplay_1.length; _b++) {
|
|
for (var _b = 0, propToDisplay_1 = propToDisplay; _b < propToDisplay_1.length; _b++) {
|
|
var prop = propToDisplay_1[_b];
|
|
var prop = propToDisplay_1[_b];
|
|
var infos = new INSPECTOR.Property(prop, this._property.value);
|
|
var infos = new INSPECTOR.Property(prop, this._property.value);
|
|
@@ -2484,6 +2279,9 @@ var INSPECTOR;
|
|
};
|
|
};
|
|
/** Returns the given number with 2 decimal number max if a decimal part exists */
|
|
/** Returns the given number with 2 decimal number max if a decimal part exists */
|
|
Helpers.Trunc = function (nb) {
|
|
Helpers.Trunc = function (nb) {
|
|
|
|
+ if (typeof nb !== 'number') {
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
if (Math.round(nb) !== nb) {
|
|
if (Math.round(nb) !== nb) {
|
|
return nb.toFixed(2);
|
|
return nb.toFixed(2);
|
|
}
|
|
}
|
|
@@ -2568,16 +2366,27 @@ var INSPECTOR;
|
|
*/
|
|
*/
|
|
Helpers.GetAllLinesProperties = function (obj) {
|
|
Helpers.GetAllLinesProperties = function (obj) {
|
|
var propertiesLines = [];
|
|
var propertiesLines = [];
|
|
|
|
+ var props = Helpers.GetAllLinesPropertiesAsString(obj);
|
|
|
|
+ for (var _i = 0, props_1 = props; _i < props_1.length; _i++) {
|
|
|
|
+ var prop = props_1[_i];
|
|
|
|
+ var infos = new INSPECTOR.Property(prop, obj);
|
|
|
|
+ propertiesLines.push(new INSPECTOR.PropertyLine(infos));
|
|
|
|
+ }
|
|
|
|
+ return propertiesLines;
|
|
|
|
+ };
|
|
|
|
+ /**
|
|
|
|
+ * Returns an array of string corresponding to tjhe list of properties of the object to be displayed
|
|
|
|
+ * @param obj
|
|
|
|
+ */
|
|
|
|
+ Helpers.GetAllLinesPropertiesAsString = function (obj) {
|
|
|
|
+ var props = [];
|
|
for (var prop in obj) {
|
|
for (var prop in obj) {
|
|
- /**
|
|
|
|
- * No private and no function
|
|
|
|
- */
|
|
|
|
|
|
+ //No private and no function
|
|
if (prop.substring(0, 1) !== '_' && typeof obj[prop] !== 'function') {
|
|
if (prop.substring(0, 1) !== '_' && typeof obj[prop] !== 'function') {
|
|
- var infos = new INSPECTOR.Property(prop, obj);
|
|
|
|
- propertiesLines.push(new INSPECTOR.PropertyLine(infos));
|
|
|
|
|
|
+ props.push(prop);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return propertiesLines;
|
|
|
|
|
|
+ return props;
|
|
};
|
|
};
|
|
Helpers.Capitalize = function (str) {
|
|
Helpers.Capitalize = function (str) {
|
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
@@ -3291,7 +3100,7 @@ var INSPECTOR;
|
|
if (descendants.length > 0) {
|
|
if (descendants.length > 0) {
|
|
for (var _i = 0, descendants_1 = descendants; _i < descendants_1.length; _i++) {
|
|
for (var _i = 0, descendants_1 = descendants; _i < descendants_1.length; _i++) {
|
|
var child = descendants_1[_i];
|
|
var child = descendants_1[_i];
|
|
- if (child instanceof BABYLON.AbstractMesh) {
|
|
|
|
|
|
+ if (child instanceof BABYLON.TransformNode) {
|
|
if (!INSPECTOR.Helpers.IsSystemName(child.name)) {
|
|
if (!INSPECTOR.Helpers.IsSystemName(child.name)) {
|
|
var n = createNode(child);
|
|
var n = createNode(child);
|
|
node.add(n);
|
|
node.add(n);
|
|
@@ -3319,8 +3128,25 @@ var INSPECTOR;
|
|
};
|
|
};
|
|
// get all meshes from the first scene
|
|
// get all meshes from the first scene
|
|
var instances = this._inspector.scene;
|
|
var instances = this._inspector.scene;
|
|
|
|
+ // Find top of hierarchy for meshes...
|
|
|
|
+ var meshWithoutAnyParent = [];
|
|
for (var _i = 0, _a = instances.meshes; _i < _a.length; _i++) {
|
|
for (var _i = 0, _a = instances.meshes; _i < _a.length; _i++) {
|
|
var mesh = _a[_i];
|
|
var mesh = _a[_i];
|
|
|
|
+ // Not already in the array, not system name and no parent
|
|
|
|
+ if (meshWithoutAnyParent.indexOf(mesh) == -1 && !INSPECTOR.Helpers.IsSystemName(mesh.name) && !mesh.parent) {
|
|
|
|
+ meshWithoutAnyParent.push(mesh);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // ... and for transforms
|
|
|
|
+ for (var _b = 0, _c = instances.transformNodes; _b < _c.length; _b++) {
|
|
|
|
+ var tn = _c[_b];
|
|
|
|
+ // Not already in the array, not system name and no parent
|
|
|
|
+ if (meshWithoutAnyParent.indexOf(tn) == -1 && !INSPECTOR.Helpers.IsSystemName(tn.name) && !tn.parent) {
|
|
|
|
+ meshWithoutAnyParent.push(tn);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ for (var _d = 0, meshWithoutAnyParent_1 = meshWithoutAnyParent; _d < meshWithoutAnyParent_1.length; _d++) {
|
|
|
|
+ var mesh = meshWithoutAnyParent_1[_d];
|
|
if (alreadyIn.indexOf(mesh) == -1 && !INSPECTOR.Helpers.IsSystemName(mesh.name)) {
|
|
if (alreadyIn.indexOf(mesh) == -1 && !INSPECTOR.Helpers.IsSystemName(mesh.name)) {
|
|
var node = createNode(mesh);
|
|
var node = createNode(mesh);
|
|
arr.push(node);
|
|
arr.push(node);
|
|
@@ -3359,9 +3185,10 @@ var INSPECTOR;
|
|
_this._panel.appendChild(_this._detailsPanel.toHtml());
|
|
_this._panel.appendChild(_this._detailsPanel.toHtml());
|
|
// build propertiesline
|
|
// build propertiesline
|
|
var details = [];
|
|
var details = [];
|
|
- for (var _i = 0, _a = INSPECTOR.PROPERTIES['Scene'].properties; _i < _a.length; _i++) {
|
|
|
|
- var prop = _a[_i];
|
|
|
|
- details.push(new INSPECTOR.PropertyLine(new INSPECTOR.Property(prop, _this._inspector.scene)));
|
|
|
|
|
|
+ var props = INSPECTOR.Helpers.GetAllLinesProperties(_this._inspector.scene);
|
|
|
|
+ for (var _i = 0, props_1 = props; _i < props_1.length; _i++) {
|
|
|
|
+ var prop = props_1[_i];
|
|
|
|
+ details.push(prop);
|
|
}
|
|
}
|
|
_this._detailsPanel.details = details;
|
|
_this._detailsPanel.details = details;
|
|
Split([_this._actions, _this._detailsPanel.toHtml()], {
|
|
Split([_this._actions, _this._detailsPanel.toHtml()], {
|
|
@@ -4702,6 +4529,13 @@ var INSPECTOR;
|
|
/** Build the HTML of this item */
|
|
/** Build the HTML of this item */
|
|
TreeItem.prototype._build = function () {
|
|
TreeItem.prototype._build = function () {
|
|
this._div.className = 'line';
|
|
this._div.className = 'line';
|
|
|
|
+ // special class for transform node ONLY
|
|
|
|
+ if (this.adapter instanceof INSPECTOR.MeshAdapter) {
|
|
|
|
+ var obj = this.adapter.object;
|
|
|
|
+ if (obj instanceof BABYLON.TransformNode && !(obj instanceof BABYLON.AbstractMesh)) {
|
|
|
|
+ this._div.className += ' transformNode';
|
|
|
|
+ }
|
|
|
|
+ }
|
|
for (var _i = 0, _a = this._tools; _i < _a.length; _i++) {
|
|
for (var _i = 0, _a = this._tools; _i < _a.length; _i++) {
|
|
var tool = _a[_i];
|
|
var tool = _a[_i];
|
|
this._div.appendChild(tool.toHtml());
|
|
this._div.appendChild(tool.toHtml());
|