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

Exception when adding second point light #137

Open
CoderCat84 opened this issue Jul 7, 2014 · 1 comment
Open

Exception when adding second point light #137

CoderCat84 opened this issue Jul 7, 2014 · 1 comment

Comments

@CoderCat84
Copy link

when I add a second point light I get an exception

Stack Trace:
#0 List.[]= (dart:core-patch/growable_array.dart:157)
#1 WebGLRenderer.setupLights (package:three/src/renderers/web_gl_renderer.dart:5885:19)
#2 WebGLRenderer.setProgram (package:three/src/renderers/web_gl_renderer.dart:5201:17)
#3 WebGLRenderer.renderBuffer (package:three/src/renderers/web_gl_renderer.dart:3647:23)
#4 WebGLRenderer.renderObjects (package:three/src/renderers/web_gl_renderer.dart:4293:18)
#5 WebGLRenderer._render (package:three/src/renderers/web_gl_renderer.dart:4167:17)
#6 WebGLRenderer.render (package:three/src/renderers/web_gl_renderer.dart:4013:49)
#7 Frame.render (http://127.0.0.1:8080/metropolis.dart:291:20)
#8 Game.run. (http://127.0.0.1:8080/game.dart:11:51)
#9 _rootRunUnary (dart:async/zone.dart:730)
#10 _RootZone.runUnary (dart:async/zone.dart:864)
#11 _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:488)
#12 _Future._propagateToListeners (dart:async/future_impl.dart:571)
#13 _Future._complete (dart:async/future_impl.dart:317)
#14 _SyncCompleter.complete (dart:async/future_impl.dart:44)
#15 Window.animationFrame. (dart:html:29269)

Exception: RangeError: 1

this source is where the issue is:
if (pointDistances==null) { pointDistances = new List(); pointDistances.add(0); }
if (pointDistances.length == 0) {pointDistances.add(0);}
pointDistances[ pointLength ] = distance;

Looking at it my guess is that the issue stems from this being taken from javascript. In javascript "pointDistances[ pointsLength] = distance " would create the index when pointsLength > greater than pointsDistances.length but in dart this throws a range exception. I'd make the change and contribute myself but work restrictions prevent it at the moment.

@johsin18
Copy link
Contributor

johsin18 commented Dec 7, 2014

I guess this one can be closed.

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