minor bug fix

This commit is contained in:
Michael Chung committed 2024-04-04 19:40:19 -04:00
1 parent 114fb0bbfe
commit cb330e2b48
2 files changed
+6 -4

No files matched your search

@@ -34,7 +34,9 @@ export const ControlPanelSceneObject = () => {
const currentSceneObject = appUiState.controlPanel.currentSceneObject;
useEffect(()=>{
// TODO this causes a subtle bug because it renders way too many times.
const vectors = appUiState.controlPanel.currentSceneObject.objectVectors
editorEngine?.setSelectedObject(vectors.position, vectors.rotation, vectors.scale)
}, [appUiState.controlPanel.currentSceneObject]);
+4 -4
View File
@@ -24,7 +24,7 @@ import { PointerLockControls } from "three/addons/controls/PointerLockControls.j
import { APPUI_ACTION_TYPES } from "../reducers";
import { ClipGroup } from "~/pages/PageEnigma/models/track";
import { XYZ } from "../../datastructures/common";
import { XYZ } from "../datastructures/common";
class EditorState {
// {
// action: "ShowLoadingIndicator"
@@ -150,7 +150,7 @@ class Editor {
this.raycaster;
this.mouse;
this.selected;
this.selectedState = false
this.last_selected;
this.transform_interaction;
this.rendering = false;
@@ -444,8 +444,8 @@ class Editor {
// TO UPDATE selected objects in the scene might want to add to the scene ...
async setSelectedObject(position:XYZ,rotation:XYZ,scale:XYZ) {
if (this.selected !=null) {
if (this.selected !=undefined || this.selected !=null) {
//console.log(`triggering setSelectedObject`)
this.selected.position.x = position.x
this.selected.position.y = position.y
this.selected.position.z = position.z