Skip to content

rename limit/limitX/Y/Z to speed/speedX/Y/Z in LimitVelocit…#2928

Merged
cptbtptpbcptdtptp merged 8 commits intogalacean:dev/2.0from
hhhhkrx:fix/limitAPI
Mar 19, 2026
Merged

rename limit/limitX/Y/Z to speed/speedX/Y/Z in LimitVelocit…#2928
cptbtptpbcptdtptp merged 8 commits intogalacean:dev/2.0from
hhhhkrx:fix/limitAPI

Conversation

@hhhhkrx
Copy link
Copy Markdown
Contributor

@hhhhkrx hhhhkrx commented Mar 19, 2026

…yOverLifetimeModule

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, ...)

What is the current behavior? (You can also link to an open issue here)

What is the new behavior (if this is a feature change)?

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

Other information:

Summary by CodeRabbit

  • Refactor

    • Renamed velocity-limit properties from limit/limitX/limitY/limitZ to speed/speedX/speedY/speedZ (API access updated).
    • Default damping for velocity limiting changed from 1 to 0 (affects how velocity is reduced while limiter is active).
  • Documentation

    • Clarified that the space setting only applies when axis separation is enabled.
  • Tests

    • Updated tests to exercise the renamed speed APIs.

@hhhhkrx hhhhkrx self-assigned this Mar 19, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 19, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Public API renamed from limit/limitX/limitY/limitZ to speed/speedX/speedY/speedZ. Internal shader macro/property identifiers and private fields were updated accordingly. Default dampen value changed from 1 to 0. Tests and an e2e case were updated to match the renames.

Changes

Cohort / File(s) Summary
Core Module Implementation
packages/core/src/particle/modules/LimitVelocityOverLifetimeModule.ts
Replaced limit* API with speed* API (renamed getters/setters, backing fields, helper methods, and shader macro/property identifiers). Updated constructor defaults and changed default _dampen from 1 to 0. Clarified space docstring to apply only when separateAxes is enabled.
Test Suite
tests/src/core/particle/LimitVelocityOverLifetime.test.ts
Updated tests to use speed/speedX/speedY/speedZ in setup, alias checks, axis-specific assignments, curve-mode/random-mode assertions, and shader-update expectations.
E2E Test Case
e2e/case/particleRenderer-limitVelocity.ts
Particle generator configuration switched from limitX/limitY/limitZ to speedX/speedY/speedZ; other limit-velocity settings unchanged.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I hopped through fields of code and speed,

Swapped names and nudged a dampen seed,
Curves stayed steady, axes aligned,
Shader whispers, fields re-defined,
A joyful rabbit bounds — particles freed 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: renaming API properties from limit/limitX/Y/Z to speed/speedX/Y/Z in the LimitVelocityOverLifetimeModule, which is the primary focus across all modified files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/src/core/particle/LimitVelocityOverLifetime.test.ts (1)

95-108: ⚠️ Potential issue | 🟡 Minor

Test description references old API names.

The test description says "limitX/Y/Z properties" but should say "speedX/Y/Z properties" to match the renamed API.

