(camera: Camera, domElement: HTMLElement)
| 72 | private readonly domElement: HTMLElement |
| 73 | |
| 74 | constructor (camera: Camera, domElement: HTMLElement) { |
| 75 | super() |
| 76 | this.is_view_helper = true |
| 77 | this.animating = false |
| 78 | this.center = new Vector3() |
| 79 | this.camera = camera |
| 80 | this.domElement = domElement |
| 81 | |
| 82 | const color1 = new Color('#ff4466') |
| 83 | const color2 = new Color('#88ff44') |
| 84 | const color3 = new Color('#4488ff') |
| 85 | const color4 = new Color('#000000') |
| 86 | |
| 87 | this.orthoCamera.position.set(0, 0, 2) |
| 88 | this.geometry = new CylinderGeometry(0.04, 0.04, 0.8, 5).rotateZ(-Math.PI / 2).translate(0.4, 0, 0) |
| 89 | this.xAxis = new Mesh(this.geometry, this.getAxisMaterial(color1)) |
| 90 | this.yAxis = new Mesh(this.geometry, this.getAxisMaterial(color2)) |
| 91 | this.zAxis = new Mesh(this.geometry, this.getAxisMaterial(color3)) |
| 92 | this.yAxis.rotation.z = Math.PI / 2 |
| 93 | this.zAxis.rotation.y = -Math.PI / 2 |
| 94 | this.add(this.xAxis) |
| 95 | this.add(this.zAxis) |
| 96 | this.add(this.yAxis) |
| 97 | const spriteMaterial1 = this.getSpriteMaterial(color1) |
| 98 | const spriteMaterial2 = this.getSpriteMaterial(color2) |
| 99 | const spriteMaterial3 = this.getSpriteMaterial(color3) |
| 100 | const spriteMaterial4 = this.getSpriteMaterial(color4) |
| 101 | this.posXAxisHelper = new Sprite(spriteMaterial1) |
| 102 | this.posYAxisHelper = new Sprite(spriteMaterial2) |
| 103 | this.posZAxisHelper = new Sprite(spriteMaterial3) |
| 104 | this.negXAxisHelper = new Sprite(spriteMaterial4) |
| 105 | this.negYAxisHelper = new Sprite(spriteMaterial4) |
| 106 | this.negZAxisHelper = new Sprite(spriteMaterial4) |
| 107 | this.posXAxisHelper.position.x = 1 |
| 108 | this.posYAxisHelper.position.y = 1 |
| 109 | this.posZAxisHelper.position.z = 1 |
| 110 | this.negXAxisHelper.position.x = -1 |
| 111 | this.negYAxisHelper.position.y = -1 |
| 112 | this.negZAxisHelper.position.z = -1 |
| 113 | this.negXAxisHelper.material.opacity = 0.2 |
| 114 | this.negYAxisHelper.material.opacity = 0.2 |
| 115 | this.negZAxisHelper.material.opacity = 0.2; |
| 116 | (this.posXAxisHelper.userData as any).type = 'posX'; |
| 117 | (this.posYAxisHelper.userData as any).type = 'posY'; |
| 118 | (this.posZAxisHelper.userData as any).type = 'posZ'; |
| 119 | (this.negXAxisHelper.userData as any).type = 'negX'; |
| 120 | (this.negYAxisHelper.userData as any).type = 'negY'; |
| 121 | (this.negZAxisHelper.userData as any).type = 'negZ' |
| 122 | this.add(this.posXAxisHelper) |
| 123 | this.add(this.posYAxisHelper) |
| 124 | this.add(this.posZAxisHelper) |
| 125 | this.add(this.negXAxisHelper) |
| 126 | this.add(this.negYAxisHelper) |
| 127 | this.add(this.negZAxisHelper) |
| 128 | this.interactiveObjects.push(this.posXAxisHelper, this.posYAxisHelper, this.posZAxisHelper, this.negXAxisHelper, this.negYAxisHelper, this.negZAxisHelper) |
| 129 | } |
| 130 | |
| 131 | public render = (renderer: WebGLRenderer): void => { |
nothing calls this directly
no test coverage detected