Skip to content
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

DefaultDebugDrawer: transform bones and set axes size #2843

Merged
merged 2 commits into from
May 21, 2023

Conversation

chillywillysoft
Copy link
Contributor

I needed this for my project. It seems to work and thought it might be useful for others. However…

The docs say that Node::_getFullTransform() “should only be called by a SceneManager which knows the derived transforms have been updated before calling this method.” I do not know if that is the case when Entity::_updateRenderQueue() is called. Please advise.

The DefaultDebugDrawer::drawAxes() size parameter could come from DefaultDebugDrawer or from Entity. Rather than add a debug data member to every Entity I thought it better to have it in just the DefaultDebugDrawer. However that means to set the value, we either have to change SceneManager’s interface, or just cast the return of SceneManager::getDebugDrawer() to a DefaultDebugDrawer *, which is what I’m doing.

Not sure about my design decisions. Open to feedback.

Allows debug bone drawing for Entities with non-identity SceneNode transforms. Maintains backwards-compatible interface by giving transform parameter default of identity.
Allows to set size of axes for debug bone drawing.
@paroj
Copy link
Member

paroj commented May 21, 2023

I do not know if that is the case when Entity::_updateRenderQueue() is called. Please advise.

yes transforms were already updated in _updateSceneGraph at this point. You can verify this by placing a breakpoint in Node::_update and Node::_updateRenderQueue.
Probably there should be a Node update sequence chart similar to what we have for render here:
https://ogrecave.github.io/ogre/api/latest/class_ogre_1_1_root.html#aeaad25268c0ad8007ce8961a32242c77

The DefaultDebugDrawer::drawAxes() size parameter could come from DefaultDebugDrawer or from Entity. Rather than add a debug data member to every Entity I thought it better to have it in just the DefaultDebugDrawer. However that means to set the value, we either have to change SceneManager’s interface, or just cast the return of SceneManager::getDebugDrawer() to a DefaultDebugDrawer *, which is what I’m doing.

Not sure about my design decisions. Open to feedback.

these decisions are sound.

@paroj paroj merged commit f156e86 into OGRECave:master May 21, 2023
5 checks passed
@chillywillysoft chillywillysoft deleted the bones branch May 27, 2023 15:31
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.

None yet

2 participants