diff --git a/app/src/components/layout/sidebarRight/Header.tsx b/app/src/components/layout/sidebarRight/Header.tsx
index f9f48fb..a449500 100644
--- a/app/src/components/layout/sidebarRight/Header.tsx
+++ b/app/src/components/layout/sidebarRight/Header.tsx
@@ -2,9 +2,9 @@ import React, { useEffect, useState } from "react";
import { AppDockIcon } from "../../icons/HeaderIcons";
import orgImg from "../../../assets/orgTemp.png";
import { useActiveUsers } from "../../../store/store";
-import { getAvatarColor } from "../../../functions/users/functions/getAvatarColor";
import { ActiveUser } from "../../../types/users";
import CollaborationPopup from "../../templates/CollaborationPopup";
+import { getAvatarColor } from "../../../modules/collaboration/functions/getAvatarColor";
const Header: React.FC = () => {
const { activeUsers } = useActiveUsers();
diff --git a/app/src/components/layout/sidebarRight/SideBarRight.tsx b/app/src/components/layout/sidebarRight/SideBarRight.tsx
index cb9b5dc..b2f25eb 100644
--- a/app/src/components/layout/sidebarRight/SideBarRight.tsx
+++ b/app/src/components/layout/sidebarRight/SideBarRight.tsx
@@ -49,6 +49,9 @@ const SideBarRight: React.FC = () => {
setSubModule("simulations");
}
}
+ if (activeModule !== "simulation") {
+ setSubModule("properties");
+ }
}, [activeModule, selectedEventData, selectedEventSphere, setSubModule]);
return (
diff --git a/app/src/components/layout/sidebarRight/properties/GlobalProperties.tsx b/app/src/components/layout/sidebarRight/properties/GlobalProperties.tsx
index 568783c..251ada3 100644
--- a/app/src/components/layout/sidebarRight/properties/GlobalProperties.tsx
+++ b/app/src/components/layout/sidebarRight/properties/GlobalProperties.tsx
@@ -282,8 +282,7 @@ const GlobalProperties: React.FC = () => {
key={"6"}
/>
-
-
+ {/*
{
max={5}
onChange={(value: number) => updateGridDistance(value)}
onPointerUp={updatedGrid}
- />
+ /> */}
);
};
diff --git a/app/src/components/templates/FollowPerson.tsx b/app/src/components/templates/FollowPerson.tsx
new file mode 100644
index 0000000..a85d0c9
--- /dev/null
+++ b/app/src/components/templates/FollowPerson.tsx
@@ -0,0 +1,29 @@
+import React from "react";
+import RenderOverlay from "./Overlay";
+import { useSelectedUserStore } from "../../store/useCollabStore";
+import { useCamMode } from "../../store/store";
+
+const FollowPerson: React.FC = () => {
+ // Get the selected user from the store
+ const { selectedUser, clearSelectedUser } = useSelectedUserStore();
+ const { setCamMode } = useCamMode();
+ return (
+
+ {selectedUser && (
+ // eslint-disable-next-line
+ {
+ clearSelectedUser();
+ setCamMode("FirstPerson");
+ }}
+ style={{ "--user-color": selectedUser.color } as React.CSSProperties}
+ >
+
{selectedUser.name}
+
+ )}
+
+ );
+};
+
+export default FollowPerson;
diff --git a/app/src/functions/collabUserIcon.tsx b/app/src/functions/collabUserIcon.tsx
deleted file mode 100644
index 9e6802b..0000000
--- a/app/src/functions/collabUserIcon.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-import React from "react";
-import CustomAvatar from "./users/Avatar";
-
-interface CollabUserIconProps {
- userName: string;
- userImage?: string;
- color: string;
-}
-
-const CollabUserIcon: React.FC = ({
- userImage,
- userName,
- color,
-}) => {
- return (
-
-
- {userImage ? (
-

- ) : (
-
- )}
-
-
- {userName}
-
-
- );
-};
-
-export default CollabUserIcon;
diff --git a/app/src/modules/collaboration/camera/collabCams.tsx b/app/src/modules/collaboration/camera/collabCams.tsx
index 1347a2a..461cb7f 100644
--- a/app/src/modules/collaboration/camera/collabCams.tsx
+++ b/app/src/modules/collaboration/camera/collabCams.tsx
@@ -8,9 +8,9 @@ import { useActiveUsers, useSocketStore } from "../../../store/store";
import { DRACOLoader } from "three/examples/jsm/loaders/DRACOLoader";
import { useNavigate } from "react-router-dom";
import { Html } from "@react-three/drei";
-import CollabUserIcon from "../../../functions/collabUserIcon";
-import { getAvatarColor } from "../../../functions/users/functions/getAvatarColor";
+import CollabUserIcon from "./collabUserIcon";
import useModuleStore from "../../../store/useModuleStore";
+import { getAvatarColor } from "../functions/getAvatarColor";
const CamModelsGroup = () => {
const navigate = useNavigate();
@@ -20,13 +20,14 @@ const CamModelsGroup = () => {
const { socket } = useSocketStore();
const { activeModule } = useModuleStore();
+ // eslint-disable-next-line react-hooks/exhaustive-deps
const loader = new GLTFLoader();
const dracoLoader = new DRACOLoader();
dracoLoader.setDecoderPath("three/examples/jsm/libs/draco/gltf/");
loader.setDRACOLoader(dracoLoader);
const [cams, setCams] = useState([]);
- const [models, setModels] = useState>({});
+ const [models, setModels] = useState>({});
const dedupeCams = (cams: any[]) => {
const seen = new Set();
@@ -102,6 +103,7 @@ const CamModelsGroup = () => {
});
socket.on("cameraUpdateResponse", (data: any) => {
+
if (
!groupRef.current ||
socket.id === data.socketId ||
@@ -122,6 +124,11 @@ const CamModelsGroup = () => {
data.data.rotation.y,
data.data.rotation.z
),
+ target: new THREE.Vector3(
+ data.data.target.x,
+ data.data.target.y,
+ data.data.target.z
+ ),
},
}));
});
@@ -131,7 +138,7 @@ const CamModelsGroup = () => {
socket.off("userDisConnectResponse");
socket.off("cameraUpdateResponse");
};
- }, [socket]);
+ }, [email, loader, navigate, setActiveUsers, socket]);
useFrame(() => {
if (!groupRef.current) return;
@@ -217,9 +224,11 @@ const CamModelsGroup = () => {
position={[-0.015, 0, 0.7]}
>