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

ssBVH code does not agree with comment #21

Open
ylkurs opened this issue Oct 12, 2022 · 1 comment
Open

ssBVH code does not agree with comment #21

ylkurs opened this issue Oct 12, 2022 · 1 comment

Comments

@ylkurs
Copy link

ylkurs commented Oct 12, 2022

The first if statement in the following code snippet (in file ssBVH_Node.cs)

           // perform the best rotation...            
            if (bestRot.rot != Rot.NONE) {
                // if the best rotation is no-rotation... we check our parents anyhow..                
                if (parent != null) { 
                    // but only do it some random percentage of the time.
                    if ((DateTime.Now.Ticks % 100) < 2) {
                        bvh.refitNodes.Add(parent); 
                    }
                }                
            } else {
                // ...
            } 

should be replace by the following line of code???

if (bestRot.rot == Rot.NONE) {
@jeske
Copy link
Owner

jeske commented Oct 12, 2022

That's very peculiar... as it would seem like this bug would cause it to hardly ever perform a rotation. I'm going to have to look more carefully at the code, but that if-condition does seem most likely wrong.

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