當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。