properties.ts 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  1. module INSPECTOR {
  2. export var PROPERTIES = {
  3. /** Format the given object :
  4. * If a format function exists, returns the result of this function.
  5. * If this function doesn't exists, return the object type instead */
  6. format: (obj: any) => {
  7. let type = Helpers.GET_TYPE(obj) || 'type_not_defined';
  8. if (PROPERTIES[type] && PROPERTIES[type].format) {
  9. return PROPERTIES[type].format(obj);
  10. } else {
  11. return Helpers.GET_TYPE(obj);
  12. }
  13. },
  14. 'type_not_defined': {
  15. properties: [],
  16. format: () => ''
  17. },
  18. 'Vector2': {
  19. type: BABYLON.Vector2,
  20. properties: ['x', 'y'],
  21. format: (vec: BABYLON.Vector2) => { return `x:${Helpers.Trunc(vec.x)}, y:${Helpers.Trunc(vec.y)}`; }
  22. },
  23. 'Vector3': {
  24. type: BABYLON.Vector3,
  25. properties: ['x', 'y', 'z'],
  26. format: (vec: BABYLON.Vector3) => { return `x:${Helpers.Trunc(vec.x)}, y:${Helpers.Trunc(vec.y)}, z:${Helpers.Trunc(vec.z)}` }
  27. },
  28. 'Color3': {
  29. type: BABYLON.Color3,
  30. properties: ['r', 'g', 'b'],
  31. format: (color: BABYLON.Color3) => { return `R:${color.r}, G:${color.g}, B:${color.b}` }
  32. },
  33. 'Quaternion': {
  34. type: BABYLON.Quaternion,
  35. properties: ['x', 'y', 'z', 'w']
  36. },
  37. 'Size': {
  38. type: BABYLON.Size,
  39. properties: ['width', 'height'],
  40. format: (size: BABYLON.Size) => { return `Size - w:${Helpers.Trunc(size.width)}, h:${Helpers.Trunc(size.height)}` }
  41. },
  42. 'Texture': {
  43. type: BABYLON.Texture,
  44. properties: [
  45. 'hasAlpha',
  46. 'level',
  47. 'name',
  48. 'wrapU',
  49. 'wrapV',
  50. 'uScale',
  51. 'vScale',
  52. 'uAng',
  53. 'vAng',
  54. 'wAng',
  55. 'uOffset',
  56. 'vOffset'
  57. ],
  58. format: (tex: BABYLON.Texture) => { return tex.name }
  59. },
  60. 'MapTexture': {
  61. type: BABYLON.MapTexture
  62. },
  63. 'RenderTargetTexture': {
  64. type: BABYLON.RenderTargetTexture
  65. },
  66. 'DynamicTexture': {
  67. type: BABYLON.DynamicTexture
  68. },
  69. 'BaseTexture': {
  70. type: BABYLON.BaseTexture
  71. },
  72. 'CubeTexture': {
  73. type: BABYLON.CubeTexture
  74. },
  75. 'HDRCubeTexture': {
  76. type: BABYLON.HDRCubeTexture
  77. },
  78. 'FontTexture': {
  79. type: BABYLON.FontTexture
  80. },
  81. 'Sound': {
  82. type: BABYLON.Sound,
  83. properties: [
  84. 'name',
  85. 'autoplay',
  86. 'loop',
  87. 'useCustomAttenuation',
  88. 'soundTrackId',
  89. 'spatialSound',
  90. 'refDistance',
  91. 'rolloffFactor',
  92. 'maxDistance',
  93. 'distanceModel',
  94. 'isPlaying',
  95. 'isPaused'
  96. ]
  97. },
  98. 'ArcRotateCamera': {
  99. type: BABYLON.ArcRotateCamera,
  100. properties: [
  101. 'position',
  102. 'alpha',
  103. 'beta',
  104. 'radius',
  105. 'angularSensibilityX',
  106. 'angularSensibilityY',
  107. 'target',
  108. 'lowerAlphaLimit',
  109. 'lowerBetaLimit',
  110. 'upperAlphaLimit',
  111. 'upperBetaLimit',
  112. 'lowerRadiusLimit',
  113. 'upperRadiusLimit',
  114. 'pinchPrecision',
  115. 'wheelPrecision',
  116. 'allowUpsideDown',
  117. 'checkCollisions'
  118. ]
  119. },
  120. 'FreeCamera': {
  121. type: BABYLON.FreeCamera,
  122. properties: [
  123. 'position',
  124. 'rotation',
  125. 'rotationQuaternion',
  126. 'cameraDirection',
  127. 'cameraRotation',
  128. 'ellipsoid',
  129. 'applyGravity',
  130. 'angularSensibility',
  131. 'keysUp',
  132. 'keysDown',
  133. 'keysLeft',
  134. 'keysRight',
  135. 'checkCollisions',
  136. 'speed',
  137. 'lockedTarget',
  138. 'noRotationConstraint',
  139. 'fov',
  140. 'inertia',
  141. 'minZ', 'maxZ',
  142. 'layerMask',
  143. 'mode',
  144. 'orthoBottom',
  145. 'orthoTop',
  146. 'orthoLeft',
  147. 'orthoRight'
  148. ]
  149. },
  150. 'Scene': {
  151. type: BABYLON.Scene,
  152. properties: [
  153. 'actionManager',
  154. 'activeCamera',
  155. 'ambientColor',
  156. 'clearColor',
  157. 'forceWireframe',
  158. 'forcePointsCloud',
  159. 'forceShowBoundingBoxes',
  160. 'useRightHandedSystem',
  161. 'hoverCursor',
  162. 'cameraToUseForPointers',
  163. 'fogEnabled',
  164. 'fogColor',
  165. 'fogDensity',
  166. 'fogStart',
  167. 'fogEnd',
  168. 'shadowsEnabled',
  169. 'lightsEnabled',
  170. 'collisionsEnabled',
  171. 'gravity',
  172. 'meshUnderPointer',
  173. 'pointerX',
  174. 'pointerY',
  175. 'uid'
  176. ]
  177. },
  178. 'Mesh': {
  179. type: BABYLON.Mesh,
  180. properties: [
  181. 'name',
  182. 'position',
  183. 'rotation',
  184. 'rotationQuaternion',
  185. 'absolutePosition',
  186. 'material',
  187. 'actionManager',
  188. 'visibility',
  189. 'isVisible',
  190. 'isPickable',
  191. 'renderingGroupId',
  192. 'receiveShadows',
  193. 'renderOutline',
  194. 'outlineColor',
  195. 'outlineWidth',
  196. 'renderOverlay',
  197. 'overlayColor',
  198. 'overlayAlpha',
  199. 'hasVertexAlpha',
  200. 'useVertexColors',
  201. 'layerMask',
  202. 'alwaysSelectAsActiveMesh',
  203. 'ellipsoid',
  204. 'ellipsoidOffset',
  205. 'edgesWidth',
  206. 'edgesColor',
  207. 'checkCollisions',
  208. 'hasLODLevels'
  209. ],
  210. format: (m: BABYLON.Mesh): string => { return m.name; }
  211. },
  212. 'StandardMaterial': {
  213. type: BABYLON.StandardMaterial,
  214. properties: [
  215. 'name',
  216. 'alpha',
  217. 'alphaMode',
  218. 'wireframe',
  219. 'isFrozen',
  220. 'zOffset',
  221. 'ambientColor',
  222. 'emissiveColor',
  223. 'diffuseColor',
  224. 'specularColor',
  225. 'specularPower',
  226. 'useAlphaFromDiffuseTexture',
  227. 'linkEmissiveWithDiffuse',
  228. 'useSpecularOverAlpha',
  229. 'diffuseFresnelParameters',
  230. 'opacityFresnelParameters',
  231. 'reflectionFresnelParameters',
  232. 'refractionFresnelParameters',
  233. 'emissiveFresnelParameters',
  234. 'diffuseTexture',
  235. 'emissiveTexture',
  236. 'specularTexture',
  237. 'ambientTexture',
  238. 'bumpTexture',
  239. 'lightMapTexture',
  240. 'opacityTexture',
  241. 'reflectionTexture',
  242. 'refractionTexture'
  243. ],
  244. format: (mat: BABYLON.StandardMaterial): string => { return mat.name; }
  245. },
  246. 'PrimitiveAlignment': {
  247. type: BABYLON.PrimitiveAlignment,
  248. properties: ['horizontal', 'vertical']
  249. },
  250. 'PrimitiveThickness': {
  251. type: BABYLON.PrimitiveThickness,
  252. properties: ['topPixels', 'leftPixels', 'rightPixels', 'bottomPixels']
  253. },
  254. 'BoundingInfo2D': {
  255. type: BABYLON.BoundingInfo2D,
  256. properties: ['radius', 'center', 'extent']
  257. },
  258. 'SolidColorBrush2D': {
  259. type: BABYLON.SolidColorBrush2D,
  260. properties: ['color']
  261. },
  262. 'GradientColorBrush2D': {
  263. type: BABYLON.GradientColorBrush2D,
  264. properties: ['color1', 'color2', 'translation', 'rotation', 'scale']
  265. },
  266. 'PBRMaterial': {
  267. type: BABYLON.PBRMaterial,
  268. properties: [
  269. 'name',
  270. 'albedoColor',
  271. 'albedoTexture',
  272. 'opacityTexture',
  273. 'reflectionTexture',
  274. 'emissiveTexture',
  275. 'bumpTexture',
  276. 'lightmapTexture',
  277. 'opacityFresnelParameters',
  278. 'emissiveFresnelParameters',
  279. 'linkEmissiveWithAlbedo',
  280. 'useLightmapAsShadowmap',
  281. 'useAlphaFromAlbedoTexture',
  282. 'useSpecularOverAlpha',
  283. 'useAutoMicroSurfaceFromReflectivityMap',
  284. 'useLogarithmicDepth',
  285. 'reflectivityColor',
  286. 'reflectivityTexture',
  287. 'reflectionTexture',
  288. 'reflectionColor',
  289. 'alpha',
  290. 'linkRefractionWithTransparency',
  291. 'indexOfRefraction',
  292. 'microSurface',
  293. 'useMicroSurfaceFromReflectivityMapAlpha',
  294. 'directIntensity',
  295. 'emissiveIntensity',
  296. 'specularIntensity',
  297. 'environmentIntensity',
  298. 'cameraExposure',
  299. 'cameraContrast',
  300. 'cameraColorGradingTexture',
  301. 'cameraColorCurves'
  302. ]
  303. },
  304. 'Canvas2D': {
  305. type: BABYLON.Canvas2D
  306. },
  307. 'Canvas2DEngineBoundData': {
  308. type: BABYLON.Canvas2DEngineBoundData
  309. },
  310. 'Ellipse2D': {
  311. type: BABYLON.Ellipse2D
  312. },
  313. 'Ellipse2DInstanceData': {
  314. type: BABYLON.Ellipse2DInstanceData
  315. },
  316. 'Ellipse2DRenderCache': {
  317. type: BABYLON.Ellipse2DRenderCache
  318. },
  319. 'Group2D': {
  320. type: BABYLON.Group2D
  321. },
  322. 'IntersectInfo2D': {
  323. type: BABYLON.IntersectInfo2D
  324. },
  325. 'Lines2D': {
  326. type: BABYLON.Lines2D
  327. },
  328. 'Lines2DInstanceData': {
  329. type: BABYLON.Lines2DInstanceData
  330. },
  331. 'Lines2DRenderCache': {
  332. type: BABYLON.Lines2DRenderCache
  333. },
  334. 'PrepareRender2DContext': {
  335. type: BABYLON.PrepareRender2DContext
  336. },
  337. 'Prim2DBase': {
  338. type: BABYLON.Prim2DBase
  339. },
  340. 'Prim2DClassInfo': {
  341. type: BABYLON.Prim2DClassInfo
  342. },
  343. 'Prim2DPropInfo': {
  344. type: BABYLON.Prim2DPropInfo
  345. },
  346. 'Rectangle2D': {
  347. type: BABYLON.Rectangle2D
  348. },
  349. 'Rectangle2DInstanceData': {
  350. type: BABYLON.Rectangle2DInstanceData
  351. },
  352. 'Rectangle2DRenderCache': {
  353. type: BABYLON.Rectangle2DRenderCache
  354. },
  355. 'Render2DContext': {
  356. type: BABYLON.Render2DContext
  357. },
  358. 'RenderablePrim2D': {
  359. type: BABYLON.RenderablePrim2D
  360. },
  361. 'ScreenSpaceCanvas2D': {
  362. type: BABYLON.ScreenSpaceCanvas2D
  363. },
  364. 'Shape2D': {
  365. type: BABYLON.Shape2D
  366. },
  367. 'Shape2DInstanceData': {
  368. type: BABYLON.Shape2DInstanceData
  369. },
  370. 'Sprite2D': {
  371. type: BABYLON.Sprite2D
  372. },
  373. 'Sprite2DInstanceData': {
  374. type: BABYLON.Sprite2DInstanceData
  375. },
  376. 'Sprite2DRenderCache': {
  377. type: BABYLON.Sprite2DRenderCache
  378. },
  379. 'Text2D': {
  380. type: BABYLON.Text2D
  381. },
  382. 'Text2DInstanceData': {
  383. type: BABYLON.Text2DInstanceData
  384. },
  385. 'Text2DRenderCache': {
  386. type: BABYLON.Text2DRenderCache
  387. },
  388. 'WorldSpaceCanvas2D': {
  389. type: BABYLON.WorldSpaceCanvas2D
  390. },
  391. 'WorldSpaceCanvas2DNode': {
  392. type: BABYLON.WorldSpaceCanvas2DNode
  393. },
  394. 'PhysicsImpostor': {
  395. type: BABYLON.PhysicsImpostor,
  396. properties: [
  397. 'friction',
  398. 'mass',
  399. 'restitution',
  400. ]
  401. },
  402. }
  403. }