Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: update viewport doc #2264

Closed
wants to merge 4 commits into from
Closed

Feat: update viewport doc #2264

wants to merge 4 commits into from

Conversation

JujieX
Copy link
Member

@JujieX JujieX commented Jul 24, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

update viewport doc

Summary by CodeRabbit

  • Documentation
    • Enhanced clarity and usability of the particle rendering documentation with updated titles, simplified headings, and improved table formatting.
    • Improved organization and presentation of the interface hierarchy documentation through section reordering and refined table formatting.
    • Modernized interactive viewport documentation with updated images, clearer table structures, and new attributes for enhanced user experience.
    • Introduced a new particle system management module example with GUI controls for real-time adjustments to particle effects in a 3D environment.

@JujieX JujieX added the documentation Improvements or additions to documentation label Jul 24, 2024
@JujieX JujieX added this to the 1.3 milestone Jul 24, 2024
@JujieX JujieX requested a review from cptbtptpbcptdtptp July 24, 2024 10:07
@JujieX JujieX self-assigned this Jul 24, 2024
Copy link

coderabbitai bot commented Jul 24, 2024

Walkthrough

The documentation for various components of the Galacean Engine has been refined to enhance clarity and usability. Key adjustments include updated titles, improved table structures, and refreshed images. The overall organization has been streamlined, with modifications to section orders and formatting changes that facilitate better navigation and comprehension for users.

Changes

File Path Change Summary
docs/zh/graphics/particle/... Title adjusted for clarity; section headings simplified; image URLs updated; table formatting improved for readability.
docs/zh/interface/viewport.md Order updated; image URLs and table structures revised for toolbar icons and auxiliary settings; new attributes added to the preview section.
examples/particle-mainModule.ts New module introduced for particle system management; features real-time GUI control for particle properties in a 3D environment.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GUI
    participant ParticleSystem

    User->>GUI: Adjust particle properties
    GUI->>ParticleSystem: Update particle parameters
    ParticleSystem-->>GUI: Reflect changes in real-time
    GUI-->>User: Display updated particle effects
Loading

🐰 In the meadow where bunnies play,
Documentation grows brighter each day.
With tables refined and images anew,
Clarity leaps, like a rabbit so true!
Hopping through changes, oh what a delight,
Our engine's knowledge shines ever so bright! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d16d668 and 48ae402.

Files selected for processing (8)
  • docs/zh/graphics/particle/renderer.md (3 hunks)
  • docs/zh/interface/hierarchy.md (2 hunks)
  • docs/zh/interface/inspector.md (3 hunks)
  • docs/zh/interface/intro.md (1 hunks)
  • docs/zh/interface/menu.md (3 hunks)
  • docs/zh/interface/shortcut.md (1 hunks)
  • docs/zh/interface/template.md (1 hunks)
  • docs/zh/interface/viewport.md (3 hunks)
Files skipped from review due to trivial changes (2)
  • docs/zh/interface/inspector.md
  • docs/zh/interface/shortcut.md
Additional context used
Markdownlint
docs/zh/interface/template.md

9-9: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


11-11: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

docs/zh/interface/intro.md

32-32: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


33-33: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

docs/zh/interface/hierarchy.md

108-108: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

docs/zh/interface/viewport.md

51-51: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


56-56: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


100-100: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


51-51: Expected: 4; Actual: 3; Too few cells, row will be missing data
Table column count

(MD056, table-column-count)


52-52: Expected: 4; Actual: 3; Too few cells, row will be missing data
Table column count

(MD056, table-column-count)

LanguageTool
docs/zh/interface/menu.md

[uncategorized] ~34-~34: 数词与名词之间一般应存在量词,可能缺少量词。
Context: ...Snapshorts* 快照管理功能允许用户保存某个项目的快照到历史记录中,万一项目出现数据丢失等问题,可以通过 Revet 快速恢复到之前保存的某个快照。...

(wa5)

docs/zh/graphics/particle/renderer.md

