当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript babylonjs.Mesh类代码示例

本文整理汇总了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);

    }
开发者ID:sonicdelay,项目名称:mtcms,代码行数:32,代码来源:arena.ts

示例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;
        })
    }
开发者ID:yuccai,项目名称:Babylon.js,代码行数:17,代码来源:HDRCubeTextureElement.ts

示例3: _createNode

 // Mesh association
 protected _createNode(scene: Scene): TransformNode {
     this._currentMesh.getChildMeshes().forEach((mesh) => {
         mesh.metadata = this;
     });
     return this._currentMesh;
 }
开发者ID:Palmer-JC,项目名称:Babylon.js,代码行数:7,代码来源:meshButton3D.ts


注:本文中的babylonjs.Mesh类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。