As I started working on skeletal animation, there was a need for a couple of utility classes specifically designed for debugging purposes. So here they are:
The HierarchyRenderComponent class
One of these utility classes is the hierarchy render component, which I’m using in this example to render all bones in the model:
This render component implementation traverses a scene drawing lines from parents to each of its children. It requires a shader program to draw the lines, but it can be customized as much as needed. For example, I’m working on a version of the shader using different point size for the joints between bones that will be available soon.
The SceneDescriptor class
The other one is a visitor implementation that prints out all nodes in the hierarchy. That way I know if a scene is composed as I expected (and also if I’m adding more group nodes that needed). Here’s the console’s output after loading the scene in the image above:
This class is particularly useful to find out which nodes are redundant and can be eliminated. For example, a GroupNode with only one child and no transformations applied it’s hardly useful and can be completely avoided.
Both of this classes are part of the new Crimild::Debug namespace. My intention is to create as many of this utility classes as needed in order to provide a reusable debugging library for any Crimild-based project.