properties.ts 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  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. 'FontTexture': {
  73. type: BABYLON.FontTexture
  74. },
  75. 'Sound': {
  76. type: BABYLON.Sound,
  77. properties: [
  78. 'name',
  79. 'autoplay',
  80. 'loop',
  81. 'useCustomAttenuation',
  82. 'soundTrackId',
  83. 'spatialSound',
  84. 'refDistance',
  85. 'rolloffFactor',
  86. 'maxDistance',
  87. 'distanceModel',
  88. 'isPlaying',
  89. 'isPaused'
  90. ]
  91. },
  92. 'ArcRotateCamera': {
  93. type: BABYLON.ArcRotateCamera,
  94. properties: [
  95. 'position',
  96. 'alpha',
  97. 'beta',
  98. 'radius',
  99. 'angularSensibilityX',
  100. 'angularSensibilityY',
  101. 'target',
  102. 'lowerAlphaLimit',
  103. 'lowerBetaLimit',
  104. 'upperAlphaLimit',
  105. 'upperBetaLimit',
  106. 'lowerRadiusLimit',
  107. 'upperRadiusLimit',
  108. 'pinchPrecision',
  109. 'wheelPrecision',
  110. 'allowUpsideDown',
  111. 'checkCollisions'
  112. ]
  113. },
  114. 'FreeCamera': {
  115. type: BABYLON.FreeCamera,
  116. properties: [
  117. 'position',
  118. 'rotation',
  119. 'rotationQuaternion',
  120. 'cameraDirection',
  121. 'cameraRotation',
  122. 'ellipsoid',
  123. 'applyGravity',
  124. 'angularSensibility',
  125. 'keysUp',
  126. 'keysDown',
  127. 'keysLeft',
  128. 'keysRight',
  129. 'checkCollisions',
  130. 'speed',
  131. 'lockedTarget',
  132. 'noRotationConstraint',
  133. 'fov',
  134. 'inertia',
  135. 'minZ', 'maxZ',
  136. 'layerMask',
  137. 'mode',
  138. 'orthoBottom',
  139. 'orthoTop',
  140. 'orthoLeft',
  141. 'orthoRight'
  142. ]
  143. },
  144. 'Scene': {
  145. type: BABYLON.Scene,
  146. properties: [
  147. 'actionManager',
  148. 'activeCamera',
  149. 'ambientColor',
  150. 'clearColor',
  151. 'forceWireframe',
  152. 'forcePointsCloud',
  153. 'forceShowBoundingBoxes',
  154. 'useRightHandedSystem',
  155. 'hoverCursor',
  156. 'cameraToUseForPointers',
  157. 'fogEnabled',
  158. 'fogColor',
  159. 'fogDensity',
  160. 'fogStart',
  161. 'fogEnd',
  162. 'shadowsEnabled',
  163. 'lightsEnabled',
  164. 'collisionsEnabled',
  165. 'gravity',
  166. 'meshUnderPointer',
  167. 'pointerX',
  168. 'pointerY',
  169. 'uid'
  170. ]
  171. },
  172. 'Mesh': {
  173. type: BABYLON.Mesh,
  174. properties: [
  175. 'name',
  176. 'position',
  177. 'rotation',
  178. 'rotationQuaternion',
  179. 'absolutePosition',
  180. 'material',
  181. 'actionManager',
  182. 'visibility',
  183. 'isVisible',
  184. 'isPickable',
  185. 'renderingGroupId',
  186. 'receiveShadows',
  187. 'renderOutline',
  188. 'outlineColor',
  189. 'outlineWidth',
  190. 'renderOverlay',
  191. 'overlayColor',
  192. 'overlayAlpha',
  193. 'hasVertexAlpha',
  194. 'useVertexColors',
  195. 'layerMask',
  196. 'alwaysSelectAsActiveMesh',
  197. 'ellipsoid',
  198. 'ellipsoidOffset',
  199. 'edgesWidth',
  200. 'edgesColor',
  201. 'checkCollisions',
  202. 'hasLODLevels'
  203. ],
  204. format: (m: BABYLON.Mesh): string => { return m.name; }
  205. },
  206. 'StandardMaterial': {
  207. type: BABYLON.StandardMaterial,
  208. properties: [
  209. 'name',
  210. 'alpha',
  211. 'alphaMode',
  212. 'wireframe',
  213. 'isFrozen',
  214. 'zOffset',
  215. 'ambientColor',
  216. 'emissiveColor',
  217. 'diffuseColor',
  218. 'specularColor',
  219. 'specularPower',
  220. 'useAlphaFromDiffuseTexture',
  221. 'linkEmissiveWithDiffuse',
  222. 'useSpecularOverAlpha',
  223. 'diffuseFresnelParameters',
  224. 'opacityFresnelParameters',
  225. 'reflectionFresnelParameters',
  226. 'refractionFresnelParameters',
  227. 'emissiveFresnelParameters',
  228. 'diffuseTexture',
  229. 'emissiveTexture',
  230. 'specularTexture',
  231. 'ambientTexture',
  232. 'bumpTexture',
  233. 'lightMapTexture',
  234. 'opacityTexture',
  235. 'reflectionTexture',
  236. 'refractionTexture'
  237. ],
  238. format: (mat: BABYLON.StandardMaterial): string => { return mat.name; }
  239. },
  240. 'PrimitiveAlignment': {
  241. type: BABYLON.PrimitiveAlignment,
  242. properties: ['horizontal', 'vertical']
  243. },
  244. 'PrimitiveThickness': {
  245. type: BABYLON.PrimitiveThickness,
  246. properties: ['topPixels', 'leftPixels', 'rightPixels', 'bottomPixels']
  247. },
  248. 'BoundingInfo2D': {
  249. type: BABYLON.BoundingInfo2D,
  250. properties: ['radius', 'center', 'extent']
  251. },
  252. 'SolidColorBrush2D': {
  253. type: BABYLON.SolidColorBrush2D,
  254. properties: ['color']
  255. },
  256. 'GradientColorBrush2D': {
  257. type: BABYLON.GradientColorBrush2D,
  258. properties: ['color1', 'color2', 'translation', 'rotation', 'scale']
  259. },
  260. 'PBRMaterial': {
  261. type: BABYLON.PBRMaterial,
  262. properties: [
  263. 'name',
  264. 'albedoColor',
  265. 'albedoTexture',
  266. 'opacityTexture',
  267. 'reflectionTexture',
  268. 'emissiveTexture',
  269. 'bumpTexture',
  270. 'lightmapTexture',
  271. 'opacityFresnelParameters',
  272. 'emissiveFresnelParameters',
  273. 'linkEmissiveWithAlbedo',
  274. 'useLightmapAsShadowmap',
  275. 'useAlphaFromAlbedoTexture',
  276. 'useSpecularOverAlpha',
  277. 'useAutoMicroSurfaceFromReflectivityMap',
  278. 'useLogarithmicDepth',
  279. 'reflectivityColor',
  280. 'reflectivityTexture',
  281. 'reflectionTexture',
  282. 'reflectionColor',
  283. 'alpha',
  284. 'linkRefractionWithTransparency',
  285. 'indexOfRefraction',
  286. 'microSurface',
  287. 'useMicroSurfaceFromReflectivityMapAlpha',
  288. 'directIntensity',
  289. 'emissiveIntensity',
  290. 'specularIntensity',
  291. 'environmentIntensity',
  292. 'cameraExposure',
  293. 'cameraContrast',
  294. 'cameraColorGradingTexture',
  295. 'cameraColorCurves'
  296. ]
  297. },
  298. 'Canvas2D': {
  299. type: BABYLON.Canvas2D
  300. },
  301. 'Canvas2DEngineBoundData': {
  302. type: BABYLON.Canvas2DEngineBoundData
  303. },
  304. 'Ellipse2D': {
  305. type: BABYLON.Ellipse2D
  306. },
  307. 'Ellipse2DInstanceData': {
  308. type: BABYLON.Ellipse2DInstanceData
  309. },
  310. 'Ellipse2DRenderCache': {
  311. type: BABYLON.Ellipse2DRenderCache
  312. },
  313. 'Group2D': {
  314. type: BABYLON.Group2D
  315. },
  316. 'IntersectInfo2D': {
  317. type: BABYLON.IntersectInfo2D
  318. },
  319. 'Lines2D': {
  320. type: BABYLON.Lines2D
  321. },
  322. 'Lines2DInstanceData': {
  323. type: BABYLON.Lines2DInstanceData
  324. },
  325. 'Lines2DRenderCache': {
  326. type: BABYLON.Lines2DRenderCache
  327. },
  328. 'PrepareRender2DContext': {
  329. type: BABYLON.PrepareRender2DContext
  330. },
  331. 'Prim2DBase': {
  332. type: BABYLON.Prim2DBase
  333. },
  334. 'Prim2DClassInfo': {
  335. type: BABYLON.Prim2DClassInfo
  336. },
  337. 'Prim2DPropInfo': {
  338. type: BABYLON.Prim2DPropInfo
  339. },
  340. 'Rectangle2D': {
  341. type: BABYLON.Rectangle2D
  342. },
  343. 'Rectangle2DInstanceData': {
  344. type: BABYLON.Rectangle2DInstanceData
  345. },
  346. 'Rectangle2DRenderCache': {
  347. type: BABYLON.Rectangle2DRenderCache
  348. },
  349. 'Render2DContext': {
  350. type: BABYLON.Render2DContext
  351. },
  352. 'RenderablePrim2D': {
  353. type: BABYLON.RenderablePrim2D
  354. },
  355. 'ScreenSpaceCanvas2D': {
  356. type: BABYLON.ScreenSpaceCanvas2D
  357. },
  358. 'Shape2D': {
  359. type: BABYLON.Shape2D
  360. },
  361. 'Shape2DInstanceData': {
  362. type: BABYLON.Shape2DInstanceData
  363. },
  364. 'Sprite2D': {
  365. type: BABYLON.Sprite2D
  366. },
  367. 'Sprite2DInstanceData': {
  368. type: BABYLON.Sprite2DInstanceData
  369. },
  370. 'Sprite2DRenderCache': {
  371. type: BABYLON.Sprite2DRenderCache
  372. },
  373. 'Text2D': {
  374. type: BABYLON.Text2D
  375. },
  376. 'Text2DInstanceData': {
  377. type: BABYLON.Text2DInstanceData
  378. },
  379. 'Text2DRenderCache': {
  380. type: BABYLON.Text2DRenderCache
  381. },
  382. 'WorldSpaceCanvas2D': {
  383. type: BABYLON.WorldSpaceCanvas2D
  384. },
  385. 'WorldSpaceCanvas2DNode': {
  386. type: BABYLON.WorldSpaceCanvas2DNode
  387. },
  388. 'PhysicsImpostor': {
  389. type: BABYLON.PhysicsImpostor,
  390. properties: [
  391. 'friction',
  392. 'mass',
  393. 'restitution',
  394. ]
  395. },
  396. }
  397. }