respect camera target (#1421)

* respect camera target

* make default planes scale

* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Kurt Hutten
2024-02-17 07:04:24 +11:00
committed by GitHub
parent 198feb7d44
commit 3747a1b993
9 changed files with 156 additions and 15 deletions

View File

@ -22,6 +22,7 @@ import {
DEFAULT_PLANES,
DefaultPlane,
defaultPlaneColor,
getSceneScale,
INTERSECTION_PLANE_LAYER,
isQuaternionVertical,
RAYCASTABLE_PLANE,
@ -195,11 +196,18 @@ class SceneEntities {
this.axisGroup = new Group()
const gridHelper = createGridHelper({ size: 100, divisions: 10 })
gridHelper.renderOrder = -3 // is this working?
gridHelper.name = 'gridHelper'
const sceneScale = getSceneScale(
sceneInfra.camera,
sceneInfra.controls.target
)
gridHelper.scale.set(sceneScale, sceneScale, sceneScale)
this.axisGroup.add(xAxisMesh, yAxisMesh, gridHelper)
this.currentSketchQuaternion &&
this.axisGroup.setRotationFromQuaternion(this.currentSketchQuaternion)
this.axisGroup.userData = { type: AXIS_GROUP }
this.axisGroup.name = AXIS_GROUP
this.axisGroup.layers.set(SKETCH_LAYER)
this.axisGroup.traverse((child) => {
child.layers.set(SKETCH_LAYER)