templates.json 5.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. [
  2. {
  3. "label" : "Create a sphere",
  4. "documentation" : "https://doc.babylonjs.com/how_to/set_shapes",
  5. "insertText" : "var sphere = BABYLON.MeshBuilder.CreateSphere(\"${1:sphere}\", {diameter: ${2:1}}, scene);"
  6. },
  7. {
  8. "label" : "Create a box",
  9. "documentation" : "https://doc.babylonjs.com/how_to/set_shapes",
  10. "insertText" : "var box = BABYLON.MeshBuilder.CreateBox(\"${1:box}\", {size: ${2:1}}, scene);"
  11. },
  12. {
  13. "label" : "Load CPU Particle System from Snippet Server",
  14. "documentation" : "https://doc.babylonjs.com/babylon101/particles#snippet-server",
  15. "insertText" : "BABYLON.ParticleHelper.CreateFromSnippetAsync(\"${1:your_snippet_url_no_#}\", scene, false).then(system => {\n\n});"
  16. },
  17. {
  18. "label" : "Load GPU Particle System from Snippet Server",
  19. "documentation" : "https://doc.babylonjs.com/babylon101/particles#snippet-server",
  20. "insertText" : "BABYLON.ParticleHelper.CreateFromSnippetAsync(\"${1:your_snippet_url_no_#}\", scene, true).then(system => {\n\n});"
  21. },
  22. {
  23. "label" : "Create a cylinder",
  24. "documentation" : "https://doc.babylonjs.com/how_to/set_shapes",
  25. "insertText" : "var cylinder = BABYLON.MeshBuilder.CreateCylinder(\"${1:cylinder}\", {height: ${2:2}, diameter: ${3:1}}, scene);"
  26. },
  27. {
  28. "label" : "Create a ground plane",
  29. "documentation" : "https://doc.babylonjs.com/how_to/set_shapes",
  30. "insertText" : "var ground = BABYLON.MeshBuilder.CreateGround(\"${1:ground}\", {width: ${2:6}, height: ${3:6}}, scene);"
  31. },
  32. {
  33. "label" : "Create a point light",
  34. "documentation" : "https://doc.babylonjs.com/babylon101/lights#the-point-light",
  35. "insertText" : "var pointLight = new BABYLON.PointLight(\"${1:pointLight}\", new BABYLON.Vector3(${2:0},${3:5},${4:0}), scene);"
  36. },
  37. {
  38. "label" : "Create a directional light",
  39. "documentation" : "https://doc.babylonjs.com/babylon101/lights#the-directional-light",
  40. "insertText" : "var dirLight = new BABYLON.DirectionalLight(\"${1:dirLight}\", new BABYLON.Vector3(${2:0.25},${3:-1},${4:-0.25}), scene);"
  41. },
  42. {
  43. "label" : "Create a spot light",
  44. "documentation" : "https://doc.babylonjs.com/babylon101/lights#the-spot-light",
  45. "insertText" : "var spotLight = new BABYLON.SpotLight(\"${1:spotLight}\", new BABYLON.Vector3(${2:0}, ${3:30}, ${4:-10}), new BABYLON.Vector3(${5:0}, ${6:-1}, ${7:0}), ${8:Math.PI / 3}, ${9:2}, scene);"
  46. },
  47. {
  48. "label" : "Create a hemispheric light",
  49. "documentation" : "https://doc.babylonjs.com/babylon101/lights#the-hemispheric-light",
  50. "insertText" : "var hemiLight = new BABYLON.HemisphericLight(\"${1:hemiLight}\", new BABYLON.Vector3(${2:0}, ${3:1}, ${4:0}), scene);"
  51. },
  52. {
  53. "label" : "Load a Node Material from snippet w/callback",
  54. "documentation" : "https://doc.babylonjs.com/how_to/node_material#loading-from-a-file-saved-from-the-node-material-editor",
  55. "insertText" : "BABYLON.NodeMaterial.ParseFromSnippetAsync(\"${1:your_snippet_url_no_#}\", scene).then(nodeMaterial => {\n ${2:mesh_to_apply_node_material_to}.material = nodeMaterial;\n});"
  56. },
  57. {
  58. "label" : "Show the Inspector",
  59. "documentation" : "https://doc.babylonjs.com/features/playground_debuglayer",
  60. "insertText" : "scene.debugLayer.show({\n embedMode:true\n});"
  61. },
  62. {
  63. "label" : "Create an Arc Rotate Camera w/Degrees",
  64. "documentation" : "https://doc.babylonjs.com/babylon101/cameras#arc-rotate-camera",
  65. "insertText" : "var camera = new BABYLON.ArcRotateCamera(\"${1:camera}\", BABYLON.Tools.ToRadians(${2:90}), BABYLON.Tools.ToRadians(${3:65}), ${4:10}, ${5:BABYLON.Vector3.Zero()}, scene);"
  66. },
  67. {
  68. "label" : "Create an Arc Rotate Camera w/Radians",
  69. "documentation" : "https://doc.babylonjs.com/babylon101/cameras#arc-rotate-camera",
  70. "insertText" : "var camera = new BABYLON.ArcRotateCamera(\"${1:camera}\", ${2:0}, ${3:Math.PI/2}, ${4:10}, ${5:BABYLON.Vector3.Zero()}, scene);"
  71. },
  72. {
  73. "label" : "Import a Mesh w/callback",
  74. "documentation" : "https://doc.babylonjs.com/resources/external_pg_assets",
  75. "insertText" : "BABYLON.SceneLoader.ImportMesh(\"${1:meshName}\", \"${2:url to the mesh parent directory}\", \"${3:Mesh filename.fileextension}\", scene, function(newMeshes){\n\n});"
  76. },
  77. {
  78. "label" : "Setup a shadow generator",
  79. "documentation" : "https://doc.babylonjs.com/babylon101/shadows",
  80. "insertText" : "var shadowGenerator = new BABYLON.ShadowGenerator(${1:size}, ${2:the_light_source});\nshadowGenerator.getShadowMap().renderList.push(${3:the_mesh_that_casts_a_shadow});\n${4:mesh_that_receives_the_shadow}.receiveShadows = true;"
  81. },
  82. {
  83. "label" : "Export scene to GLB",
  84. "documentation" : "https://doc.babylonjs.com/extensions/gltfexporter#exporting-a-scene-to-gltf",
  85. "insertText" : "BABYLON.GLTF2Export.GLBAsync(scene, \"${1:fileName}\").then((glb) => {\n glb.downloadFiles();\n});",
  86. "language" : "javascript"
  87. },
  88. {
  89. "label" : "Export scene to GLTF",
  90. "documentation" : "https://doc.babylonjs.com/extensions/gltfexporter#exporting-a-scene-to-gltf",
  91. "insertText" : "BABYLON.GLTF2Export.GLTFAsync(scene, \"${1:fileName}\").then((gltf) => {\n gltf.downloadFiles();\n});",
  92. "language" : "javascript"
  93. }
  94. ]