本文整理汇总了TypeScript中babylonjs.Mesh类的典型用法代码示例。如果您正苦于以下问题:TypeScript Mesh类的具体用法?TypeScript Mesh怎么用?TypeScript Mesh使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Mesh类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: _populateScene
/** Creates the box */
protected _populateScene() {
// Create the hdr texture
let hdrTexture = new HDRCubeTexture(this._textureUrl, this._scene, 512);
hdrTexture.coordinatesMode = Texture.SKYBOX_MODE;
this._cube = Mesh.CreateBox("hdrSkyBox", 10.0, this._scene);
let hdrSkyboxMaterial = new PBRMaterial("skyBox", this._scene);
hdrSkyboxMaterial.backFaceCulling = false;
hdrSkyboxMaterial.reflectionTexture = hdrTexture;
hdrSkyboxMaterial.microSurface = 1.0;
hdrSkyboxMaterial.disableLighting = true;
this._cube.material = hdrSkyboxMaterial;
this._cube.registerBeforeRender(() => {
this._cube.rotation.y += 0.01;
})
}
示例3: _createNode
// Mesh association
protected _createNode(scene: Scene): TransformNode {
this._currentMesh.getChildMeshes().forEach((mesh) => {
mesh.metadata = this;
});
return this._currentMesh;
}