本文整理汇总了TypeScript中babylonjs.Mesh.CreateGround方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Mesh.CreateGround方法的具体用法?TypeScript Mesh.CreateGround怎么用?TypeScript Mesh.CreateGround使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类babylonjs.Mesh
的用法示例。
在下文中一共展示了Mesh.CreateGround方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(game) {
this._game = game;
this.size = 100;
const light = new BABYLON.HemisphericLight('light1', new BABYLON.Vector3(1, 2, -1), this._game.scene);
//const skybox = BABYLON.Mesh.CreateSphere('skyBox', 50, 1000, game.scene);
//skybox.layerMask = 2;
const ground = BABYLON.Mesh.CreateGround("ground", this.size, this.size, 2, this._game.scene);
this._deactivateSpecular(ground);
ground.checkCollisions = true;
ground.renderOutline = true;
ground.outlineColor = new BABYLON.Color3(0, 0, 0);
ground.physicsImpostor = new BABYLON.PhysicsImpostor(
ground,
BABYLON.PhysicsImpostor.BoxImpostor,
{ mass: 0, friction: 0.5, restitution: 0.7 },
this._game.scene
);
setInterval(() => {
var posX = this._randomNumber(-this.size/2, this.size/2);
var posZ = this._randomNumber(-this.size/2, this.size/2);
var t = new Target(this._game, posX, posZ);
}, 1000);
this.minimap = new Minimap(this._game, this.size);
}