summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/mx/primitives
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/javascripts/mx/primitives')
-rw-r--r--public/assets/javascripts/mx/primitives/mx.polyline.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/public/assets/javascripts/mx/primitives/mx.polyline.js b/public/assets/javascripts/mx/primitives/mx.polyline.js
index 555b3c6..63c0ef8 100644
--- a/public/assets/javascripts/mx/primitives/mx.polyline.js
+++ b/public/assets/javascripts/mx/primitives/mx.polyline.js
@@ -28,16 +28,23 @@ MX.Polyline = MX.Object3D.extend({
var angle = atan2( head.b - tail.b, head.a - tail.a )
mx.move({
x: mid_x / 2,
- y: wall_height/2 + 1,
+ y: wallHeight/2 + 1,
z: mid_z / 2,
width: ceil(len),
- height: wall_height,
+ height: wallHeight,
rotationY: angle
})
var hue = abs(round( angle / PI * 90 + 300))
mx.el.style.backgroundColor = 'hsl(' + [hue, "100%", "50%"] + ')'
},
+ set_height: function(height){
+ for (var i = 0; i < this.faces.length; i++) {
+ this.faces[i].height = height
+ this.faces[i].y = height / 2 + 1
+ }
+ },
+
destroy: function(){
this.faces.forEach(function(mx){
scene.remove(mx)