Update: CC - Bacon - Entity Loaded (8ia8dlk7l5.js) 1098 bytes modified

beta.r3js.org
-=yb4f310 2018-02-22 15:28:25 +01:00
parent 63cd324284
commit 65f73d99b7
1 changed files with 69 additions and 31 deletions

View File

@ -1484,41 +1484,79 @@ GameLib.CustomCode.prototype.clearGrid = function() {
GameLib.CustomCode.prototype.createTile = function(tileName, imageName, displace) {
var material = null;
var apiMaterial = {};
var apiMaterial;
if (imageName) {
apiMaterial.diffuseMap = new GameLib.D3.Texture.Image(
this.graphics,
{
image : this[imageName]
}
);
};
if (displace) {
apiMaterial.displacementMap = this.textureDisplacement;
}
material = new GameLib.D3.Material.Phong(
this.graphics,
apiMaterial
)
if (displace) {
apiMaterial = new GameLib.D3.API.Material.Phong(
null,
null,
null,
null,
null,
null,
null,
null,
this.textureDisplacement,
null,
null,
null,
null,
null,
null,
null,
null,
new GameLib.D3.API.Texture.Image(
null,
this[imageName]
)
)
} else {
apiMaterial = new GameLib.D3.API.Material.Phong(
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
new GameLib.D3.API.Texture.Image(
null,
this[imageName]
)
)
}
} else {
apiMaterial = new GameLib.D3.API.Material.Phong();
}
this[tileName] = new GameLib.D3.Mesh(
this[tileName] = new GameLib.D3.Mesh(
this.graphics,
{
geometry : {
componentType : GameLib.Component.GEOMETRY_BUFFER_PLANE,
width : 1,
height : 1,
widthSegments : 10,
heightSegments : 10
},
parentScene : this.scene,
materials : [material]
}
new GameLib.D3.API.Mesh(
null,
new GameLib.D3.API.Geometry.Buffer.Plane(
null,
1,
1,
10,
10
),
[
apiMaterial
],
null,
this.scene
)
)
this[tileName].visible = false;