📝 Suggested fix
-  it("limitX/Y/Z properties", function () {
+  it("speedX/Y/Z properties", function () {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/src/core/particle/LimitVelocityOverLifetime.test.ts` around lines 95 -
108, Update the test description string to reflect the renamed API: change the
it() description from "limitX/Y/Z properties" to "speedX/Y/Z properties" in the
test that exercises particleRenderer.generator.limitVelocityOverLifetime and its
speedX, speedY, speedZ property assignments so the human-readable test name
matches the actual API being tested.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tests/src/core/particle/LimitVelocityOverLifetime.test.ts`:
- Around line 87-93: Update the test description string to reflect the renamed
API: change the "limit property (alias for limitX)" description to "speed
property (alias for speedX)" in the test that accesses
particleRenderer.generator.limitVelocityOverLifetime and asserts on lvl.speed
and lvl.speedX (using ParticleCompositeCurve in that test) so the description
matches the actual assertions and API names.

---

Outside diff comments:
In `@tests/src/core/particle/LimitVelocityOverLifetime.test.ts`:
- Around line 95-108: Update the test description string to reflect the renamed
API: change the it() description from "limitX/Y/Z properties" to "speedX/Y/Z
properties" in the test that exercises
particleRenderer.generator.limitVelocityOverLifetime and its speedX, speedY,
speedZ property assignments so the human-readable test name matches the actual
API being tested.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 72394700-f33f-4241-a90b-72043c1604a3

📥 Commits

Reviewing files that changed from the base of the PR and between d61eb76 and 8795f98.

📒 Files selected for processing (3)
  • e2e/case/particleRenderer-limitVelocity.ts
  • packages/core/src/particle/modules/LimitVelocityOverLifetimeModule.ts
  • tests/src/core/particle/LimitVelocityOverLifetime.test.ts

Comment thread tests/src/core/particle/LimitVelocityOverLifetime.test.ts Outdated
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Mar 19, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 68.64407% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.44%. Comparing base (d61eb76) to head (27682df).
⚠️ Report is 1 commits behind head on dev/2.0.

Files with missing lines Patch % Lines
...article/modules/LimitVelocityOverLifetimeModule.ts 71.68% 32 Missing ⚠️
e2e/case/particleRenderer-limitVelocity.ts 0.00% 3 Missing ⚠️
packages/core/src/particle/ParticleGenerator.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           dev/2.0    #2928   +/-   ##
========================================
  Coverage    77.43%   77.44%           
========================================
  Files          896      896           
  Lines        98245    98246    +1     
  Branches      9685     9686    +1     
========================================
+ Hits         76080    76088    +8     
+ Misses       21999    21993    -6     
+ Partials       166      165    -1     
Flag Coverage Δ
unittests 77.44% <68.64%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown

@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: 2

🧹 Nitpick comments (1)
packages/core/src/particle/modules/LimitVelocityOverLifetimeModule.ts (1)

103-154: Consider keeping deprecated limit* aliases for compatibility

The rename to speed* is clear, but removing limit, limitX, limitY, limitZ outright can break existing integrations immediately. Adding deprecated alias accessors would make migration safer.

Compatibility shim example
+  /** `@deprecated` Use `speed` instead. */
+  get limit(): ParticleCompositeCurve {
+    return this.speed;
+  }
+  /** `@deprecated` Use `speed` instead. */
+  set limit(value: ParticleCompositeCurve) {
+    this.speed = value;
+  }
+
+  /** `@deprecated` Use `speedX` instead. */
+  get limitX(): ParticleCompositeCurve {
+    return this.speedX;
+  }
+  /** `@deprecated` Use `speedX` instead. */
+  set limitX(value: ParticleCompositeCurve) {
+    this.speedX = value;
+  }
+
+  /** `@deprecated` Use `speedY` instead. */
+  get limitY(): ParticleCompositeCurve {
+    return this.speedY;
+  }
+  /** `@deprecated` Use `speedY` instead. */
+  set limitY(value: ParticleCompositeCurve) {
+    this.speedY = value;
+  }
+
+  /** `@deprecated` Use `speedZ` instead. */
+  get limitZ(): ParticleCompositeCurve {
+    return this.speedZ;
+  }
+  /** `@deprecated` Use `speedZ` instead. */
+  set limitZ(value: ParticleCompositeCurve) {
+    this.speedZ = value;
+  }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/core/src/particle/modules/LimitVelocityOverLifetimeModule.ts` around
lines 103 - 154, Add deprecated alias accessors named limit, limitX, limitY, and
limitZ that forward to the new speed, speedX, speedY, and speedZ getters/setters
so existing code keeps working; implement each getter to return the
corresponding _limitX/_limitY/_limitZ (or speed getter for overall) and each
setter to delegate to the corresponding speed setter (or set
_limitX/_limitY/_limitZ and call _onCompositeCurveChange(lastValue, value)
exactly as the speedX/speedY/speedZ setters do), and annotate them with a JSDoc
`@deprecated` note so consumers see the migration guidance while preserving
identical behavior using the same underlying fields (_limitX/_limitY/_limitZ)
and _onCompositeCurveChange.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/core/src/particle/modules/LimitVelocityOverLifetimeModule.ts`:
- Around line 215-218: The doc comment for the space property in
LimitVelocityOverLifetimeModule is inaccurate; update the remark to reflect that
space is uploaded and applied for both scalar and separate-axes modes rather
than only when separateAxes is enabled. Edit the JSDoc for the space
field/property (and any related comment block in the
LimitVelocityOverLifetimeModule class) to remove or reword the "Only takes
effect when 'separateAxes' is enabled" phrase and instead state that space
controls whether limits are in local or world space and is honored in both
scalar and separateAxes code paths where the property is uploaded and used.
- Line 79: The change to the private field _dampen in
LimitVelocityOverLifetimeModule changed the default from full damping to zero,
which silently alters runtime behavior; revert the default back to the original
(full damping) value by setting _dampen to the previous default (e.g., 1) in the
LimitVelocityOverLifetimeModule declaration and ensure any related
comments/tests reflect that default so the shader's effectiveDampen produces the
intended clamping behavior.

---

Nitpick comments:
In `@packages/core/src/particle/modules/LimitVelocityOverLifetimeModule.ts`:
- Around line 103-154: Add deprecated alias accessors named limit, limitX,
limitY, and limitZ that forward to the new speed, speedX, speedY, and speedZ
getters/setters so existing code keeps working; implement each getter to return
the corresponding _limitX/_limitY/_limitZ (or speed getter for overall) and each
setter to delegate to the corresponding speed setter (or set
_limitX/_limitY/_limitZ and call _onCompositeCurveChange(lastValue, value)
exactly as the speedX/speedY/speedZ setters do), and annotate them with a JSDoc
`@deprecated` note so consumers see the migration guidance while preserving
identical behavior using the same underlying fields (_limitX/_limitY/_limitZ)
and _onCompositeCurveChange.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0f9e991f-f903-4700-9aaf-547b0e1fa264

📥 Commits

Reviewing files that changed from the base of the PR and between 8795f98 and ad72a64.

📒 Files selected for processing (3)
  • e2e/case/particleRenderer-limitVelocity.ts
  • packages/core/src/particle/modules/LimitVelocityOverLifetimeModule.ts
  • tests/src/core/particle/LimitVelocityOverLifetime.test.ts
✅ Files skipped from review due to trivial changes (1)
  • e2e/case/particleRenderer-limitVelocity.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/src/core/particle/LimitVelocityOverLifetime.test.ts

@deepClone
private _limitZ: ParticleCompositeCurve;
private _dampen: number = 1;
private _dampen: number = 0;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Default dampen change silently alters module behavior

Line 79 changes the default from full damping to no damping. With the current shader formula, dampen = 0 yields effectiveDampen = 0, so excess velocity is never reduced by default. This is a functional behavior change, not just a rename.

Proposed fix
-  private _dampen: number = 0;
+  private _dampen: number = 1;
📝 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
private _dampen: number = 0;
private _dampen: number = 1;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/core/src/particle/modules/LimitVelocityOverLifetimeModule.ts` at
line 79, The change to the private field _dampen in
LimitVelocityOverLifetimeModule changed the default from full damping to zero,
which silently alters runtime behavior; revert the default back to the original
(full damping) value by setting _dampen to the previous default (e.g., 1) in the
LimitVelocityOverLifetimeModule declaration and ensure any related
comments/tests reflect that default so the shader's effectiveDampen produces the
intended clamping behavior.

Comment on lines 215 to 218
/**
* Specifies if the velocity limits are in local space or world space.
* @remarks Only takes effect when 'separateAxes' is enabled.
*/
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

space remark is inaccurate

Line 217 says space only works when separateAxes is enabled, but space is uploaded and used in both scalar and separate-axes paths. This doc can mislead users.

Proposed doc fix
   /**
    * Specifies if the velocity limits are in local space or world space.
-   * `@remarks` Only takes effect when 'separateAxes' is enabled.
+   * `@remarks` Applies whether `separateAxes` is enabled or not.
    */
📝 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
/**
* Specifies if the velocity limits are in local space or world space.
* @remarks Only takes effect when 'separateAxes' is enabled.
*/
/**
* Specifies if the velocity limits are in local space or world space.
* `@remarks` Applies whether `separateAxes` is enabled or not.
*/
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/core/src/particle/modules/LimitVelocityOverLifetimeModule.ts` around
lines 215 - 218, The doc comment for the space property in
LimitVelocityOverLifetimeModule is inaccurate; update the remark to reflect that
space is uploaded and applied for both scalar and separate-axes modes rather
than only when separateAxes is enabled. Edit the JSDoc for the space
field/property (and any related comment block in the
LimitVelocityOverLifetimeModule class) to remove or reword the "Only takes
effect when 'separateAxes' is enabled" phrase and instead state that space
controls whether limits are in local or world space and is honored in both
scalar and separateAxes code paths where the property is uploaded and used.

Copy link
Copy Markdown

@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.

♻️ Duplicate comments (2)
packages/core/src/particle/modules/LimitVelocityOverLifetimeModule.ts (2)

79-79: ⚠️ Potential issue | 🟠 Major

Default _dampen change from 1 to 0 alters runtime behavior.

This changes the default behavior from full damping to no damping. Per the comment on line 158, "0 means no damping, 1 means full damping." This is a functional breaking change, not just a rename. If intentional, it should be documented as a breaking change; otherwise, revert to 1.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/core/src/particle/modules/LimitVelocityOverLifetimeModule.ts` at
line 79, The default value for the private property _dampen in
LimitVelocityOverLifetimeModule was changed from 1 to 0 which breaks existing
behavior (0 = no damping, 1 = full damping); revert the default back to 1 on the
_dampen declaration in the LimitVelocityOverLifetimeModule class (or, if the
change is intentional, update the module's public docs and changelog to declare
this breaking change) so runtime behavior remains consistent.

215-218: ⚠️ Potential issue | 🟡 Minor

Documentation for space property is inaccurate.

Line 217 states that space "Only takes effect when 'separateAxes' is enabled," but looking at _updateShaderData() (line 299), space is uploaded unconditionally when the module is enabled, regardless of separateAxes state.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/core/src/particle/modules/LimitVelocityOverLifetimeModule.ts` around
lines 215 - 218, The doc comment for the `space` property in
LimitVelocityOverLifetimeModule is incorrect about it only taking effect when
`separateAxes` is enabled; update the comment to accurately reflect that `space`
is used whenever the module is enabled (see `_updateShaderData()` which uploads
`space` unconditionally), or alternatively change `_updateShaderData()` to only
upload/apply `space` when `separateAxes` is true—use the `space` property name
and `_updateShaderData()` as references when making the fix.
🧹 Nitpick comments (4)
packages/core/src/particle/modules/LimitVelocityOverLifetimeModule.ts (4)

46-51: Internal field naming inconsistency with the rename.

The fields _limitRand, _limitMinConstantVec, and _limitMaxConstantVec still use the old "limit" naming convention while the rest of the module has been renamed to use "speed". Consider renaming these for consistency:

  • _limitRand_speedRand
  • _limitMinConstantVec_speedMinConstantVec
  • _limitMaxConstantVec_speedMaxConstantVec
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/core/src/particle/modules/LimitVelocityOverLifetimeModule.ts` around
lines 46 - 51, Rename the internal fields to match the "speed" naming: change
_limitRand → _speedRand, _limitMinConstantVec → _speedMinConstantVec, and
_limitMaxConstantVec → _speedMaxConstantVec, then update every reference in this
module (constructor, methods like any initializers, serializers, clones, and
usages in LimitVelocityOverLifetimeModule methods) to use the new names so
compilation and behavior remain identical; ensure decorators like `@ignoreClone`
remain on the renamed fields and update any comments or test references that
mention the old names.

372-437: Method name inconsistency: _uploadSeparateAxisLimits should be _uploadSeparateAxisSpeeds.

This method now uploads speed-related shader data for separate axes but retains the old "limit" naming. Consider renaming for consistency.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/core/src/particle/modules/LimitVelocityOverLifetimeModule.ts` around
lines 372 - 437, The method _uploadSeparateAxisLimits is misnamed given it
uploads speed shader data; rename the method to _uploadSeparateAxisSpeeds and
update all internal references/calls to this method (including any unit tests or
callers within LimitVelocityOverLifetimeModule and places that invoke it),
keeping the implementation and returned shape unchanged and preserving
references to symbols like LimitVelocityOverLifetimeModule._speedCurveModeMacro
and _speedIsRandomMacro; ensure the new name is used consistently where the old
name was referenced to avoid unresolved symbol errors.

268-277: Method name inconsistency: _isLimitRandomMode should be _isSpeedRandomMode.

The method now operates on _speedX, _speedY, _speedZ fields but retains the old "limit" naming. Consider renaming for consistency with the rest of the refactor.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/core/src/particle/modules/LimitVelocityOverLifetimeModule.ts` around
lines 268 - 277, Rename the method _isLimitRandomMode to _isSpeedRandomMode and
update all references/call sites in this class so callers use
_isSpeedRandomMode; keep the body logic unchanged (it inspects
_speedX/_speedY/_speedZ and ParticleCurveMode.TwoConstants/TwoCurves). Also
update any tests, bindings, or other methods referring to _isLimitRandomMode to
the new name to maintain consistency with the speed-related fields.

344-370: Method name inconsistency: _uploadScalarLimit should be _uploadScalarSpeed.

This method now uploads speed-related shader data but retains the old "limit" naming. Consider renaming for consistency.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/core/src/particle/modules/LimitVelocityOverLifetimeModule.ts` around
lines 344 - 370, The method name _uploadScalarLimit is inconsistent with its
purpose; rename it to _uploadScalarSpeed and update all internal references and
callers in LimitVelocityOverLifetimeModule to use the new name (e.g., where
_uploadScalarLimit(...) is invoked). Ensure the method signature and return type
remain the same and keep existing references to symbols used inside (speedX,
LimitVelocityOverLifetimeModule._speedCurveModeMacro, _speedIsRandomMacro,
_speedMaxCurveProperty, _speedMinCurveProperty, _speedMaxConstProperty,
_speedMinConstProperty) intact so only the identifier changes; run build/tests
to catch any missed usages.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@packages/core/src/particle/modules/LimitVelocityOverLifetimeModule.ts`:
- Line 79: The default value for the private property _dampen in
LimitVelocityOverLifetimeModule was changed from 1 to 0 which breaks existing
behavior (0 = no damping, 1 = full damping); revert the default back to 1 on the
_dampen declaration in the LimitVelocityOverLifetimeModule class (or, if the
change is intentional, update the module's public docs and changelog to declare
this breaking change) so runtime behavior remains consistent.
- Around line 215-218: The doc comment for the `space` property in
LimitVelocityOverLifetimeModule is incorrect about it only taking effect when
`separateAxes` is enabled; update the comment to accurately reflect that `space`
is used whenever the module is enabled (see `_updateShaderData()` which uploads
`space` unconditionally), or alternatively change `_updateShaderData()` to only
upload/apply `space` when `separateAxes` is true—use the `space` property name
and `_updateShaderData()` as references when making the fix.

---

Nitpick comments:
In `@packages/core/src/particle/modules/LimitVelocityOverLifetimeModule.ts`:
- Around line 46-51: Rename the internal fields to match the "speed" naming:
change _limitRand → _speedRand, _limitMinConstantVec → _speedMinConstantVec, and
_limitMaxConstantVec → _speedMaxConstantVec, then update every reference in this
module (constructor, methods like any initializers, serializers, clones, and
usages in LimitVelocityOverLifetimeModule methods) to use the new names so
compilation and behavior remain identical; ensure decorators like `@ignoreClone`
remain on the renamed fields and update any comments or test references that
mention the old names.
- Around line 372-437: The method _uploadSeparateAxisLimits is misnamed given it
uploads speed shader data; rename the method to _uploadSeparateAxisSpeeds and
update all internal references/calls to this method (including any unit tests or
callers within LimitVelocityOverLifetimeModule and places that invoke it),
keeping the implementation and returned shape unchanged and preserving
references to symbols like LimitVelocityOverLifetimeModule._speedCurveModeMacro
and _speedIsRandomMacro; ensure the new name is used consistently where the old
name was referenced to avoid unresolved symbol errors.
- Around line 268-277: Rename the method _isLimitRandomMode to
_isSpeedRandomMode and update all references/call sites in this class so callers
use _isSpeedRandomMode; keep the body logic unchanged (it inspects
_speedX/_speedY/_speedZ and ParticleCurveMode.TwoConstants/TwoCurves). Also
update any tests, bindings, or other methods referring to _isLimitRandomMode to
the new name to maintain consistency with the speed-related fields.
- Around line 344-370: The method name _uploadScalarLimit is inconsistent with
its purpose; rename it to _uploadScalarSpeed and update all internal references
and callers in LimitVelocityOverLifetimeModule to use the new name (e.g., where
_uploadScalarLimit(...) is invoked). Ensure the method signature and return type
remain the same and keep existing references to symbols used inside (speedX,
LimitVelocityOverLifetimeModule._speedCurveModeMacro, _speedIsRandomMacro,
_speedMaxCurveProperty, _speedMinCurveProperty, _speedMaxConstProperty,
_speedMinConstProperty) intact so only the identifier changes; run build/tests
to catch any missed usages.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 7ddcd065-8340-4a75-8201-20ca270a36b6

📥 Commits

Reviewing files that changed from the base of the PR and between 7ec06d9 and a188760.

⛔ Files ignored due to path filters (1)
  • packages/core/src/shaderlib/particle/limit_velocity_over_lifetime_module.glsl is excluded by !**/*.glsl
📒 Files selected for processing (1)
  • packages/core/src/particle/modules/LimitVelocityOverLifetimeModule.ts

- Rename public API: limit/limitX/Y/Z → speed/speedX/Y/Z
- Rename internal fields: _limitX/Y/Z → _speedX/Y/Z
- Rename shader uniforms: LVLLimit → LVLSpeed
- Rename shader macros: RENDERER_LVL_LIMIT_* → RENDERER_LVL_SPEED_*
- Change default dampen from 1 to 0
- Update e2e case and tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cptbtptpbcptdtptp
Copy link
Copy Markdown
Collaborator

从这次改名的目标来看,我觉得还可以再统一一下语义。

现在公共属性已经切成了 speed / speedX / speedY / speedZ,这个方向我认同,作为 LimitVelocityOverLifetimeModule 里的“限速参数”会比 limitX/Y/Z 更清楚;drag 也确实更像是这个模块下另一组独立参数。

但当前实现里语义还没有完全收口:

  1. 内部方法和字段仍然大量保留 limit 命名,比如 _isLimitRandomMode_limitRand_limitMinConstantVec_limitMaxConstantVec,读代码时会在 limit / speed 两套术语之间来回切换。
  2. 测试名和部分注释也还是旧语义,比如 limit propertylimit with Curve mode 这一类描述。
  3. space 的注释里写的是 “Only takes effect when separateAxes is enabled”,但从 shader 路径看,renderer_LVLSpace 在非 separateAxes 分支下也会参与 speed limit / drag 的空间选择,这个备注本身会让语义更混乱。

如果这次改名的目标是把 speeddrag 作为这个模块下更清晰的两组概念,我建议要么彻底把内部 helper / 注释 / 测试名也统一到 speed 语义,要么就不要改公共 API,继续保持 limit 术语一致。现在这种半 limitspeed 的状态,语义上其实更难理解。

hhhhkrx and others added 6 commits March 19, 2026 16:29
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
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

@cptbtptpbcptdtptp cptbtptpbcptdtptp added ignore for release ignore for release particle documentation Improvements or additions to documentation and removed documentation Improvements or additions to documentation labels Mar 19, 2026
@cptbtptpbcptdtptp cptbtptpbcptdtptp merged commit 68a0d57 into galacean:dev/2.0 Mar 19, 2026
11 of 12 checks passed
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 ignore for release ignore for release particle

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants