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

大约有 58 项符合查询结果, 库内数据总量为 30,724 项。 (搜索耗时: 0.0031 秒)

1. 基于Cannon.js的物理系统(TypeScript-3D基础(TS)-LayaAir3D之物理系统) [ 100%]

... ```typescript mouseDown(){ //获取鼠标点击位置的屏幕坐标 this.point.x = MouseManager.instance.mouseX; this.point.y = MouseManager.instance.mouseY; //由点击的屏幕坐标产生射线 this.camera.viewportPointToRay(this.point, this.ray); //创建CannonHitResult对象来存储射线检...

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

2. 请问laya2.0 2d物理有射线检测功能吗 [ 99%]

...同来自: Smile~ // RayCast方法: // world.RayCast(callback:Function,point1:b2Vec2,point2:b2Vec2); // * callback 回调函数 // * point1 射线的起点 // * point2 射线的终点 // 回调函数: // function(fixture:b2Fixture,point:b2Vec2,normal:b2Vec2,fraction:Number):Number // * fixture ...

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

3. 基于Cannon.js的物理系统(ActionScript-3D基础(AS3)-LayaAir3D之物理系统) [ 99%]

... ```typescript mouseDown(){ //获取鼠标点击位置的屏幕坐标 this.point.x = MouseManager.instance.mouseX; this.point.y = MouseManager.instance.mouseY; //由点击的屏幕坐标产生射线 this.camera.viewportPointToRay(this.point, this.ray); //创建CannonHitResult对象来存储射线检...

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

4. 用raycast选取实体,hitresult始终是false [ 95%]

...件的核心代码就那么点:  //**** 监测鼠标点击碰撞 */ var point = new Laya.Vector2(); var ray: Laya.Ray = new Laya.Ray(new Laya.Vector3(2, 2, 2), new Laya.Vector3(3, 3, 3)); var outHitResult: Laya.HitResult = new Laya.HitResult(); point.x = Laya.MouseManager.instance.mouseX; point.y...

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

5. 使用localToGlobal方法获取list单元格错误不准确 [ 91%]

...box单元格是同一个 localToGlobal: function (ele, flag) {      var point = new laya.maths.Point(ele.pivotX, ele.pivotY);     // flag = flag ? true : false;     return ele.localToGlobal(point, flag);  }   console.log(box); var targetXY = Utils.localToGlobal(box, false);  console.log(...

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

6. localRotationEulerY旋转位置错误 [ 90%]

...void {         //创建盒型MeshSprite3D          let point = [{ x: 0, z: 0 }, { x: -2, z: 2 }];          var box = this.newScene.addChild(new Laya.MeshSprite3D(Laya.PrimitiveMesh.createBox(0.75, 0.5, 0.5))) as Laya.MeshSprite3D;         //...

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

7. 怎么计算两个点之间的距离 [ 87%]

...复 cuixueying 赞同来自: jinghuhuilai             var p1:Point = new Point(10,20);              var p2:Point = new Point(100,200);              var x:int = p1.x - p2.x;              var y:int = p1.y = p2.y;           ...

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

8. 发射射线检测不到,物体有包围盒 [ 87%]

..., 0, 0));               }      onMouseDown() {         this.point.x = Laya.stage.mouseX;         this.point.y = Laya.stage.mouseX;         //产生射线         this.camera.viewportPointToRay(this.point,this._ray);         //拿到射线碰撞的物体         thi...

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

9. Cannot read property 'rayCast' of undefined [ 86%]

...constructor(){ super(); this.rotation = new Laya.Vector3(0, 0.01, 0); this.point = new Laya.Vector2(); this.ray = new Laya.Ray(new Laya.Vector3(),new Laya.Vector3()); //1.开启第四个参数 let config3D = new Laya.Config3D(); config3D.isAlpha = true; Laya3D.init(0, 0, config3D); Laya.stage.scaleM...

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

10. 裁切图片后,该用什么方式去重绘出裁切后的图片 [ 85%]

...用Laya.Render.context中的方法去重绘,绘制部分代码如下(points,是我裁切后的多边形位置点数据): draw() {         const pp = this.owner.getComponent(Laya.PolygonCollider).points;         let points = this.pointS_to_pointA(pp)         let...

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