-
-
Notifications
You must be signed in to change notification settings - Fork 309
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
Fix CharactorController move not effect with transform changed in update func #2322
Conversation
Warning Rate limit exceeded@luzhuang has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 9 minutes and 22 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe updates to the Changes
Poem
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- packages/core/src/physics/PhysicsScene.ts (1 hunks)
Additional comments not posted (1)
packages/core/src/physics/PhysicsScene.ts (1)
354-354
: Verify the impact of reordering method calls.The call to
componentsManager.callScriptOnPhysicsUpdate()
has been moved beforethis._callColliderOnUpdate()
. This change may affect the timing and interaction between script updates and collider updates. Ensure that this alteration maintains the intended behavior of the physics simulation.
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- packages/core/src/physics/CharacterController.ts (4 hunks)
Additional comments not posted (3)
packages/core/src/physics/CharacterController.ts (3)
94-96
: Encapsulation and readability improvements.The changes to the
move
method enhance readability by storing the return value inflags
and encapsulating the world position retrieval logic in_getWorldPositionFromBackend
.
141-142
: Centralized logic for world position retrieval.The
_onLateUpdate
method now calls_getWorldPositionFromBackend
, which centralizes the logic for obtaining the world position and adheres to the DRY principle.
169-172
: Encapsulation of world position retrieval logic.The new private method
_getWorldPositionFromBackend
encapsulates the logic for obtaining the world position from the backend, enhancing code organization and clarity.
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- packages/core/src/Engine.ts (1 hunks)
Additional comments not posted (1)
packages/core/src/Engine.ts (1)
390-397
: Verify_callColliderOnUpdate
implementation.The new block of code updates colliders for active scenes, which is a good enhancement. Ensure that the
_callColliderOnUpdate
method in thePhysicsScene
class is correctly implemented to handle this update efficiently.Verification successful
_callColliderOnUpdate Implementation Verified
The
_callColliderOnUpdate
method is correctly implemented in thePhysicsScene
class. It iterates over colliders and calls_onUpdate
on each, ensuring that collider states are updated appropriately. This supports the changes made inEngine.ts
for physics synchronization.
- File:
packages/core/src/physics/PhysicsScene.ts
- Method:
_callColliderOnUpdate
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the implementation of `_callColliderOnUpdate` in the `PhysicsScene` class. # Test: Search for the method implementation. Expect: Correct handling of collider updates. ast-grep --lang typescript --pattern $'class PhysicsScene { $$$ _callColliderOnUpdate() { $$$ } $$$ }'Length of output: 117
Script:
#!/bin/bash # Search for the `_callColliderOnUpdate` method across all TypeScript files to locate its implementation. rg '_callColliderOnUpdate' --type ts --context 5Length of output: 2262
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- packages/core/src/physics/CharacterController.ts (4 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/core/src/physics/CharacterController.ts
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2322 +/- ##
==========================================
+ Coverage 69.47% 69.53% +0.06%
==========================================
Files 523 524 +1
Lines 27380 27405 +25
Branches 4098 4100 +2
==========================================
+ Hits 19021 19056 +35
+ Misses 6866 6849 -17
- Partials 1493 1500 +7 ☔ View full report in Codecov by Sentry. |
…ate func (galacean#2322) * fix: CharactorController move not effect with transform changed in update func
Please check if the PR fulfills these requirements
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
Bug Fixes
New Features
CharacterController
functionality.CharacterController
class with updated logic centralization.