-
-
Notifications
You must be signed in to change notification settings - Fork 310
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
Conversation
WalkthroughThe 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
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
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this 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
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 theorder
attribute.Ensure that changing the
order
attribute from1
to2
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 from2
to3
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 from5
to6
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%;" /> |
There was a problem hiding this comment.
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.
点击模版,可以进行项目详情查看、项目预览、复刻项目到本地。 <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%;" /> |
There was a problem hiding this comment.
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.
业务模版按照类型当前分为动画、特效、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 资产进行编辑 | |
There was a problem hiding this comment.
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.
| 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 资产进行编辑 | |
There was a problem hiding this comment.
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.
| 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)
| 停止 | 停止粒子效果的播放,并重置回初识状态 | | ||
| 暂停 播放 | 暂停 / 开始播放粒子效果 | | | ||
| 选中 / 全局 | 播放的是当前选中粒子,或者场景中全部粒子 | | ||
| 包围盒 | 当前选中粒子的包围盒 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
表格格式有问题
docs/zh/interface/viewport.md
Outdated
| 切换比例 | 切换不同设备、不同比例的窗口 | | ||
| 锁定 | 锁定相机预览窗口 | | ||
|
||
特别的,在层级树中带有相机组件的物体,能够通过直接同步视图的场景相机。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这句可以表达得更清楚一些。
There was a problem hiding this 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 fordebugInfo
.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 forLayerSetting
.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
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.tsLength 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 inexamples/particle-mainModule.ts
are correctly updating the corresponding particle system parameters.
duration
updatesmain.duration
isLoop
updatesmain.isLoop
startDelay
updatesmain.startDelay.constant
startLifetime
updatesmain.startLifetime.constant
speedMode
updatesmain.startSpeed.mode
speedMin
updatesmain.startSpeed.constantMin
speedMax
updatesmain.startSpeed.constantMax
speedConstant
updatesmain.startSpeed.constant
startSize3D
updatesmain.startSize3D
startSize
updatesmain.startSize.constant
startSizeX
updatesmain.startSizeX.constant
startSizeY
updatesmain.startSizeY.constant
startSizeZ
updatesmain.startSizeZ.constant
startRotation3D
updatesmain.startRotation3D
startRotation
updatesmain.startRotationZ.constant
startRotationX
updatesmain.startRotationX.constant
startRotationY
updatesmain.startRotationY.constant
startRotationZ
updatesmain.startRotationZ.constant
flipRotation
updatesmain.flipRotation
startColor
updatesmain.startColor.constant
gravityModifier
updatesmain.gravityModifier.constant
simulationSpace
updatesmain.simulationSpace
simulationSpeed
updatesmain.simulationSpeed
scalingMode
updatesmain.scalingMode
playOnEnabled
updatesmain.playOnEnabled
maxParticles
updatesmain.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
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(); | ||
}); |
There was a problem hiding this comment.
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.
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(); | |
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
in #2283 |
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
update viewport doc
Summary by CodeRabbit