Closed GuoLei1990 closed 3 weeks ago
The changes in this pull request enhance the particle system's functionality by integrating gravity effects into various components. The ParticleGenerator
class now includes gravity handling in its emission logic and bounding box calculations. The MainModule
class has been streamlined to set gravity directly from the scene's physics, while the GLSL shaders have been updated to incorporate randomness into gravity calculations. Additionally, a variable in the texture sheet animation module has been renamed for clarity, but the overall functionality remains unchanged.
File Path | Change Summary |
---|---|
packages/core/src/particle/ParticleGenerator.ts |
Added imports for ParticleBufferUtils and ParticleCompositeCurve ; updated emit and _addNewParticle methods to include gravity handling; adjusted _calculateGeneratorBounds for gravity effects. |
packages/core/src/particle/modules/MainModule.ts |
Removed duplicate import for TransformModifyFlags ; removed _gravity variable; updated gravity handling in _updateShaderData and constructor initialization. |
packages/core/src/shaderlib/extra/particle.vs.glsl |
Modified gravityVelocity calculation to include a random factor based on a_Random0.x . |
packages/core/src/shaderlib/particle/texture_sheet_animation_module.glsl |
Renamed variable floorTotalULength to tileRowIndex in computeParticleUV function for clarity. |
bug
, particle
🐇 In the world of particles, we play,
With gravity's pull, we dance and sway.
From shaders to modules, we craft and create,
A sprinkle of randomness makes it all great!
So hop along, let the particles fly,
In a whimsical dance, under the sky! 🌌
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?
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 69.48%. Comparing base (
5d147ae
) to head (7db9d0f
). Report is 1 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Please check if the PR fulfills these requirements
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
These changes collectively enhance the particle system's functionality and realism, offering a more dynamic experience for users.