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