Skip to content

Commit

Permalink
refactor(OBBHelper): remove OBBHelper text.
Browse files Browse the repository at this point in the history
  • Loading branch information
gchoqueux committed Oct 13, 2021
1 parent ef204f9 commit 1e2fc31
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 30 deletions.
28 changes: 0 additions & 28 deletions utils/debug/OBBHelper.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import * as THREE from 'three';

// TODO regler le probleme glsl
import fontJS from './fonts/optimer_regular.json';

const font = new THREE.Font(JSON.parse(fontJS));
const matText = new THREE.MeshBasicMaterial({ color: new THREE.Color(1, 0, 0) });

class OBBHelper extends THREE.Box3Helper {
constructor(OBB, text, color) {
color = color || new THREE.Color(Math.random(), Math.random(), Math.random());
Expand All @@ -19,34 +13,12 @@ class OBBHelper extends THREE.Box3Helper {
this.matrixAutoUpdate = false;
this.rotationAutoUpdate = false;

if (text) {
const geometryText = new THREE.TextGeometry(text, { font, curveSegments: 1 });

this.textMesh = new THREE.Mesh(geometryText, matText);
this.textMesh.rotateZ(Math.PI * 0.5);
this.textMesh.scale.set(0.001, 0.001, 0.001);
this.textMesh.position.set(0.9, 0.5, 1);
this.textMesh.frustumCulled = false;
this.add(this.textMesh);
}

this.updateMatrixWorld(true);
}

removeChildren() {
this.material.dispose();
this.geometry.dispose();
if (this.textMesh) {
if (Array.isArray(this.textMesh.material)) {
for (const material of this.textMesh.material) {
material.dispose();
}
} else {
this.textMesh.material.dispose();
}
this.textMesh.geometry.dispose();
delete this.textMesh;
}
}

updateMatrixWorld(force = false) {
Expand Down
1 change: 0 additions & 1 deletion utils/debug/fonts/LICENSE

This file was deleted.

1 change: 0 additions & 1 deletion utils/debug/fonts/optimer_regular.json

This file was deleted.

0 comments on commit 1e2fc31

Please sign in to comment.