Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix uLightHeight update
fix radius update geometry.
add some cache optimisations
overide destroy: just to be sure gc do it job.
those issue was so long here , now it fixed.
**edit: sry when a save my ide installed a default formater, i reverse change without the uglyfi prettier to keep author formating **
overview
This is a pull request that contains changes to two TypeScript files: src/lights/light/Light.ts and src/lights/pointLight/PointLight.ts.
In Light.ts, there is one change made to the _renderDefault method, which involves adding 47 lines of code and deleting 2 lines.
In PointLight.ts, there are multiple changes made. Firstly, a new constant DEFAULT_SHAPE_SEGMENTS is defined. Then, the PointLight class is modified to add three new properties: shapeCache, verticesCache, and indicesCache. shapeCache is a Circle object that is used to generate a mesh, while verticesCache and indicesCache are arrays used to store the vertices and indices of the mesh, respectively. The _shapeSegments property is also added, which sets the number of segments to use for the Circle mesh.
The constructor of PointLight is modified to take in a new parameter shapeSegments, which is used to set _shapeSegments. A new mesh is generated using the getCircleMesh function and the vertices and indices arrays are passed to the constructor of Light. Additionally, the drawMode property is set to DRAW_MODES.TRIANGLE_FAN.
Two new methods are added to PointLight: set radius and set shapeSegments. The former method updates the value of uLightRadius in the material.uniforms object and updates the buffers of the mesh with new vertices and indices generated using getCircleMesh. The latter method updates the value of _shapeSegments and also updates the mesh.
Finally, the destroy method is overridden to delete the shapeCache, verticesCache, and indicesCache properties before calling the superclass destroy method.
by gpt