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

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

11. 实体组件系统 · LayaAir3.3 · 引擎文档 · LAYABOX [ 71%]

...s.owner.getComponent(Laya.RigidBody); rig.setVelocity({ x: 0, y: -10 }); } onTriggerEnter(other: any, self: any, contact: any): void { //如果被碰到,则移除子弹 this.owner.removeSelf(); } onUpdate(): void { //如果子弹超出屏幕,则移除子弹 if ((this.owner as Laya.Sprite).y <...

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

12. laya2.3 物理系统 怎么获取两个Box的碰撞点 [ 68%]

laya2.3 物理系统 怎么获取两个Box的碰撞点 onTriggerEnter 中的 contact中有个参数m_manifold.localPoint 不知道是不是碰撞点,但是用self.owner.localToGlobal转换之后,位置并不是碰撞点的位置。。那这个碰撞检测 到底哪个参数才是碰撞点 图...

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

13. 3D 触发器如何获取碰撞位置 [ 68%]

...ite3D; let position = obj.contacts[0].positionOnA; // 碰撞位置 }     onTriggerEnter(obj) 、、如何获取碰撞位置? 2020-04-08 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链接 提交 1 个回复 一&漠 赞同来自: ...

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

14. 2D物理-碰撞事件与传感器 [ 63%]

...; sp.addComponent(MouseJoint); } ground.on(Event.TRIGGER_ENTER, this, this.onTriggerEnter); ground.on(Event.TRIGGER_EXIT, this, this.onTriggerExit); Laya.physicsTimer.frameLoop(1, this, this.onTriggerStay); } private function onTriggerEnter(colliderB: ColliderBase, colliderA: ColliderBase, contact) ...

来源: Laya2.0_示例 发布时间: 20260106

15. 2d物理引擎onTriggerStay不执行的bug [ 62%]

... 0 1 分享 微博 QZONE 微信 kylin 赞同来自: 1) 一般而言,有 onTriggerEnter 和 onTriggerExit 已经足够了,onTriggerStay 只是预留了接口,并没有真的去实现。 2) onTriggerStay 每帧都会触发,在里面写逻辑特别消耗性能,并不建议使用 3) 我基...

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

16. box2d动态创建绑定多个关节报错 Node:the component is singleton,can't add the second one. [ 60%]

...stanceJoint 与多个不同rigBody做距离关系绑定 代码片段:  onTriggerEnter(other: any, self: any, contact: any) {  let pointes = contact.getHitInfo().points;  let potSelf = new Laya.Point(pointes[0].x, pointes[0].y); let potOther = new Laya.Point(pointes[0].x, pointes[0].y); self.ow...

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

17. 预制体添加刚体后,和其它刚体碰撞后不能修改角度和位置 [ 58%]

...体添加刚体后,和其它刚体碰撞后不能修改角度和位置  onTriggerEnter(other,self,contact)     {         var n=this.owner.rotation;         if(other.label === "heng"){             console.log("角度"+this.owner.rotation);            ...

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

18. RopeJoint代码动态创建 无法设置otherbody [ 58%]

...is.rope.otherBody);     }     onEnable() {             }      onTriggerEnter(other: any, self: any, contact: any): void {     //搜索黏贴在圆环上     } onUpdate(): void {     }  onDisable(): void {     Laya.Pool.recover("friut",this.owner); } } 附件 : --> FruitMaster.z...

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

19. Laya2.6.0beta 物理引擎 刚体碰撞点位置获取不正确 [ 57%]

...取不正确 使用Laya2.6.0beta的官方物理引擎事例, 在DropBox的onTriggerEnter()方法中, 使用contact参数, 分别在小球与方块时, 小球与地板碰撞时, 获取碰撞点坐标位置并添加小黄点标记 : 小球与地板碰撞点的坐标位置正确; 小球与方块碰撞...

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

20. box2d 弹性异常 [ 52%]

...角度并不是特别小. a11a • 2020-03-09 14:18 你在FlyItem里添加 onTriggerEnter(other: any, self: any, contact: any): void { let rig: Laya.RigidBody = this.owner.getComponent(Laya.RigidBody) as Laya.RigidBody; let velocity = rig.linearVelocity; console.log(velocity) } 你把初始弹射改...

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