Skip to content

Commit 3e86e27

Browse files
committed
Fix bug in make_trail
1 parent 0701f08 commit 3e86e27

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

lib/glow/primitives.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,12 +480,12 @@
480480
trail_object: {
481481
get: function() { return this.__trail_object }
482482
},
483-
__update_trail: function() {
483+
__update_trail: function(v) {
484484
this.__ninterval++
485485
if (this.__ninterval >= this.__interval) {
486486
this.__ninterval = 0
487-
if (this.__retain == -1) this.__trail_object.push(this.__pos)
488-
else this.__trail_object.push({pos:this.__pos, retain:this.__retain})
487+
if (this.__retain == -1) this.__trail_object.push(v)
488+
else this.__trail_object.push({pos:v, retain:this.__retain})
489489
}
490490
}
491491
})

lib/glow/vectors.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
this.__z = z
3737
if (parent) {
3838
parent.__change()
39-
if (parent.__make_trail) parent.__update_trail()
39+
if (parent.__make_trail) parent.__update_trail(vec(x,y,z))
4040
}
4141
}
4242

@@ -126,7 +126,7 @@
126126
function (value) {
127127
this.__x = value
128128
this.__parent.__change()
129-
if (this.__parent.__make_trail) this.__parent.__update_trail()
129+
if (this.__parent.__make_trail) this.__parent.__update_trail(vec(this.__x, this.__y, this.__z))
130130
}
131131
});
132132

@@ -139,7 +139,7 @@
139139
function (value) {
140140
this.__y = value
141141
this.__parent.__change()
142-
if (this.__parent.__make_trail) this.__parent.__update_trail()
142+
if (this.__parent.__make_trail) this.__parent.__update_trail(vec(this.__x, this.__y, this.__z))
143143
}
144144
});
145145

@@ -152,7 +152,7 @@
152152
function (value) {
153153
this.__z = value
154154
this.__parent.__change()
155-
if (this.__parent.__make_trail) this.__parent.__update_trail()
155+
if (this.__parent.__make_trail) this.__parent.__update_trail(vec(this.__x, this.__y, this.__z))
156156
}
157157
});
158158

0 commit comments

Comments
 (0)