Skip to content

Commit

Permalink
Merge pull request #702 from HSF/fix701
Browse files Browse the repository at this point in the history
Set line material colour too.
  • Loading branch information
EdwardMoyse authored Nov 30, 2024
2 parents b512fcb + 2c96966 commit 8ead7ef
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import {
Color,
MeshPhongMaterial,
LineBasicMaterial,
Mesh,
Object3D,
Material,
type Object3DEventMap,
Line,
} from 'three';
import { SceneManager } from './scene-manager';

Expand Down Expand Up @@ -133,5 +135,11 @@ function setColorForObject(object: Object3D<Object3DEventMap>, color: any) {
} else if ('color' in material) {
(material.color as Color).set(color);
}
} else if (object instanceof Line) {
const line = object as Line;
const material = line.material;
if ('color' in material) {
(material.color as Color).set(color);
}
}
}

0 comments on commit 8ead7ef

Please sign in to comment.