Skip to content

Commit 5121db6

Browse files
Update matrix world when creating marker geometries.
Update matrix world to ensure that raycaster recieves the correct matrices if render has not been run and updated matrix before.
1 parent 5358d2a commit 5121db6

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/component/marker/marker/Marker.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ export abstract class Marker {
4646
}
4747

4848
this._createGeometry(position);
49+
50+
// update matrix world if raycasting occurs before first render
51+
this._geometry.updateMatrixWorld(true);
4952
}
5053

5154
public disposeGeometry(): void {
@@ -85,6 +88,7 @@ export abstract class Marker {
8588
}
8689

8790
this._geometry.position.fromArray(position);
91+
this._geometry.updateMatrixWorld(true);
8892
}
8993

9094
protected abstract _createGeometry(position: number[]): void;

0 commit comments

Comments
 (0)