Skip to content

Commit 4edeb85

Browse files
committed
Renderer should rerender if camera changes
Previously only scene or root changes triggered a rerender.
1 parent ea305fb commit 4edeb85

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

js/src/core/Renderer.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,17 @@ var RendererModel = RenderableModel.extend({
3737
setupListeners: function() {
3838

3939
var scene = this.get('scene');
40+
var camera = this.get('camera');
4041
this.on('change', this.onChange.bind(this));
4142
this.listenTo(scene, 'change', this.onChange.bind(this));
4243
this.listenTo(scene, 'childchange', this.onChange.bind(this));
44+
this.listenTo(camera, 'change', this.onCameraChange.bind(this));
4345

4446
},
4547

48+
onCameraChange: function(model, options) {
49+
this.onChange();
50+
},
4651

4752
onChange: function(model, options) {
4853
this.trigger('rerender', this, {});

0 commit comments

Comments
 (0)