-
Notifications
You must be signed in to change notification settings - Fork 1
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
added checks to prevent box2d crashing #1
base: master
Are you sure you want to change the base?
Conversation
Does this actually solve a problem for you? |
I've been using these checks for three weeks now and never had any box2d
crash again. Before that it crashed nearly during each runtime.
But I don't know if there are better places to put the checks.
Am 30.12.2016 um 11:48 schrieb Piotr Jastrzebski:
…
Does this actually solve a problem for you?
I think doing the check just before raycast is too late, we want to
use as many valid rays as we can and that doesnt help. Perhaps the
check could be move to
https://github.com/piotr-j/box2dlights/blob/master/src/box2dLight/SmoothPositionalLight.java#L274
somewhere in Positional lights case?
Short ray is already checked for in
https://github.com/piotr-j/box2dlights/blob/master/src/box2dLight/SmoothLineLight.java#L512
for line lights apparently.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEFMeNtbV3tytVM8wuM_BsB7EX92J9uBks5rNOF2gaJpZM4LYG3I>.
|
Did you try moving the check to the A repro case or some details on the light that was causing it would be great. Ive tried doing a lot of crazy things on the example app. Perhaps it crashes on devices only or something? |
Only the added checks avoid crashing for me. But I do not understand enough of the library to say if can't be done better. |
Its been a while but check this branch if you can if it fixes the problem. |
Am 20.01.2017 um 23:21 schrieb Piotr Jastrzebski:
Its been a while but check this branch
<https://github.com/piotr-j/box2dlights/tree/fix-0-len-rays> if you
can if it fixes the problem.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEFMeEd1nBnSll3DOW3tSVFj4dAlSinXks5rUTN9gaJpZM4LYG3I>.
Sorry, same kind of crashes with this fix:
Program: C:\Program Files\Java\jdk1.8.0_112\bin\java.exe
File: ./Box2D/Collision/b2DynamicTree.h, Line 209
Expression: r.LengthSquared() > 0.0f
|
Oh well, Ill keep on guessing what you are doing to make it crash! |
Am 22.01.2017 um 14:31 schrieb Piotr Jastrzebski:
Oh well, Ill keep on guessing what you are doing to make it crash!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEFMeCEJBWUY6lNwj5WPO5067SuSd4lzks5rU1pDgaJpZM4LYG3I>.
Its just a character with point and directional light moving through the
world of Bx2d bodies and more lights of all kinds.
|
Well, you are doing something weird. The only way ive manged to crash like that is by setting the lights distance to 0, which cant be done normally. Im 90% sure that extra rays are never close to zero len, that leaves the base rays, but they are set to be the length of the light. Which type of light crashes? Run with one at the time or something. All of them? Specific? Log how many 0 len rays there are in ray. Give me something to work with. I did manage to find some bugs in point lights, so thats a plus i guess. |
Am 22.01.2017 um 20:52 schrieb Piotr Jastrzebski:
Well, you are doing /something/ weird. The only way ive manged to
crash like that is by setting the lights distance to 0, which cant be
done normally. Im 90% sure that extra rays are never close to zero
len, that leaves the base rays, but they are set to be the length of
the light.
I did manage to find some bugs in point lights, so thats a plus i guess.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEFMeNI4K_VFzeXiFqzDfjZVu7muSAibks5rU7NhgaJpZM4LYG3I>.
How could I. I have lots of lights and have moving lights. I am a
hardcore Box2dLights user :).
And found a way to prevent crashes. If it's the best way is another story.
|
with "Expression: r.LengthSquared() > 0.0f"