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

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

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

...ouching[i]) { continue; } let bodyA: RigidBody = this.sensorCollider.owner.getComponent(RigidBody); let bodyB: RigidBody = body.owner.getComponent(RigidBody); let bodyOriA = bodyA.getBody(); let bodyOriB = bodyB.getBody(); let position = bodyOriB.GetPosition(); // let center = bodyOriA.GetPosition()...

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

2. 2D物理-碰撞过滤器 [ 92%]

...on(Event.MOUSE_OUT, this, this.mouseUp); // let rigidbody = this.curTarget.getComponent(RigidBody); // rigidbody.type = "kinematic"; } mouseMove(e) { let movementX = e.nativeEvent.movementX; let movementY = e.nativeEvent.movementY; this.preMovementX = movementX; this.preMovementY = movementY; this.c...

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

3. 2D物理-仿生机器人 [ 68%]

....stage.on(Laya.Event.CLICK, this, () => { const chassisBody = this.chassis.getComponent(Laya.RigidBody); const chassisPos = chassisBody.getBody().GetPosition(); let newBall = new Laya.Sprite(); Laya.Laya.stage.addChild(newBall); let circleBody = newBall.addComponent(Laya.RigidBody); let circleCollid...

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