123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256 |
- module INSPECTOR {
-
- export const PROPERTIES = {
- /** Format the given object :
- * If a format function exists, returns the result of this function.
- * If this function doesn't exists, return the object type instead */
- format : (obj:any) => {
- let type = Helpers.GET_TYPE(obj) || 'type_not_defined';
- if (PROPERTIES[type] && PROPERTIES[type].format) {
- return PROPERTIES[type].format(obj);
- } else {
- return Helpers.GET_TYPE(obj);
- }
- },
- 'type_not_defined' : {
- properties : [],
- format: () => ''
- },
-
- 'Vector2' : {
- type: BABYLON.Vector2,
- properties: ['x', 'y'],
- format: (vec : BABYLON.Vector2) => {return `x:${Helpers.Trunc(vec.x)}, y:${Helpers.Trunc(vec.y)}`;}
- },
- 'Vector3' : {
- type: BABYLON.Vector3,
- properties: ['x', 'y', 'z'],
- format: (vec : BABYLON.Vector3) => {return `x:${Helpers.Trunc(vec.x)}, y:${Helpers.Trunc(vec.y)}, z:${Helpers.Trunc(vec.z)}`}
- },
- 'Color3' : {
- type: BABYLON.Color3,
- properties : ['r', 'g', 'b'],
- format: (color: BABYLON.Color3) => { return `R:${color.r}, G:${color.g}, B:${color.b}`}
- },
- 'Quaternion' : {
- type: BABYLON.Quaternion,
- properties : ['x', 'y', 'z', 'w']
- },
- 'Size' : {
- type: BABYLON.Size,
- properties :['width', 'height'],
- format: (size:BABYLON.Size) => { return `Size - w:${Helpers.Trunc(size.width)}, h:${Helpers.Trunc(size.height)}`}
- },
- 'Texture' : {
- type: BABYLON.Texture,
- properties :[
- 'hasAlpha',
- 'level',
- 'name',
- 'wrapU',
- 'wrapV',
- 'uScale',
- 'vScale',
- 'uAng',
- 'vAng',
- 'wAng',
- 'uOffset',
- 'vOffset'
- ],
- format: (tex:BABYLON.Texture) => { return tex.name}
- },
-
- 'ArcRotateCamera' : {
- type: BABYLON.ArcRotateCamera,
- properties : [
- 'alpha',
- 'beta',
- 'radius',
- 'angularSensibilityX',
- 'angularSensibilityY',
- 'target',
- 'lowerAlphaLimit',
- 'lowerBetaLimit',
- 'upperAlphaLimit',
- 'upperBetaLimit',
- 'lowerRadiusLimit',
- 'upperRadiusLimit',
- 'pinchPrecision',
- 'wheelPrecision',
- 'allowUpsideDown',
- 'checkCollisions'
- ]
- },
-
- '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': {
- 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 : (m:BABYLON.Mesh) : string => {return m.name;}
- },
- '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 : (mat:BABYLON.StandardMaterial) : string => {return mat.name;}
- },
- 'PrimitiveAlignment':{
- type: BABYLON.PrimitiveAlignment,
- properties:['horizontal', 'vertical']
- },
- 'PrimitiveThickness':{
- type: BABYLON.PrimitiveThickness,
- properties:['topPixels', 'leftPixels', 'rightPixels', 'bottomPixels']
- },
- 'BoundingInfo2D':{
- type: BABYLON.BoundingInfo2D,
- properties:['radius','center', 'extent']
- },
- 'SolidColorBrush2D':{
- type: BABYLON.SolidColorBrush2D,
- properties:['color']
- },
- 'GradientColorBrush2D':{
- type: BABYLON.GradientColorBrush2D,
- properties:['color1', 'color2', 'translation', 'rotation', 'scale']
- },
- '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'
- ]
- }
-
- }
-
- }
|