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

Fixes depth-first-traversal order in Node. #1012

Merged
merged 2 commits into from Feb 2, 2019

Conversation

Projects
None yet
2 participants
@FennelFetish
Copy link
Contributor

commented Feb 1, 2019

Calling Node.depthFirstTraversal() with DFSMode.PRE_ORDER doesn't produce the expected order of traversal.

It doesn’t pass the DFSMode to the recursive calls. Thus, the PRE_ORDER mode is only applied in the first call and will default to POST_ORDER further down the scenegraph.

Test code: https://pastebin.com/XCbwLSAS
The snipped also includes expected and actual results.

I've been told to also create an issue for this so others who encounter this problem will know about it, even if this expected behaviour.
But if this is expected behaviour, I think it should be mentioned in the Java Doc.

Fixes depth-first-traversal order in Node.
DFSMode needs to be passed to the recursive calls so the selected order is also applied further down the scenegraph.
@stephengold
Copy link
Contributor

left a comment

Thank you for opening this pull request. Please add tests to the jme3-core/src/test/com/jme3/scene package.

@stephengold stephengold merged commit 254a583 into jMonkeyEngine:master Feb 2, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@stephengold stephengold added this to the v3.2.3 milestone Feb 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.