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

bug in AABBTree.cpp #1

Open
jksr opened this issue Nov 25, 2017 · 1 comment
Open

bug in AABBTree.cpp #1

jksr opened this issue Nov 25, 2017 · 1 comment

Comments

@jksr
Copy link

jksr commented Nov 25, 2017

the implementation of insertLeaf has bug:

in line 132
AABBNode& leafNode = _nodes[leafNodeIndex];

but in line 192
unsigned newParentIndex = allocateNode();

if AABBNode pool gets resized in ln192, the reference in ln132 will cause problem.

It's better to change all this kind of "AABBnode&"s to "_nodes[index]" to avoid this kind of pitfall.

Anyway, thank you very much for the AABBTree code

@JamesRandall
Copy link
Owner

Thanks for that - I'll investigate and take a look. Until writing this I'd really not done much C++ for years - think this project is the most I've written by far in over 10 years, and my goodness C++ has changed too!

If you notice anything else please do let me know (I'm not writing C++ regularly but always keen to keep these things up and learn).

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

No branches or pull requests

2 participants