大约有 19 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0042 秒)
...,Z值会影响Cluster接受区域光(点光、聚光)影响的数量,Math.floor(2048 / lightClusterCount.z - 1) * 4 为每个Cluster的最大平均接受区域光数量,如果每个Cluster所接受光源影响的平均数量大于该值,则较远的Cluster会忽略其中多余的光照影响...
来源: Laya3.0_文档 发布时间: 20251010
...lean, rotationInfo: Laya.RotationInfo): void { this.info.text = "alpha:" + Math.floor(rotationInfo.alpha) + '\n' + "beta :" + Math.floor(rotationInfo.beta) + '\n' + "gamma:" + Math.floor(rotationInfo.gamma); } } new Gyroscope_Sample(); 2、加速计 Accelerator类定期发送设备的运动传...
来源: Laya3.0_文档 发布时间: 20251010
...; i < this._colorNums; i++) { let offset = i * 4; colorBuffer[offset] = Math.random(); colorBuffer[offset + 1] = Math.random(); colorBuffer[offset + 2] = Math.random(); colorBuffer[offset + 3] = 1; } //设置uniformbuffer this.batchMat.setBuffer("colormap", colorBuffer); } //随机生成_spriteNu...
来源: Laya3.0_文档 发布时间: 20251010
...ayTime + Laya.timer.delta / 1000) % this.dayDuration; const totalMinutes = Math.floor((this.getAdjustedProgress()) * 24 * 60); const hours = Math.floor(totalMinutes / 60); const minutes = totalMinutes % 60; const timeString = `${this.padNumber(hours)}:${this.padNumber(minutes)}`; // 更新文本显...
来源: Laya3.0_文档 发布时间: 20251010
...V(radius: number, numSegments: number): Laya.Mesh2D { // 2π const twoPi = Math.PI * 2; // 顶点数组 let vertexs = new Float32Array((numSegments + 1) * 5); // 索引数组 let index = new Uint16Array((numSegments + 1) * 3); var pos = 0; // 生成圆周上的顶点 for (let i = 0; i < numSegmen...
来源: Laya3.0_文档 发布时间: 20251120
...ffer.getChannelData(channel); for (var i = 0; i < frameCount; i++) { // Math.random() is in [0; 1.0] // audio needs to be in [-1.0; 1.0] nowBuffering[i] = Math.random() * 2 - 1; } } // Get an AudioBufferSourceNode. // This is the AudioNode to use when we want to play an AudioBuffer var source = a...
来源: Laya3.0_文档 发布时间: 20251010
...; var cellZ = this.terrainSprite.depth / this.aStarMap.height; var gridX = Math.floor((x - minX) / cellX); var gridZ = Math.floor((z - minZ) / cellZ); var boundWidth = this.aStarMap.width - 1; var boundHeight = this.aStarMap.height - 1; (gridX > boundWidth) && (gridX = boundWidth); (gridZ...
来源: Laya3.0_文档 发布时间: 20230303
...; for(var i=0;i<10000;i++) { this.text=new Laya.Text(); this.text.text=(Math.random()*100).toFixed(0); this.text.color="#CCCCCC"; this.text.x=Math.random()*550; this.text.y=Math.random()*400; textBox.addChild(this.text); } Laya.stage.addChild(textBox); } } 下面是笔者电脑上的运行时截...
来源: Laya3.0_文档 发布时间: 20251010
...: number): void { // 控制台打印输出进度 console.log("进度:" + Math.floor(value * 100) + "%"); } } 示例效果如下: (动图2-1) ProgressBar的其他属性也可以通过代码来设置,上述示例演示了如何通过代码创建ProgressBar,有兴趣的开发者可以自己...
来源: Laya3.0_文档 发布时间: 20251010
....scaleTime += Laya.timer.delta / 1000 * this.scaleSpeed; const scale = 1 + Math.sin(this.scaleTime) * 0.5; // 增加缩放变化幅度 this.lightComp.lightScale.setValue(scale, scale); } } 运行的效果如动图3-1所示, (动图3-1) Copyright ©Layabox 2025 all right reserved,powered by L...
来源: Laya3.0_文档 发布时间: 20251010