Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
物理文档更换图片 (#993)
Browse files Browse the repository at this point in the history
* fix: animator doc

* feat: 修复弹性骨骼demo

* feat: 更换最新版图片
  • Loading branch information
luzhuang authored Mar 19, 2024
1 parent 68b9f6e commit 1fede08
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions docs/physics-collider.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ label: Physics

首先需要考虑的是,碰撞器是静态的还是动态的,然后添加对应的碰撞器组件,静态碰撞器 StaticCollider 或者 动态 DynamicCollider

![buildBox](https://mdn.alipayobjects.com/huamei_vvspai/afts/img/A*ha7AS4lbXvsAAAAAAAAAAAAADsqFAQ/original)
![alt text](https://mdn.alipayobjects.com/huamei_3zduhr/afts/img/A*-E4USbdiH6sAAAAAAAAAAAAADsJ_AQ/original)

### 选择碰撞器的外形

Expand All @@ -39,20 +39,20 @@ label: Physics

在加入碰撞器组件后,不会默认添加碰撞器外形,因此需要点击 Add Item 进行添加,添加后会在视口中看到碰撞器的辅助渲染出现。

![buildBox2](https://mdn.alipayobjects.com/huamei_vvspai/afts/img/A*2iyJQYNc7ZQAAAAAAAAAAAAADsqFAQ/original)
![alt text](https://mdn.alipayobjects.com/huamei_3zduhr/afts/img/A*OUr-SIejEkoAAAAAAAAAAAAADsJ_AQ/original)

对于每一个碰撞器外形,都可以设计对应的一些大小属性。例如

<img src="https://mdn.alipayobjects.com/huamei_vvspai/afts/img/A*miQpS5GQ6x8AAAAAAAAAAAAADsqFAQ/original" alt="buildBox2" style="zoom:50%;" />
![alt text](https://mdn.alipayobjects.com/huamei_3zduhr/afts/img/A*d4MCRbuHeMsAAAAAAAAAAAAADsJ_AQ/original)

但无论那个碰撞器外形,都可以设置 Local Position,即相对于 Entity 坐标的局部偏移

![buildBox2](https://mdn.alipayobjects.com/huamei_vvspai/afts/img/A*_vceQ529MJIAAAAAAAAAAAAADsqFAQ/original)
![alt text](https://mdn.alipayobjects.com/huamei_3zduhr/afts/img/A*p8UcRJ9Q0EIAAAAAAAAAAAAADsJ_AQ/original)

### 动态碰撞器设置
和静态碰撞器不同,动态碰撞器会受到物理规律的作用,因此有许多附加的物理属性进行设置

<img src="https://mdn.alipayobjects.com/huamei_vvspai/afts/img/A*bUd8RIXCuXgAAAAAAAAAAAAADsqFAQ/original" alt="buildBox2" style="zoom:50%;" />
![alt text](https://mdn.alipayobjects.com/huamei_3zduhr/afts/img/A*7rzqSKtjULMAAAAAAAAAAAAADsJ_AQ/original)

在修改这些参数后,视口不会发生变化,因为动态碰撞器默认会受到重力的作用,因此需要在 Play 模式下才能进行观察。

Expand Down Expand Up @@ -89,4 +89,4 @@ label: Physics
2. [onCollisionStay](${docs}script#组件生命周期函数#oncollisionstay):碰撞过程中*循环*调用
3. [onCollisionExit](${docs}script#组件生命周期函数#oncollisionexit):碰撞结束时调用

<playground src="physx-compound.ts"></playground>
<playground src="physx-compound.ts"></playground>
3 changes: 2 additions & 1 deletion docs/physics-overall.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ label: Physics

开发者可以在 [主菜单](${docs}interface-menu) 界面打开的 **项目设置** 面板中设置物理后端。

<img src="https://mdn.alipayobjects.com/huamei_yo47yq/afts/img/A*4gzGTLID8a8AAAAAAAAAAAAADhuCAQ/original" style="zoom:50%;" />
![alt text](https://mdn.alipayobjects.com/huamei_3zduhr/afts/img/A*LO_FRIsaIzIAAAAAAAAAAAAADsJ_AQ/original)
![alt text](https://mdn.alipayobjects.com/huamei_3zduhr/afts/img/A*ZvWdQqEfIKoAAAAAAAAAAAAADsJ_AQ/original)

若通过脚本初始化引擎,只需要将物理后端对象传入 `Engine` 中即可:

Expand Down

0 comments on commit 1fede08

Please sign in to comment.