Skip to content

Commit

Permalink
refactor(threeHighlighter.ts): Apply the matrix to the highlighted ob…
Browse files Browse the repository at this point in the history
…ject.
  • Loading branch information
xiangechen committed Aug 10, 2024
1 parent 4fb3f03 commit 4f681b3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/chili-three/src/threeHighlighter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { hilightEdgeMaterial, selectedEdgeMaterial } from "./common";
import { ThreeGeometry } from "./threeGeometry";
import { ThreeGeometryFactory } from "./threeGeometryFactory";
import { ThreeVisualContext } from "./threeVisualContext";
import { ThreeHelper } from "./threeHelper";

export class GeometryState {
private readonly _states: Map<string, [VisualState, LineSegments2]> = new Map();
Expand Down Expand Up @@ -140,12 +139,12 @@ export class GeometryState {
console.warn(`Invalid type ${type} for ${key}`);
return undefined;
}
points = ThreeHelper.toMatrix(this.geometry.matrixWorld).ofPoints(points);

let lineGeometry = new LineSegmentsGeometry();
lineGeometry.setPositions(points);
let segment = new LineSegments2(lineGeometry);
this.highlighter.container.add(segment);
segment.applyMatrix4(this.geometry.matrixWorld);
return segment;
}
}
Expand Down

0 comments on commit 4f681b3

Please sign in to comment.