|
@@ -1,6 +1,9 @@
|
|
this.triggerdown = function(){
|
|
this.triggerdown = function(){
|
|
|
|
+ let scene = this.getScene();
|
|
this.pointer.material.color = "black";
|
|
this.pointer.material.color = "black";
|
|
this.penDown = true;
|
|
this.penDown = true;
|
|
|
|
+ this.penName = 'drawNode-' + scene.GUID();
|
|
|
|
+ scene.createDrawNode(scene.drawBox, this.penName, "#f9f9f9", 0.007, "0 0 0");
|
|
}
|
|
}
|
|
|
|
|
|
this.triggerup = function(){
|
|
this.triggerup = function(){
|
|
@@ -11,10 +14,11 @@ this.triggerup = function(){
|
|
this.onMove = function(){
|
|
this.onMove = function(){
|
|
if(this.penDown){
|
|
if(this.penDown){
|
|
let scene = this.getScene();
|
|
let scene = this.getScene();
|
|
|
|
+ let pen = scene.drawBox.children[this.penName];
|
|
let pos = this.pointer.worldPosition();
|
|
let pos = this.pointer.worldPosition();
|
|
- let path = scene.drawNode.linepath.path.slice();
|
|
|
|
|
|
+ let path = pen.linepath.path.slice();
|
|
path.push(pos);
|
|
path.push(pos);
|
|
- scene.drawNode.linepath.path = path;
|
|
|
|
|
|
+ pen.linepath.path = path;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|