Skip to content

Feat: Improve ArmatureDebugger #2493

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

capdevon
Copy link
Contributor

@capdevon capdevon commented Jun 12, 2025

This update refines the ArmatureDebugger class by optimizing its structure and adding comprehensive Javadoc documentation. The changes improve code readability, maintainability, and provide detailed explanations for class functionality making it easier for developers to understand and utilize the armature debugging tools.

This PR introduces a significant refactor and optimization of the ArmatureNode class, which is responsible for visualizing JME3 armatures for debugging.

Key changes include:

  • Improved Code Clarity and Maintainability:
    • Added comprehensive Javadoc comments to all classes, methods, and significant variables, explaining their purpose, parameters, and return values.
    • Optimized temporary vector usage to reduce allocations during updates and picking.
  • Enhanced Joint and Bone Picking:
    • Refined the pick and collideWith methods for more robust 2D picking of joint heads and bone wires.
    • Implemented separate handling for joint heads (pixel-based picking) and bone wires (distance-based picking), improving selection accuracy.
  • Flexible Coloring Options:
    • Added dedicated methods setHeadColor(Joint, ColorRGBA), setHeadColor(ColorRGBA), setLineColor(ColorRGBA) for easier programmatic control over the visualization colors.

These changes make ArmatureNode more robust, easier to understand, and more flexible for debugging armature animations and poses.

Edit:

Usage example:

        Spatial model = assetManager.loadModel("Models/Sinbad/Sinbad.mesh.xml");
        AnimMigrationUtils.migrate(model);
        rootNode.attachChild(model);

        SkinningControl skControl = model.getControl(SkinningControl.class);

        ArmatureDebugger debugger = new ArmatureDebugger(assetManager, skControl);
        debugger.setName(model.getName() + "_ArmatureDebugger");
        debugger.getBoneShapes().setHeadColor(ColorRGBA.Blue);
        debugger.getBoneShapes().setLineColor(ColorRGBA.Green);
        ((Node) model).attachChild(debugger);

image

@capdevon capdevon changed the title ArmatureDebugger refinement and Javadoc enhancement Feat: Improve ArmatureDebugger Jun 12, 2025
@yaRnMcDonuts yaRnMcDonuts added this to the v3.9.0 milestone Jun 13, 2025
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.

2 participants