大约有 11 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0053 秒)
...距离。 * @param isLocal 是否局部空间。 */ translate(translation: Vector3, isLocal: boolean = true): void { if (isLocal) { Matrix4x4.createFromQuaternion(this.localRotation, Transform3D._tempMatrix0); Vector3.transformCoordinate(translation, Transform3D._tempMatrix0, Transform3D._tempVector...
来源: Laya3.0_文档 发布时间: 20251010
...动插值参数值 public camDepthSmooth: number = 20 public curpos: Laya.Vector3; private delatpos: Laya.Vector3; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 * 此方法为虚方法,使用时重写覆盖即...
来源: Laya3.0_文档 发布时间: 20251010
...的范围 pointCom.range = 3.0; pointLight.transform.position = new Laya.Vector3(0.0, 1, 0.0); 三、DirectionLight Direction Light(平行光)与点光区别较大,它有固定的一个方向,可通过弧度值设定,并且也没有衰减和光照范围,会对全场景所有模型进行...
来源: Laya3.0_文档 发布时间: 20251010
...节点也跟随移动 this.layaMonkeyParent.transform.translate(new Laya.Vector3(-0.2, 0, 0); (动图3-2) 通过点击按钮,让子节点移动,可以看到父节点并没有移动 this.layaMonkeySon.transform.translate(new Laya.Vector3(-0.2, 0, 0); 四、克隆 关于克隆,LayaAir3D中...
来源: Laya3.0_文档 发布时间: 20251010
...ler); //设置出生点位置 this.characterController.position = new Laya.Vector3(0, 0, 0); } } 4.2 角色移动 move() 角色移动用于通过指定移动向量来移动角色。 在代码中,如果要自由控制角色的移动,通常是放到每帧更新(onUpdate())的时候执行,通...
来源: Laya3.0_文档 发布时间: 20251010
...可以在代码中设置,示例代码如下: Physics2D.I.gravity= new Vector2(0,9.8) 2.3.3 重力缩放系数 gravity Scale 除了全局的重力加速度参数设置外,刚体的重力缩放系数属性,是用于独立影响单个动态刚体重力效果的参数。 该值乘以重力值,...
来源: Laya3.0_文档 发布时间: 20251010
... colorIndex); } } private _getRandomPosition(positionRanvge: number): Laya.Vector3 { let getRangeRandom = () => { return (Math.random() - 0.5) * positionRanvge; } return new Laya.Vector3(getRangeRandom(), 0.3, getRangeRandom()); } } shader代码如下: Shader3D Start { type:Shader3D name:PBRCol...
来源: Laya3.0_文档 发布时间: 20251010
...移速度越快。 (动图1-2) angulaVelocity属性的值是3维向量Vector3类型值,Bullet使用欧拉角来描述物体的旋转,3D向量的每个分量代表绕x、y、z轴旋转的速度,单位是弧度/秒。动图1-2,就是在x轴分别设置了3.14与31.4的对比效果。 angul...
来源: Laya3.0_文档 发布时间: 20251010
... type : Laya.Sprite3D}) public cube: Laya.Sprite3D; private rotation: Laya.Vector3 = new Laya.Vector3(0, 0.01, 0); onStart() { Laya.timer.frameLoop(1, this, ()=> { this.cube.transform.rotate(this.rotation, false); }); } } 效果如动图4-4所示: (动图4-4) 4.1.3 3D节点的进阶使用 @...
来源: Laya3.0_文档 发布时间: 20251010
...e, Nav2DAgent); } onMouseClick(evt: Laya.Event): void { let pos = new Laya.Vector2(evt.stageX, evt.stageY); console.log("click", pos); this._temp.graphics.clear(); this._allAgent.forEach((agent) => { agent.destination = pos; let paths = agent.getCurrentPath(); if (paths.length >= 2) { let poin...
来源: Laya3.0_文档 发布时间: 20251010