|
@@ -1,7 +1,7 @@
|
|
|
import * as THREE from "three";
|
|
|
import { Line2 } from 'three/examples/jsm/lines/Line2.js';
|
|
|
import { LineGeometry } from 'three/examples/jsm/lines/LineGeometry.js';
|
|
|
-
|
|
|
+import gotoPic from '@/assets/image/goto.png'
|
|
|
const offset = 0.25
|
|
|
|
|
|
function pointsToArray(arr) {
|
|
@@ -16,7 +16,7 @@ export default class TouchEdge extends Line2 {
|
|
|
let points;
|
|
|
let g = new THREE.PlaneGeometry(0.1, 0.1)
|
|
|
let m = new THREE.MeshBasicMaterial({
|
|
|
- map: new THREE.TextureLoader().load('assets/image/goto.png'),
|
|
|
+ map: new THREE.TextureLoader().load(gotoPic),
|
|
|
color: 0x26559b,
|
|
|
transparent: true
|
|
|
})
|
|
@@ -28,7 +28,7 @@ export default class TouchEdge extends Line2 {
|
|
|
let b = new THREE.Vector3(startPoint.x, startPoint.y, endEdge.y + endEdge.parent.parent.position.z - offset)
|
|
|
let c = new THREE.Vector3(endPoint.x, endPoint.y, endEdge.y + endEdge.parent.parent.position.z - offset)
|
|
|
let d = new THREE.Vector3(endPoint.x, endPoint.y, endEdge.y + endEdge.parent.parent.position.z)
|
|
|
- cross.rotation.y = 0
|
|
|
+ cross.rotation.y = -Math.PI/2
|
|
|
cross.position.copy(d)
|
|
|
points = pointsToArray([a,b,c,d])
|
|
|
} else if(endEdge.name === 1) { //left
|
|
@@ -36,7 +36,7 @@ export default class TouchEdge extends Line2 {
|
|
|
let b = new THREE.Vector3((startPoint.x + endPoint.x) / 2, startPoint.y, startPoint.z)
|
|
|
let c = new THREE.Vector3((startPoint.x + endPoint.x) / 2, startPoint.y, endPoint.z)
|
|
|
let d = new THREE.Vector3(endEdge.x + endEdge.parent.parent.parent.position.x, startPoint.y, endPoint.z)
|
|
|
- cross.rotation.y = -Math.PI/2
|
|
|
+ cross.rotation.y = 0
|
|
|
cross.position.copy(d)
|
|
|
points = pointsToArray([a,b,c,d])
|
|
|
} else if(endEdge.name === 2) { //bottom
|
|
@@ -52,7 +52,7 @@ export default class TouchEdge extends Line2 {
|
|
|
let b = new THREE.Vector3((startPoint.x + endPoint.x) / 2, startPoint.y, startPoint.z)
|
|
|
let c = new THREE.Vector3((startPoint.x + endPoint.x) / 2, startPoint.y, endPoint.z)
|
|
|
let d = new THREE.Vector3(endEdge.x + endEdge.parent.parent.parent.position.x, startPoint.y, endPoint.z)
|
|
|
- cross.rotation.y = Math.PI/2
|
|
|
+ cross.rotation.y = Math.PI
|
|
|
cross.position.copy(d)
|
|
|
points = pointsToArray([a,b,c,d])
|
|
|
}
|