Skip to content

Commit

Permalink
api adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
Raanan Weber committed Oct 8, 2021
1 parent b534908 commit 92b3782
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class RenderGridPropertyGridComponent extends React.Component<IRenderGrid
var width = (extend.max.x - extend.min.x) * 5.0;
var depth = (extend.max.z - extend.min.z) * 5.0;

this._gridMesh = CreateGround("grid", { width: 1.0, height: 1.0, subdivisions: 1 }, this._scene);
this._gridMesh = CreateGround("grid", { width: 1.0, height: 1.0, subdivisions: 1 }, scene);
if (!this._gridMesh.reservedDataStore) {
this._gridMesh.reservedDataStore = {};
}
Expand Down
5 changes: 1 addition & 4 deletions materialsLibrary/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,4 @@
});
</script>
</body>
</html>

Mesh.CreateGround\(['"](.*)['"], ([0-9.]+), ([0-9.]+), ([0-9.]+), (.*)\);
GroundBuilder.CreateGround("$1", { width: $2, height: $3, subdivisions: $4 }, this._scene);
</html>
2 changes: 1 addition & 1 deletion materialsLibrary/test/addbackground.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ window.prepareBackgroundMaterial = function() {
back.diffuseTexture.hasAlpha = true;

// Skybox
backgroundSkybox = BABYLON.Mesh.CreateBox("hdrSkyBox", 1000.0, scene);
backgroundSkybox = BABYLON.MeshBuilder.CreateBox("hdrSkyBox", { size: 1000.0 }, scene);
backgroundSkybox.material = backSky;
backgroundSkybox.setEnabled(false);

Expand Down
2 changes: 1 addition & 1 deletion materialsLibrary/test/addpbr.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ window.preparePBR = function() {
pbr.microSurface = 0.9;

// Skybox
var hdrSkybox = BABYLON.Mesh.CreateBox("hdrSkyBox", 1000.0, scene);
var hdrSkybox = BABYLON.MeshBuilder.CreateBox("hdrSkyBox", { size: 1000.0 }, scene);
var hdrSkyboxMaterial = new BABYLON.PBRMaterial("skyBox", scene);
hdrSkyboxMaterial.backFaceCulling = false;
hdrSkyboxMaterial.reflectionTexture = hdrTexture.clone();
Expand Down
3 changes: 2 additions & 1 deletion nodeEditor/src/components/preview/previewManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { Layer } from "babylonjs/Layers/layer";
import { DataStorage } from "babylonjs/Misc/dataStorage";
import { NodeMaterialBlock } from "babylonjs/Materials/Node/nodeMaterialBlock";
import { CreateGround } from "babylonjs/Meshes/Builders/groundBuilder";
import { CreateSphere } from "babylonjs/Meshes/Builders/sphereBuilder";

export class PreviewManager {
private _nodeMaterial: NodeMaterial;
Expand Down Expand Up @@ -291,7 +292,7 @@ export class PreviewManager {
});
return;
case PreviewType.Sphere:
this._meshes.push(Mesh.CreateSphere("dummy-sphere", 32, 2, this._scene));
this._meshes.push(CreateSphere("dummy-sphere", { segments: 32, diameter: 2 }, this._scene));
break;
case PreviewType.Torus:
this._meshes.push(Mesh.CreateTorus("dummy-torus", 2, 0.5, 32, this._scene));
Expand Down
4 changes: 2 additions & 2 deletions postProcessLibrary/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
var hemisphericLight = new BABYLON.HemisphericLight("hemi", new BABYLON.Vector3(0, 1, 0), scene);

// Create meshes
var sphere = BABYLON.Mesh.CreateSphere("sphere", 48, 30.0, scene);
var sphere = BABYLON.MeshBuilder.CreateSphere("sphere", { segments: 48, diameter: 30.0 }, scene);

var skybox = BABYLON.Mesh.CreateBox("skyBox", 1000.0, scene);
var skybox = BABYLON.MeshBuilder.CreateBox("skyBox", { size: 1000.0 }, scene);
var skyboxMaterial = new BABYLON.StandardMaterial("skyBox", scene);
skyboxMaterial.backFaceCulling = false;
skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("/Playground/textures/TropicalSunnyDay", scene);
Expand Down
4 changes: 2 additions & 2 deletions proceduralTexturesLibrary/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
spotLight.setEnabled(false);

// Create meshes
var sphere = BABYLON.Mesh.CreateSphere("sphere", 32, 30.0, scene);
var sphere = BABYLON.MeshBuilder.CreateSphere("sphere", { segments: 32, diameter: 30.0 }, scene);

var plane = BABYLON.MeshBuilder.CreateBox("plane", { width: 30, height: 1, depth:30 }, scene);
plane.setEnabled(false);
Expand All @@ -87,7 +87,7 @@
knot.setEnabled(false);

// Skybox
var skybox = BABYLON.Mesh.CreateBox("skyBox", 1000.0, scene);
var skybox = BABYLON.MeshBuilder.CreateBox("skyBox", { size: 1000.0 }, scene);
var skyboxMaterial = new BABYLON.StandardMaterial("skyBox", scene);
skyboxMaterial.backFaceCulling = false;
skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("/Playground/textures/TropicalSunnyDay", scene);
Expand Down

0 comments on commit 92b3782

Please sign in to comment.