Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

This pull request adds a new feature to the Octree visualization system: depth-limited drawing. This is a powerful debugging tool that allows developers to inspect the Octree's structure and contents level by level.

Key Changes

  1. Depth Parameter in Draw Methods: The DrawAllBounds() and DrawAllObjects() methods in OctreeBase now accept an optional maxDepth parameter. The internal drawing logic will not recurse past this depth, allowing for fine-grained control over the visualization.

  2. Inspector Control: A maxDrawingDepth integer field has been added to the base OctreeVisualizer component. This allows the drawing depth to be set directly from the Unity Inspector. A value of -1 is used to signify no depth limit, which will draw the entire tree.

  3. Updated Visualizers: All specialized visualizer components have been updated to use this new functionality, passing the depth value from the Inspector to the Octree's drawing methods.

This commit enhances the Octree visualization system by adding depth-based drawing controls. This allows developers to inspect the Octree's structure level by level directly in the Unity editor.

- **`OctreeBase.cs`**: The `DrawAllBounds()` and `DrawAllObjects()` methods have been updated to accept an optional `maxDepth` parameter. The recursive drawing logic in the `OctreeNode` now respects this limit.

- **`OctreeVisualizer.cs`**: The base visualizer component now has a `public int maxDrawingDepth` field, which can be set in the Inspector to control the visualization depth. A value of -1 draws all levels.

- **Specialized Visualizers**: The concrete visualizer components (`PointOctreeVisualizer`, `BoundsOctreeVisualizer`, `MeshOctreeVisualizer`) have been updated to pass the `maxDrawingDepth` value to the Octree's draw methods.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll acknowledge your comments with a 👀 emoji and then get to work. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

I will automatically address your feedback on specific files or sections of files. For any comments you don't want me to act on, just include `(aside)`.

PS: Responding to comments on the entire PR are not yet supported but coming soon.


For security, I will only act on instructions from the user who triggered this task for this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant