From 66e10f749fcc35e779e2492521b8dd98a8770820 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 3 Apr 2015 16:54:51 -0400 Subject: billboard mode --- .../assets/javascripts/rectangles/engine/sculpture/_sculpture.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'public/assets/javascripts/rectangles/engine/sculpture/_sculpture.js') diff --git a/public/assets/javascripts/rectangles/engine/sculpture/_sculpture.js b/public/assets/javascripts/rectangles/engine/sculpture/_sculpture.js index c8c90d3..1543def 100644 --- a/public/assets/javascripts/rectangles/engine/sculpture/_sculpture.js +++ b/public/assets/javascripts/rectangles/engine/sculpture/_sculpture.js @@ -8,6 +8,15 @@ var Sculpture = new function(){ base.mouse = new mouse ({ use_offset: false, mousedownUsesCapture: true }) base.init = function(){ + app.on("move", base.updateBillboards) + } + + base.updateBillboards = function(){ + base.forEach(function(sculpture){ + if (sculpture.billboard) { + sculpture.mx.rotationY = cam.rotationY + } + }) } base.add = function(opt){ -- cgit v1.2.3-70-g09d2