Closed wumaolinmaoan closed 2 weeks ago
The changes encompass modifications to several classes and methods across the codebase. Key updates include enhancements to resource management in the Component
class, the introduction of deterministic random value generation in the RandomValue
class, and a revamped particle update mechanism in the ParticleMesh
class. Shader code has been streamlined, and adjustments were made to shader initialization logic in the WebGL library. Additionally, a constant variable in a demo file was updated to point to a new resource location.
Files | Change Summary |
---|---|
packages/effects-core/src/components/component.ts |
Modified dispose method in Component class for improved resource management based on boolean flags. |
packages/effects-core/src/math/value-getter.ts |
Updated getValue method in RandomValue class to accept an optional seed parameter; added getIntegrateValue method for value computation based on a time factor. |
packages/effects-core/src/plugins/particle/particle-mesh.ts |
Replaced minusTime with onUpdate method in ParticleMesh class, added new methods for particle transformations, and enhanced particle update logic with new attributes. |
packages/effects-core/src/plugins/particle/particle-system-renderer.ts |
Added call to this.particleMesh.onUpdate(dt); in render method of ParticleSystemRenderer class; removed commented-out line in updateTime method. |
packages/effects-core/src/shader/particle.vert.glsl |
Removed several attributes and uniform variables related to velocity and rotation; introduced new attributes for translation and rotation, changing the control flow of particle movement. |
packages/effects-webgl/src/gl-shader-library.ts |
Added console log for debugging shader compilation; modified checkComplete function to include early return if the shader is already initialized. |
web-packages/demo/src/single.ts |
Updated the value of the constant variable json to a new resource location. |
sequenceDiagram
participant Component
participant ParticleMesh
participant ParticleSystemRenderer
Component->>Component: dispose()
alt isEnableCalled
Component->>Component: disable()
end
alt isAwakeCalled
Component->>Component: onDestroy()
end
ParticleSystemRenderer->>ParticleMesh: render()
ParticleMesh->>ParticleMesh: onUpdate(dt)
🐇 "Oh, what a hop, what a skip,
With changes that make my heart flip!
Components now dance with delight,
Particles twirl in the moonlight.
Shader magic, a new path to trace,
In this code, I find my happy place!" 🐇
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?
Summary by CodeRabbit
New Features
RandomValue
class.ParticleMesh
class, allowing for more complex behaviors.ParticleSystemRenderer
class for better performance.Bug Fixes
Chores