Skip to content

Reversed raytest results when needed#471

Closed
NemesisMate wants to merge 2 commits into
jMonkeyEngine:masterfrom
NemesisMate:patch-7
Closed

Reversed raytest results when needed#471
NemesisMate wants to merge 2 commits into
jMonkeyEngine:masterfrom
NemesisMate:patch-7

Conversation

@NemesisMate
Copy link
Copy Markdown
Contributor

In some cases, native-bullet returns the ray results on a reversed order so it leads to unexpected bugs.

More details can be found here.

In some cases, native-bullet returns the ray results on a reversed order so it leads to unexpected bugs.
@empirephoenix
Copy link
Copy Markdown
Contributor

Is this a fix of the perceived Result, or was the actual bullet code looked at to determine if only those two orders can appear? After this commit, we kind of guarantee that the result is always correctly ordered, so we should make sure, that is actually is. (As this could be a cause for quite subtle bugs for many users)

@NemesisMate
Copy link
Copy Markdown
Contributor Author

Is a fix of the perceived Result. I tried to look at the bullet code but I'm not skilled enough at the moment (and neither have time to get that skill) to ensure is working like that. However, I made a few tests (simple, can't ensure at 100%). However, I'm using it in my game and works fine 👍

@shadowislord
Copy link
Copy Markdown
Member

I would recommend to just do a sort. We don't know what the intended order is in this case so better not make any assumptions.

@NemesisMate
Copy link
Copy Markdown
Contributor Author

Talking about assumptions, isn't there a way to know which is the intended order by asking bullet people? (I don't know how feasible is this)

@shadowislord
Copy link
Copy Markdown
Member

@NemesisMate
Took a quick look at the source code and it doesn't seem like there is any implied order. Also consider that on the bullet side, the results are given via a callback and not a list of collision results.

@empirephoenix
Copy link
Copy Markdown
Contributor

Ok, rejected merging this, as no guarantee of the outcome is made
-> allow raw list as it comes from bullet
-> use Collections sort on the list, to ensure guaranteed order, no matter what bullet tries to do (we can make this default, as most users will probably want this anyway)

I would feel very happy, if you would resubmit with that smaller change in behaviour.

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.

3 participants