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

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

31. rigidBody.applyForce 物体不会移动 [ 74%]

...ildByName( "Monster1" ) as Laya.Sprite3D; scene.addChild(Monster); Monster.transform.translate( new Laya.Vector3(monster_position_x, 0, monster_position_z) ); this.monster_character = Monster; // this.master_turn(); //添加自定义模型 var box: Laya.MeshSprite3D = this.scene.addChild( new Laya.M...

来源: Laya_社区 发布时间: 20200917

32. 子弹添加了colliderShape后onUpdate移动,destroy会报错“Cannot read property 'getWorldTransform' of null” [ 73%]

...rShape后onUpdate移动,destroy会报错“Cannot read property 'getWorldTransform' of null” 发射时生成子弹: onFire() { if (this.isFire) { Laya.Mesh.load("fly2/fly3-bullet.lm", Laya.Handler.create(this, function (m) { let bullet = new Laya.MeshSprite3D(m); this.Sn.addChild(bullet); bull...

来源: Laya_社区 发布时间: 20190308

33. 循环复制了三次,scence打印出来也只有三个sprite,但是显示了五个 [ 73%]

...是显示了五个 for(var i=0;i<3;i++) { var aa=Util.Block.clone(); aa.transform.localPositionX=i; aa.transform.localPositionY=0; console.log("白色方块位置"+aa.transform.localPositionX); console.log(aa.transform.localPositionY); console.log(aa.transform.localPositionZ); GameUI.instance.sen...

来源: Laya_社区 发布时间: 20191111

34. Sprite3D添加组件或脚本(JavaScript-3D基础(JS)-LayaAir3D之精灵) [ 72%]

...相机 var camera = scene.addChild(new Laya.Camera(0, 0.1, 100)); camera.transform.translate(new Laya.Vector3(0, 0.8, 1.5)); camera.transform.rotate(new Laya.Vector3(-15, 0, 0), true, false); //创建平行光 var directionLight = scene.addChild(new Laya.DirectionLight()); directionLight.color = new...

来源: Laya2.0_文档 发布时间: 20210714

35. 请问Laya如何使用第三方物理库 [ 71%]

...tic map: { [key: number]: Laya.Sprite3D } = {}; body: CANNON.Body; t: Laya.Transform3D; public onCollisionCB: (s: Laya.Sprite3D) => void; public ignoreRotate: boolean = false; ...OnAwake里面创建CANNON.Body, OnEnable里面把CANNON.Body加入到CANNON.World, OnDisable则移除, onUpdate里面...

来源: Laya_社区 发布时间: 20200217

36. 3D中摄像机绕物体旋转该如何实现? [ 71%]

...上OK,移动端没试,有问题调试着改一改就OK啦。。import Transform3D = Laya.Transform3D; import Vector3 = laya.d3.math.Vector3; import Quaternion = laya.d3.math.Quaternion; /* 用法: //初始化照相机 var camera = this.newScene.addChild(new Laya.Camera(0, 0.1, 100)) as Laya.Ca...

来源: Laya_社区 发布时间: 20170714

37. Sprite3D添加组件或脚本(TypeScript-3D基础(TS)-LayaAir3D之精灵) [ 71%]

...相机 var camera = scene.addChild(new Laya.Camera(0, 0.1, 100)); camera.transform.translate(new Laya.Vector3(0, 0.8, 1.5)); camera.transform.rotate(new Laya.Vector3(-15, 0, 0), true, false); //创建平行光 var directionLight = scene.addChild(new Laya.DirectionLight()); directionLight.color = new...

来源: Laya2.0_文档 发布时间: 20210715

38. 多点触控的使用(JavaScript-3D基础(JS)-LayaAir3D之鼠标交互) [ 70%]

....y = this.touch.position.y; //根据移动的距离进行旋转 this.owner.transform.rotate(new Laya.Vector3(1 * deltaY /2, 1 * deltaX / 2, 0), true, false); } } else if (2 === touchCount){ this._text.text = "触控点为2"; this.isTwoTouch = true; //获取两个触碰点 var touch = this._scene.inp...

来源: Laya2.0_文档 发布时间: 20210715

39. 多点触控的使用(TypeScript-3D基础(TS)-LayaAir3D之鼠标交互) [ 70%]

....y = this.touch.position.y; //根据移动的距离进行旋转 this.owner.transform.rotate(new Laya.Vector3(1 * deltaY /2, 1 * deltaX / 2, 0), true, false); } } else if (2 === touchCount){ this._text.text = "触控点为2"; this.isTwoTouch = true; //获取两个触碰点 var touch = this._scene.inp...

来源: Laya2.0_文档 发布时间: 20210715

40. 挂载物体的3D变换问题 [ 70%]

...8); var cylinder3D:MeshSprite3D=new MeshSprite3D(cylinderMesh); cylinder3D.transform.translate(new Vector3(3,0,0),true); cylinder3D.transform.localScale = new Vector3(2,2,2); cylinder3D.transform.localRotationEuler = new Vector3(90,90,90); role.getChildAt(0).addChild(cylinder3D); this.ani.linkSprite...

来源: Laya_社区 发布时间: 20170904