[uncategorized] ~9-~9: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:常用"地"渲染
Context: ...nderer](${api}core/ParticleRenderer) 是常用的渲染组件,具备丰富的属性,通过调节各个属性值达到绚丽多彩的粒子效果。 ![av...

(wb4)

Additional comments not posted (18)
docs/zh/interface/menu.md (2)

2-2: Verify the change in the order attribute.

Ensure that changing the order attribute from 1 to 2 is intentional and does not affect the display order adversely.


20-20: Correct the typo in "Revet".

There is a typo in the word "Revet". It should be "Revert".

- 可以通过 **Revet** 快速恢复到之前保存的某个快照。
+ 可以通过 **Revert** 快速恢复到之前保存的某个快照。

Likely invalid or redundant comment.

docs/zh/graphics/particle/renderer.md (7)

3-3: Title change approved.

The new title "粒子" is more concise and still relevant to the content.


9-9: Introduction clarification approved.

The updated description "粒子(粒子渲染器)" clarifies the identity of the component while retaining the original meaning.

Tools
LanguageTool

[uncategorized] ~9-~9: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:常用"地"渲染
Context: ...nderer](${api}core/ParticleRenderer) 是常用的渲染组件,具备丰富的属性,通过调节各个属性值达到绚丽多彩的粒子效果。 ![av...

(wb4)


13-13: Section title simplification approved.

The simplified title "组件" enhances readability.


59-67: Table formatting improvement approved.

The new table structure is more concise and easier to understand.


88-94: Table formatting improvement approved.

The new table structure is more concise and easier to understand.


21-21: Verify the new image URL.

Ensure that the updated image URL is correct and relevant to the content.


11-11: Verify the new image URL.

Ensure that the updated image URL is correct and relevant to the content.

docs/zh/interface/hierarchy.md (2)

2-2: Order attribute change approved.

The order attribute change from 2 to 3 likely affects the display sequence of this section within a larger context.


106-113: Table formatting improvement approved.

The updated alignment syntax for the header row enhances the clarity of the table structure.

Tools
Markdownlint

108-108: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

docs/zh/interface/viewport.md (7)

2-2: Order attribute change approved.

The order attribute change from 5 to 6 likely affects the display sequence of this section within a larger context.


39-52: Table structure addition approved.

The new table structure for toolbar icons, names, explanations, and shortcuts enhances readability and user comprehension.

Tools
Markdownlint

51-51: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


51-51: Expected: 4; Actual: 3; Too few cells, row will be missing data
Table column count

(MD056, table-column-count)


52-52: Expected: 4; Actual: 3; Too few cells, row will be missing data
Table column count

(MD056, table-column-count)


74-83: Table structure addition approved.

The new table structure for auxiliary element settings provides a more structured overview of attributes and their descriptions.


89-100: Preview section update approved.

The updated preview section with new images and additional attributes related to the camera component enhances the document's clarity and usability.

Tools
Markdownlint

100-100: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


13-13: Verify the new image URL.

Ensure that the updated image URL is correct and relevant to the content.


37-37: Verify the new image URL.

Ensure that the updated image URL is correct and relevant to the content.


56-56: Verify the new image URL.

Ensure that the updated image URL is correct and relevant to the content.

Tools
Markdownlint

56-56: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


业务模版按照类型当前分为动画、特效、2D、3D、XR等大类。 <img src="https://mdn.alipayobjects.com/huamei_qbugvr/afts/img/A*snzhTYEfqDsAAAAAAAAAAAAADtKFAQ/original" style="zoom:50%;" />

点击模版,可以进行项目详情查看、项目预览、复刻项目到本地。 <img src="https://mdn.alipayobjects.com/huamei_qbugvr/afts/img/A*TnjmQql7xY0AAAAAAAAAAAAADtKFAQ/original" style="zoom:50%;" />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add alt text for the image.

Images should have alternate text (alt text) for better accessibility and SEO.

- 点击模版,可以进行项目详情查看、项目预览、复刻项目到本地。 <img src="https://mdn.alipayobjects.com/huamei_qbugvr/afts/img/A*TnjmQql7xY0AAAAAAAAAAAAADtKFAQ/original" style="zoom:50%;" />
+ 点击模版,可以进行项目详情查看、项目预览、复刻项目到本地。 <img src="https://mdn.alipayobjects.com/huamei_qbugvr/afts/img/A*TnjmQql7xY0AAAAAAAAAAAAADtKFAQ/original" alt="模版操作" style="zoom:50%;" />
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
点击模版,可以进行项目详情查看、项目预览、复刻项目到本地。 <img src="https://mdn.alipayobjects.com/huamei_qbugvr/afts/img/A*TnjmQql7xY0AAAAAAAAAAAAADtKFAQ/original" style="zoom:50%;" />
点击模版,可以进行项目详情查看、项目预览、复刻项目到本地。 <img src="https://mdn.alipayobjects.com/huamei_qbugvr/afts/img/A*TnjmQql7xY0AAAAAAAAAAAAADtKFAQ/original" alt="模版操作" style="zoom:50%;" />
Tools
Markdownlint

11-11: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

label: Basics/Interface
---

业务模版按照类型当前分为动画、特效、2D、3D、XR等大类。 <img src="https://mdn.alipayobjects.com/huamei_qbugvr/afts/img/A*snzhTYEfqDsAAAAAAAAAAAAADtKFAQ/original" style="zoom:50%;" />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add alt text for the image.

Images should have alternate text (alt text) for better accessibility and SEO.

- 业务模版按照类型当前分为动画、特效、2D、3D、XR等大类。 <img src="https://mdn.alipayobjects.com/huamei_qbugvr/afts/img/A*snzhTYEfqDsAAAAAAAAAAAAADtKFAQ/original" style="zoom:50%;" />
+ 业务模版按照类型当前分为动画、特效、2D、3D、XR等大类。 <img src="https://mdn.alipayobjects.com/huamei_qbugvr/afts/img/A*snzhTYEfqDsAAAAAAAAAAAAADtKFAQ/original" alt="业务模版分类" style="zoom:50%;" />
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
业务模版按照类型当前分为动画、特效、2D、3D、XR等大类。 <img src="https://mdn.alipayobjects.com/huamei_qbugvr/afts/img/A*snzhTYEfqDsAAAAAAAAAAAAADtKFAQ/original" style="zoom:50%;" />
业务模版按照类型当前分为动画、特效、2D、3D、XR等大类。 <img src="https://mdn.alipayobjects.com/huamei_qbugvr/afts/img/A*snzhTYEfqDsAAAAAAAAAAAAADtKFAQ/original" alt="业务模版分类" style="zoom:50%;" />
Tools
Markdownlint

9-9: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

| 5 | [主编辑区](/docs/interface-viewport) | 位于编辑器中间,是编辑器的主要操作区域,可以通过鼠标和键盘来编辑场景 |
| 6 | 工具栏 | 位于编辑器顶部,这里提供了一些快速的操作如切换 Gizmo 的模式、切换场景视角,相机配置等 |
| 7 | 相机预览区 | 位于主编辑区域的左下角,在这里可以以当前选中的相机为视角来预览场景 |
| 8 | [动画片段编辑](/docs/animation-clip) | 双击 AnimationClip 资产或点击**面板切换按钮** -> <img src="https://mdn.alipayobjects.com/huamei_yo47yq/afts/img/A*d5T9Tb852wQAAAAAAAAAAAAADhuCAQ/original" width="120" height="20">,在这里你可以对指定的 AnimationClip 资产进行编辑 |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add alt text for the image.

Images should have alternate text (alt text) for better accessibility and SEO.

- <img src="https://mdn.alipayobjects.com/huamei_yo47yq/afts/img/A*d5T9Tb852wQAAAAAAAAAAAAADhuCAQ/original" width="120" height="20">
+ <img src="https://mdn.alipayobjects.com/huamei_yo47yq/afts/img/A*d5T9Tb852wQAAAAAAAAAAAAADhuCAQ/original" alt="面板切换按钮" width="120" height="20">
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| 8 | [动画片段编辑](/docs/animation-clip) | 双击 AnimationClip 资产或点击**面板切换按钮** -> <img src="https://mdn.alipayobjects.com/huamei_yo47yq/afts/img/A*d5T9Tb852wQAAAAAAAAAAAAADhuCAQ/original" width="120" height="20">,在这里你可以对指定的 AnimationClip 资产进行编辑 |
| 8 | [动画片段编辑](/docs/animation-clip) | 双击 AnimationClip 资产或点击**面板切换按钮** -> <img src="https://mdn.alipayobjects.com/huamei_yo47yq/afts/img/A*d5T9Tb852wQAAAAAAAAAAAAADhuCAQ/original" alt="面板切换按钮" width="120" height="20">,在这里你可以对指定的 AnimationClip 资产进行编辑 |
Tools
Markdownlint

32-32: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

| 6 | 工具栏 | 位于编辑器顶部,这里提供了一些快速的操作如切换 Gizmo 的模式、切换场景视角,相机配置等 |
| 7 | 相机预览区 | 位于主编辑区域的左下角,在这里可以以当前选中的相机为视角来预览场景 |
| 8 | [动画片段编辑](/docs/animation-clip) | 双击 AnimationClip 资产或点击**面板切换按钮** -> <img src="https://mdn.alipayobjects.com/huamei_yo47yq/afts/img/A*d5T9Tb852wQAAAAAAAAAAAAADhuCAQ/original" width="120" height="20">,在这里你可以对指定的 AnimationClip 资产进行编辑 |
| 9 | [动画控制器编辑器](/docs/animation-animator) | 双击 AnimatorController 资产或点击**面板切换按钮** -> <img src="https://mdn.alipayobjects.com/huamei_yo47yq/afts/img/A*MRuqSJWALfYAAAAAAAAAAAAADhuCAQ/original" width="140" height="20">,在这里你可以对指定的 AnimationClip 资产进行编辑 |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add alt text for the image.

Images should have alternate text (alt text) for better accessibility and SEO.

- <img src="https://mdn.alipayobjects.com/huamei_yo47yq/afts/img/A*MRuqSJWALfYAAAAAAAAAAAAADhuCAQ/original" width="140" height="20">
+ <img src="https://mdn.alipayobjects.com/huamei_yo47yq/afts/img/A*MRuqSJWALfYAAAAAAAAAAAAADhuCAQ/original" alt="面板切换按钮" width="140" height="20">
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| 9 | [动画控制器编辑器](/docs/animation-animator) | 双击 AnimatorController 资产或点击**面板切换按钮** -> <img src="https://mdn.alipayobjects.com/huamei_yo47yq/afts/img/A*MRuqSJWALfYAAAAAAAAAAAAADhuCAQ/original" width="140" height="20">,在这里你可以对指定的 AnimationClip 资产进行编辑 |
| 9 | [动画控制器编辑器](/docs/animation-animator) | 双击 AnimatorController 资产或点击**面板切换按钮** -> <img src="https://mdn.alipayobjects.com/huamei_yo47yq/afts/img/A*MRuqSJWALfYAAAAAAAAAAAAADhuCAQ/original" alt="面板切换按钮" width="140" height="20">,在这里你可以对指定的 AnimationClip 资产进行编辑 |
Tools
Markdownlint

33-33: null
Images should have alternate text (alt text)

(MD045, no-alt-text)

| 停止 | 停止粒子效果的播放,并重置回初识状态 |
| 暂停 播放 | 暂停 / 开始播放粒子效果 | |
| 选中 / 全局 | 播放的是当前选中粒子,或者场景中全部粒子 |
| 包围盒 | 当前选中粒子的包围盒 |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

表格格式有问题

| 切换比例 | 切换不同设备、不同比例的窗口 |
| 锁定 | 锁定相机预览窗口 |

特别的,在层级树中带有相机组件的物体,能够通过直接同步视图的场景相机。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这句可以表达得更清楚一些。

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Outside diff range, codebase verification and nitpick comments (2)
examples/particle-mainModule.ts (2)

27-60: Consider adding type annotations for debugInfo.

Adding type annotations can improve readability and maintainability.

const debugInfo: {
  duration: number;
  isLoop: boolean;
  startDelay: number;
  startLifetime: number;
  speedMode: string;
  speedConstant: number;
  speedMin: number;
  speedMax: number;
  startSize3D: boolean;
  startSize: number;
  startSizeX: number;
  startSizeY: number;
  startSizeZ: number;
  startRotation3D: boolean;
  startRotation: number;
  startRotationX: number;
  startRotationY: number;
  startRotationZ: number;
  flipRotation: number;
  startColor: [number, number, number];
  gravityModifier: number;
  simulationSpace: string;
  simulationSpeed: number;
  scalingMode: string;
  playOnEnabled: boolean;
  maxParticles: number;
} = {
  duration: 5,
  isLoop: true,
  startDelay: 0,
  startLifetime: 5,
  speedMode: "constant",
  speedConstant: 5,
  speedMin: 0,
  speedMax: 5,
  startSize3D: false,
  startSize: 1,
  startSizeX: 1,
  startSizeY: 1,
  startSizeZ: 1,
  startRotation3D: false,
  startRotation: 0,
  startRotationX: 0,
  startRotationY: 0,
  startRotationZ: 0,
  flipRotation: 0,
  startColor: [255, 255, 255],
  gravityModifier: 0,
  simulationSpace: "Local",
  simulationSpeed: 1,
  scalingMode: "Local",
  playOnEnabled: true,
  maxParticles: 1000
};

249-259: Consider adding type annotations for LayerSetting.

Adding type annotations can improve readability and maintainability.

const LayerSetting: {
  Entity: number;
  NavigationGizmo: number;
  Gizmo: number;
} = {
  Entity: Layer.Layer22,
  NavigationGizmo: Layer.Layer30,
  Gizmo: Layer.Layer31
};
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 48ae402 and 6efe0cf.

Files selected for processing (4)
  • docs/zh/graphics/particle/renderer-main-module.md (1 hunks)
  • docs/zh/graphics/particle/renderer.md (3 hunks)
  • docs/zh/interface/viewport.md (3 hunks)
  • examples/particle-mainModule.ts (1 hunks)
Additional context used
LanguageTool
docs/zh/graphics/particle/renderer.md

[uncategorized] ~9-~9: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:常用"地"渲染
Context: ...nderer](${api}core/ParticleRenderer) 是常用的渲染组件,具备丰富的属性,通过调节各个属性值达到绚丽多彩的粒子效果。 ![av...

(wb4)

Markdownlint
docs/zh/interface/viewport.md

51-51: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


56-56: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


100-100: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


51-51: Expected: 4; Actual: 3; Too few cells, row will be missing data
Table column count

(MD056, table-column-count)


52-52: Expected: 4; Actual: 3; Too few cells, row will be missing data
Table column count

(MD056, table-column-count)

Additional comments not posted (14)
docs/zh/graphics/particle/renderer.md (5)

3-3: Title change approved.

The title has been appropriately updated to "粒子" to reflect a broader context.


9-9: Introduction update approved.

The introduction now describes the component as "粒子(粒子渲染器)", which clarifies its identity while retaining the original meaning.

Tools
LanguageTool

[uncategorized] ~9-~9: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:常用"地"渲染
Context: ...nderer](${api}core/ParticleRenderer) 是常用的渲染组件,具备丰富的属性,通过调节各个属性值达到绚丽多彩的粒子效果。 ![av...

(wb4)


13-13: Section heading update approved.

The section heading has been simplified to "组件", enhancing readability.


59-67: Table formatting update approved.

The table formatting has been improved for better clarity, enhancing user comprehension.


88-94: Table formatting update approved.

The table formatting has been altered for better clarity, enhancing the readability and usability of the documentation.

docs/zh/graphics/particle/renderer-main-module.md (1)

15-51: Narrative style update approved.

The shift from a tabular format to a more narrative style for property descriptions enhances clarity and provides practical insights into the functionalities of the particle generator.

docs/zh/interface/viewport.md (6)

2-2: Document order update approved.

The order of the document has been updated from 5 to 6, likely indicating a reorganization within a larger collection of documents.


13-13: Image URL update approved.

The image URL has been updated, likely reflecting improved visual representations of the viewport elements.


37-52: Toolbar icons table update approved.

The new table structure presenting toolbar icons, names, explanations, and shortcuts significantly improves readability and usability.

Tools
Markdownlint

51-51: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


51-51: Expected: 4; Actual: 3; Too few cells, row will be missing data
Table column count

(MD056, table-column-count)


52-52: Expected: 4; Actual: 3; Too few cells, row will be missing data
Table column count

(MD056, table-column-count)


56-68: Auxiliary element settings table update approved.

The new table structure provides a clearer overview of attributes and their descriptions.

Tools
Markdownlint

56-56: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


72-83: Scene camera settings table update approved.

The new table structure provides a clearer overview of attributes, their descriptions, and default values.


89-97: Preview attributes table update approved.

The new table structure provides a clearer overview of attributes and their descriptions.

examples/particle-mainModule.ts (2)

6-25: Ensure all imported modules are necessary.

Review the imports to ensure that each imported module is used in the code. Unused imports can be removed to improve readability and reduce potential maintenance overhead.

Verification successful

All imported modules are necessary and used.

The imports in examples/particle-mainModule.ts are correctly utilized in the code, ensuring clean and maintainable code.

  • @galacean/engine: All imported modules are used.
  • @galacean/engine-physics-lite: LitePhysics is used.
  • @galacean/engine-toolkit: All imported modules are used.
  • dat.GUI: dat.GUI is used.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of imported modules in the file.

# Test: Search for the usage of each imported module. Expect: Each module is used at least once.
rg --type typescript -A 5 $'import { $_ } from "@galacean/engine"'
rg --type typescript -A 5 $'import { $_ } from "@galacean/engine-physics-lite"'
rg --type typescript -A 5 $'import { $_ } from "@galacean/engine-toolkit"'
rg --type typescript -A 5 $'import * as dat from "dat.gui"'

Length of output: 728


Script:

#!/bin/bash
# Description: Verify the usage of imported modules in the file.

# Test: Search for the usage of each imported module. Expect: Each module is used at least once.
rg 'AssetType|BlendMode|Camera|Color|ConeShape|Logger|ParticleCurveMode|ParticleMaterial|ParticleRenderer|ParticleScaleMode|ParticleSimulationSpace|Vector3|WebGLEngine|MainModule|Layer' examples/particle-mainModule.ts
rg 'LitePhysics' examples/particle-mainModule.ts
rg 'Gizmo|GridControl|Group|State' examples/particle-mainModule.ts
rg 'dat.GUI' examples/particle-mainModule.ts

Length of output: 2399


62-246: Ensure proper handling of GUI control changes.

Verify that all GUI controls correctly update the corresponding particle system parameters.

Verification successful

Verification Successful: GUI controls correctly update particle system parameters.

The onChange handlers for the GUI controls in examples/particle-mainModule.ts are correctly updating the corresponding particle system parameters.

  • duration updates main.duration
  • isLoop updates main.isLoop
  • startDelay updates main.startDelay.constant
  • startLifetime updates main.startLifetime.constant
  • speedMode updates main.startSpeed.mode
  • speedMin updates main.startSpeed.constantMin
  • speedMax updates main.startSpeed.constantMax
  • speedConstant updates main.startSpeed.constant
  • startSize3D updates main.startSize3D
  • startSize updates main.startSize.constant
  • startSizeX updates main.startSizeX.constant
  • startSizeY updates main.startSizeY.constant
  • startSizeZ updates main.startSizeZ.constant
  • startRotation3D updates main.startRotation3D
  • startRotation updates main.startRotationZ.constant
  • startRotationX updates main.startRotationX.constant
  • startRotationY updates main.startRotationY.constant
  • startRotationZ updates main.startRotationZ.constant
  • flipRotation updates main.flipRotation
  • startColor updates main.startColor.constant
  • gravityModifier updates main.gravityModifier.constant
  • simulationSpace updates main.simulationSpace
  • simulationSpeed updates main.simulationSpeed
  • scalingMode updates main.scalingMode
  • playOnEnabled updates main.playOnEnabled
  • maxParticles updates main.maxParticles
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that all GUI controls correctly update the corresponding particle system parameters.

# Test: Search for the usage of each `debugInfo` property in the `onChange` handlers. Expect: Each property is correctly mapped.
rg --type typescript -A 5 $'gui.add(debugInfo, "duration", 0, 10, 1).onChange'
rg --type typescript -A 5 $'gui.add(debugInfo, "isLoop").onChange'
rg --type typescript -A 5 $'gui.add(debugInfo, "startDelay", 0, 50, 1).onChange'
rg --type typescript -A 5 $'gui.add(debugInfo, "startLifetime", 0, 50, 1).onChange'
rg --type typescript -A 5 $'particleSpeedFolder.add(debugInfo, "speedMode", ["constant", "two constants"]).onChange'
rg --type typescript -A 5 $'particleSpeedFolder.add(debugInfo, "speedMin", 0, 100).onChange'
rg --type typescript -A 5 $'particleSpeedFolder.add(debugInfo, "speedMax", 0, 100).onChange'
rg --type typescript -A 5 $'particleSpeedFolder.add(debugInfo, "speedConstant", 0, 100).onChange'
rg --type typescript -A 5 $'startSizeFolder.add(debugInfo, "startSize3D").onChange'
rg --type typescript -A 5 $'startSizeFolder.add(debugInfo, "startSize", 0, 10, 0.2).onChange'
rg --type typescript -A 5 $'startSizeFolder.add(debugInfo, "startSizeX", 0, 10, 0.2).onChange'
rg --type typescript -A 5 $'startSizeFolder.add(debugInfo, "startSizeY", 0, 10, 0.2).onChange'
rg --type typescript -A 5 $'startSizeFolder.add(debugInfo, "startSizeZ", 0, 10, 0.2).onChange'
rg --type typescript -A 5 $'startRotationFolder.add(debugInfo, "startRotation3D").onChange'
rg --type typescript -A 5 $'startRotationFolder.add(debugInfo, "startRotation", 0, 360).onChange'
rg --type typescript -A 5 $'startRotationFolder.add(debugInfo, "startRotationX", 0, 360).onChange'
rg --type typescript -A 5 $'startRotationFolder.add(debugInfo, "startRotationY", 0, 360).onChange'
rg --type typescript -A 5 $'startRotationFolder.add(debugInfo, "startRotationZ", 0, 360).onChange'
rg --type typescript -A 5 $'gui.add(debugInfo, "flipRotation", 0, 1, 0.05).onChange'
rg --type typescript -A 5 $'gui.addColor(debugInfo, "startColor").onChange'
rg --type typescript -A 5 $'gui.add(debugInfo, "gravityModifier", 0, 10, 0.1).onChange'
rg --type typescript -A 5 $'gui.add(debugInfo, "simulationSpace", ["World", "Local"]).onChange'
rg --type typescript -A 5 $'gui.add(debugInfo, "simulationSpeed", -5, 5, 0.2).onChange'
rg --type typescript -A 5 $'gui.add(debugInfo, "scalingMode", ["Local", "World", "Hierarchy"]).onChange'
rg --type typescript -A 5 $'gui.add(debugInfo, "playOnEnabled").onChange'
rg --type typescript -A 5 $'gui.add(debugInfo, "maxParticles", 0, 5000).onChange'

Length of output: 3291


Script:

#!/bin/bash
# Description: Verify that all GUI controls correctly update the corresponding particle system parameters.

# Test: Search for the usage of each `debugInfo` property in the `onChange` handlers. Expect: Each property is correctly mapped.
rg --glob '*.ts' -A 5 $'gui.add(debugInfo, "duration", 0, 10, 1).onChange'
rg --glob '*.ts' -A 5 $'gui.add(debugInfo, "isLoop").onChange'
rg --glob '*.ts' -A 5 $'gui.add(debugInfo, "startDelay", 0, 50, 1).onChange'
rg --glob '*.ts' -A 5 $'gui.add(debugInfo, "startLifetime", 0, 50, 1).onChange'
rg --glob '*.ts' -A 5 $'particleSpeedFolder.add(debugInfo, "speedMode", ["constant", "two constants"]).onChange'
rg --glob '*.ts' -A 5 $'particleSpeedFolder.add(debugInfo, "speedMin", 0, 100).onChange'
rg --glob '*.ts' -A 5 $'particleSpeedFolder.add(debugInfo, "speedMax", 0, 100).onChange'
rg --glob '*.ts' -A 5 $'particleSpeedFolder.add(debugInfo, "speedConstant", 0, 100).onChange'
rg --glob '*.ts' -A 5 $'startSizeFolder.add(debugInfo, "startSize3D").onChange'
rg --glob '*.ts' -A 5 $'startSizeFolder.add(debugInfo, "startSize", 0, 10, 0.2).onChange'
rg --glob '*.ts' -A 5 $'startSizeFolder.add(debugInfo, "startSizeX", 0, 10, 0.2).onChange'
rg --glob '*.ts' -A 5 $'startSizeFolder.add(debugInfo, "startSizeY", 0, 10, 0.2).onChange'
rg --glob '*.ts' -A 5 $'startSizeFolder.add(debugInfo, "startSizeZ", 0, 10, 0.2).onChange'
rg --glob '*.ts' -A 5 $'startRotationFolder.add(debugInfo, "startRotation3D").onChange'
rg --glob '*.ts' -A 5 $'startRotationFolder.add(debugInfo, "startRotation", 0, 360).onChange'
rg --glob '*.ts' -A 5 $'startRotationFolder.add(debugInfo, "startRotationX", 0, 360).onChange'
rg --glob '*.ts' -A 5 $'startRotationFolder.add(debugInfo, "startRotationY", 0, 360).onChange'
rg --glob '*.ts' -A 5 $'startRotationFolder.add(debugInfo, "startRotationZ", 0, 360).onChange'
rg --glob '*.ts' -A 5 $'gui.add(debugInfo, "flipRotation", 0, 1, 0.05).onChange'
rg --glob '*.ts' -A 5 $'gui.addColor(debugInfo, "startColor").onChange'
rg --glob '*.ts' -A 5 $'gui.add(debugInfo, "gravityModifier", 0, 10, 0.1).onChange'
rg --glob '*.ts' -A 5 $'gui.add(debugInfo, "simulationSpace", ["World", "Local"]).onChange'
rg --glob '*.ts' -A 5 $'gui.add(debugInfo, "simulationSpeed", -5, 5, 0.2).onChange'
rg --glob '*.ts' -A 5 $'gui.add(debugInfo, "scalingMode", ["Local", "World", "Hierarchy"]).onChange'
rg --glob '*.ts' -A 5 $'gui.add(debugInfo, "playOnEnabled").onChange'
rg --glob '*.ts' -A 5 $'gui.add(debugInfo, "maxParticles", 0, 5000).onChange'

Length of output: 2277


Script:

#!/bin/bash
# Description: Verify that all GUI controls correctly update the corresponding particle system parameters.

# Test: Search for the usage of `onChange` handlers in the TypeScript files to ensure they are correctly updating the particle system parameters.
rg --glob '*.ts' -A 5 'onChange'

Length of output: 64845

Comment on lines +260 to +315
Logger.enable();
engine.canvas.resizeByClientSize();

engine.canvas.resizeByClientSize();
const scene = engine.sceneManager.activeScene;

const ambientLight = scene.ambientLight;
ambientLight.diffuseSolidColor.set(0.8, 0.8, 1, 1);
ambientLight.diffuseIntensity = 0.5;

const rootEntity = scene.createRootEntity();
scene.background.solidColor = new Color(25 / 255, 25 / 255, 112 / 255, 1);

// Create camera
const cameraEntity = rootEntity.createChild("camera_entity");
cameraEntity.transform.position = new Vector3(0, 10, 30);
const camera = cameraEntity.addComponent(Camera);
camera.fieldOfView = 60;

const grid = rootEntity.addComponent(GridControl);
grid.camera = camera;
grid.distance = 2;

const controlEntity = rootEntity.createChild("control");
const gizmoEntity = controlEntity.createChild("gizmo");
const gizmo = gizmoEntity.addComponent(Gizmo);
const group = new Group();
gizmo.init(camera, group);
gizmo.state = State.all;

engine.resourceManager
.load({
url: "https://mdn.alipayobjects.com/huamei_b4l2if/afts/img/A*JPsCSK5LtYkAAAAAAAAAAAAADil6AQ/original",
type: AssetType.Texture2D
})
.then((texture) => {
const particleEntity = rootEntity.createChild("Fire");
particleEntity.layer = LayerSetting.Entity;
group.addEntity(particleEntity);

particleEntity.transform.rotate(90, 0, 0);
const particleRenderer = particleEntity.addComponent(ParticleRenderer);

const material = new ParticleMaterial(engine);
material.baseColor = new Color(1.0, 1.0, 1.0, 1.0);
material.blendMode = BlendMode.Additive;
material.baseTexture = texture;
particleRenderer.setMaterial(material);

particleRenderer.generator.emission.shape = new ConeShape();

initGUI(particleRenderer.generator.main);
});

engine.run();
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid duplicate canvas resizing.

The canvas is resized twice, which is redundant. Remove the duplicate call to engine.canvas.resizeByClientSize().

-  engine.canvas.resizeByClientSize();
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Logger.enable();
engine.canvas.resizeByClientSize();
engine.canvas.resizeByClientSize();
const scene = engine.sceneManager.activeScene;
const ambientLight = scene.ambientLight;
ambientLight.diffuseSolidColor.set(0.8, 0.8, 1, 1);
ambientLight.diffuseIntensity = 0.5;
const rootEntity = scene.createRootEntity();
scene.background.solidColor = new Color(25 / 255, 25 / 255, 112 / 255, 1);
// Create camera
const cameraEntity = rootEntity.createChild("camera_entity");
cameraEntity.transform.position = new Vector3(0, 10, 30);
const camera = cameraEntity.addComponent(Camera);
camera.fieldOfView = 60;
const grid = rootEntity.addComponent(GridControl);
grid.camera = camera;
grid.distance = 2;
const controlEntity = rootEntity.createChild("control");
const gizmoEntity = controlEntity.createChild("gizmo");
const gizmo = gizmoEntity.addComponent(Gizmo);
const group = new Group();
gizmo.init(camera, group);
gizmo.state = State.all;
engine.resourceManager
.load({
url: "https://mdn.alipayobjects.com/huamei_b4l2if/afts/img/A*JPsCSK5LtYkAAAAAAAAAAAAADil6AQ/original",
type: AssetType.Texture2D
})
.then((texture) => {
const particleEntity = rootEntity.createChild("Fire");
particleEntity.layer = LayerSetting.Entity;
group.addEntity(particleEntity);
particleEntity.transform.rotate(90, 0, 0);
const particleRenderer = particleEntity.addComponent(ParticleRenderer);
const material = new ParticleMaterial(engine);
material.baseColor = new Color(1.0, 1.0, 1.0, 1.0);
material.blendMode = BlendMode.Additive;
material.baseTexture = texture;
particleRenderer.setMaterial(material);
particleRenderer.generator.emission.shape = new ConeShape();
initGUI(particleRenderer.generator.main);
});
engine.run();
});
Logger.enable();
engine.canvas.resizeByClientSize();
const scene = engine.sceneManager.activeScene;
const ambientLight = scene.ambientLight;
ambientLight.diffuseSolidColor.set(0.8, 0.8, 1, 1);
ambientLight.diffuseIntensity = 0.5;
const rootEntity = scene.createRootEntity();
scene.background.solidColor = new Color(25 / 255, 25 / 255, 112 / 255, 1);
// Create camera
const cameraEntity = rootEntity.createChild("camera_entity");
cameraEntity.transform.position = new Vector3(0, 10, 30);
const camera = cameraEntity.addComponent(Camera);
camera.fieldOfView = 60;
const grid = rootEntity.addComponent(GridControl);
grid.camera = camera;
grid.distance = 2;
const controlEntity = rootEntity.createChild("control");
const gizmoEntity = controlEntity.createChild("gizmo");
const gizmo = gizmoEntity.addComponent(Gizmo);
const group = new Group();
gizmo.init(camera, group);
gizmo.state = State.all;
engine.resourceManager
.load({
url: "https://mdn.alipayobjects.com/huamei_b4l2if/afts/img/A*JPsCSK5LtYkAAAAAAAAAAAAADil6AQ/original",
type: AssetType.Texture2D
})
.then((texture) => {
const particleEntity = rootEntity.createChild("Fire");
particleEntity.layer = LayerSetting.Entity;
group.addEntity(particleEntity);
particleEntity.transform.rotate(90, 0, 0);
const particleRenderer = particleEntity.addComponent(ParticleRenderer);
const material = new ParticleMaterial(engine);
material.baseColor = new Color(1.0, 1.0, 1.0, 1.0);
material.blendMode = BlendMode.Additive;
material.baseTexture = texture;
particleRenderer.setMaterial(material);
particleRenderer.generator.emission.shape = new ConeShape();
initGUI(particleRenderer.generator.main);
});
engine.run();
});

Copy link
Collaborator

@cptbtptpbcptdtptp cptbtptpbcptdtptp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@JujieX
Copy link
Member Author

JujieX commented Aug 1, 2024

in #2283

@JujieX JujieX closed this Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants