• 首页
  • 动态
  • 案例
  • 引擎社区
  • API
  • 文档
  • 示例
  • 引擎下载

大约有 8 项符合查询结果, 库内数据总量为 31,722 项。 (搜索耗时: 0.0045 秒)

1. 陀螺仪与加速计 · LayaAir3.4 · 引擎文档 · LAYABOX [ 100%]

... 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

2. 2D方向光 · LayaAir3.4 · 引擎文档 · LAYABOX [ 76%]

...e + 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)}`; // 更新文本显示 th...

来源: Laya3.0_文档 发布时间: 20251010

3. 3D灯光与阴影 · LayaAir3.4 · 引擎文档 · LAYABOX [ 59%]

...Z值会影响Cluster接受区域光(点光、聚光)影响的数量,Math.floor(2048 / lightClusterCount.z - 1) * 4 为每个Cluster的最大平均接受区域光数量,如果每个Cluster所接受光源影响的平均数量大于该值,则较远的Cluster会忽略其中多余的光照影响。...

来源: Laya3.0_文档 发布时间: 20251010

4. 3D寻路 · LayaAir3.0文档 · LAYABOX [ 58%]

... 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

5. 进度条组件 · LayaAir3.4 · 引擎文档 · LAYABOX [ 56%]

...ber): void { // 控制台打印输出进度 console.log("进度:" + Math.floor(value * 100) + "%"); } } 示例效果如下: (动图2-1) ProgressBar的其他属性也可以通过代码来设置,上述示例演示了如何通过代码创建ProgressBar,有兴趣的开发者可以自己通...

来源: Laya3.0_文档 发布时间: 20251010

6. 3D性能优化 · LayaAir3.4 · 引擎文档 · LAYABOX [ 54%]

...Position(positionRanvge); //随机一个颜色索引 let colorIndex = Math.floor(Math.random() * this._colorNums); //设置节点的 Laya.ENodeCustomData.custom_0 为对应的颜色索引 render.setNodeCustomData(Laya.ENodeCustomData.custom_0, colorIndex); } } private _getRandomPosition(positionRanv...

来源: Laya3.0_文档 发布时间: 20251010

7. 缓存工具-layadcc · LayaAir3.4 · 引擎文档 · LAYABOX [ 30%]

...rl, localfile, (total, now, speed) => { console.log(`downloading:${Math.floor((now / total) * 100)}`) return false;0 }, (curlret, httpret) => { if (curlret != 0 || httpret < 200 || httpret >= 300) { resolve(null); } else { resolve(localfile); } }, 10, 100000000); } ); } let zipfile = awa...

来源: Laya3.0_文档 发布时间: 20251010

8. 运行配置 · LayaAir3.4 · 引擎文档 · LAYABOX [ 24%]

...集群区域能够容纳的最大区域光源数量,计算公式为 Math.floor(2048 / lightClusterCount.z - 1) * 4。 这些集群参数会被用于多个关键环节:在初始化阶段创建 Cluster 实例和相应的纹理缓冲区;在运行时根据相机参数动态计算集群平面位置...

来源: Laya3.0_文档 发布时间: 20251231