diff --git a/gui/public/i18n/en/translation.ftl b/gui/public/i18n/en/translation.ftl index 6066bc1b02..783ab650a4 100644 --- a/gui/public/i18n/en/translation.ftl +++ b/gui/public/i18n/en/translation.ftl @@ -780,11 +780,11 @@ onboarding-choose_mounting = What mounting calibration method to use? onboarding-choose_mounting-description = Mounting orientation corrects for the placement of trackers on your body. onboarding-choose_mounting-auto_mounting = Automatic mounting # Italized text -onboarding-choose_mounting-auto_mounting-label = Experimental +onboarding-choose_mounting-auto_mounting-label-v2 = Recommended onboarding-choose_mounting-auto_mounting-description = This will automatically detect the mounting orientations for all of your trackers from 2 poses onboarding-choose_mounting-manual_mounting = Manual mounting # Italized text -onboarding-choose_mounting-manual_mounting-label = Recommended +onboarding-choose_mounting-manual_mounting-label-v2 = Might not be precise enough onboarding-choose_mounting-manual_mounting-description = This will let you choose the mounting orientation manually for each tracker # Multiline text onboarding-choose_mounting-manual_modal-title = Are you sure you want to do diff --git a/gui/src-tauri/src/presence.rs b/gui/src-tauri/src/presence.rs index 6b08b6221b..f318304750 100644 --- a/gui/src-tauri/src/presence.rs +++ b/gui/src-tauri/src/presence.rs @@ -9,7 +9,6 @@ const APP_ID: ds::AppId = 1237970689009647639; pub struct DiscordClient { pub discord: ds::Discord, - pub user: ds::user::User, pub wheel: ds::wheel::Wheel, } @@ -43,11 +42,7 @@ async fn make_client(subs: ds::Subscriptions) -> Result> { log::info!(target: "discord_presence", "connected to Discord, local user name is {}", user.username); - Ok(Some(DiscordClient { - discord, - user, - wheel, - })) + Ok(Some(DiscordClient { discord, wheel })) } async fn client_exists(client: &State<'_, ExposedClient>) -> bool { diff --git a/gui/src/components/commons/BodyInteractions.tsx b/gui/src/components/commons/BodyInteractions.tsx index ce081e4752..d91496e931 100644 --- a/gui/src/components/commons/BodyInteractions.tsx +++ b/gui/src/components/commons/BodyInteractions.tsx @@ -173,8 +173,7 @@ export function BodyInteractions({ ({ top, left, height, width, id, hidden, buttonOffset }) => (
- +
diff --git a/gui/src/components/onboarding/pages/ConnectTracker.tsx b/gui/src/components/onboarding/pages/ConnectTracker.tsx index ad82c0c83d..e55c5c156b 100644 --- a/gui/src/components/onboarding/pages/ConnectTracker.tsx +++ b/gui/src/components/onboarding/pages/ConnectTracker.tsx @@ -21,7 +21,7 @@ import { ProgressBar } from '@/components/commons/ProgressBar'; import { TipBox } from '@/components/commons/TipBox'; import { Typography } from '@/components/commons/Typography'; import { TrackerCard } from '@/components/tracker/TrackerCard'; -import { useBnoExists } from '@/hooks/imu-logic'; +import { useIsRestCalibrationTrackers } from '@/hooks/imu-logic'; import './ConnectTracker.scss'; const statusLabelMap = { @@ -67,7 +67,7 @@ export function ConnectTrackersPage() { const connectedIMUTrackers = useConnectedIMUTrackers(); - const bnoExists = useBnoExists(connectedIMUTrackers); + const bnoExists = useIsRestCalibrationTrackers(connectedIMUTrackers); useEffect(() => { if (!state.wifi) { diff --git a/gui/src/components/onboarding/pages/ResetTutorial.tsx b/gui/src/components/onboarding/pages/ResetTutorial.tsx index 763878ee3a..69a0ea0a92 100644 --- a/gui/src/components/onboarding/pages/ResetTutorial.tsx +++ b/gui/src/components/onboarding/pages/ResetTutorial.tsx @@ -134,9 +134,11 @@ export function ResetTutorialPage() { - - - - - ); -} diff --git a/gui/src/components/onboarding/pages/trackers-assign/TrackerAssignOptions.tsx b/gui/src/components/onboarding/pages/trackers-assign/TrackerAssignOptions.tsx index 454a1e43fd..8663b155c4 100644 --- a/gui/src/components/onboarding/pages/trackers-assign/TrackerAssignOptions.tsx +++ b/gui/src/components/onboarding/pages/trackers-assign/TrackerAssignOptions.tsx @@ -117,7 +117,7 @@ export function TrackerAssignOptions({ disabled={connectedIMUTrackers > trackersCount && mode !== AssignMode.All} className="hidden" > -
+
diff --git a/gui/src/components/onboarding/pages/trackers-assign/TrackerAssignment.tsx b/gui/src/components/onboarding/pages/trackers-assign/TrackerAssignment.tsx index e9a4771f1e..32f848048f 100644 --- a/gui/src/components/onboarding/pages/trackers-assign/TrackerAssignment.tsx +++ b/gui/src/components/onboarding/pages/trackers-assign/TrackerAssignment.tsx @@ -77,7 +77,9 @@ export function TrackersAssignPage() { }, []); useRPCPacket(RpcMessage.SettingsResponse, (settings: SettingsResponseT) => { - setTapDetectionSettings(settings.tapDetectionSettings); + if (settings.tapDetectionSettings) { + setTapDetectionSettings(settings.tapDetectionSettings); + } }); useEffect(() => { @@ -296,7 +298,7 @@ export function TrackersAssignPage() {
)} -
+
diff --git a/gui/src/components/settings/pages/GeneralSettings.tsx b/gui/src/components/settings/pages/GeneralSettings.tsx index a4136e7157..f6d0c1c0ef 100644 --- a/gui/src/components/settings/pages/GeneralSettings.tsx +++ b/gui/src/components/settings/pages/GeneralSettings.tsx @@ -329,7 +329,7 @@ export function GeneralSettings() { if (settings.steamVrTrackers) { formData.trackers = settings.steamVrTrackers; if ( - settings.steamVrTrackers.leftHand && + settings.steamVrTrackers.leftHand || settings.steamVrTrackers.rightHand ) { setHandsWarning(false); diff --git a/gui/src/components/tracker/TrackerCard.tsx b/gui/src/components/tracker/TrackerCard.tsx index 0b19936361..0d70423a42 100644 --- a/gui/src/components/tracker/TrackerCard.tsx +++ b/gui/src/components/tracker/TrackerCard.tsx @@ -29,7 +29,9 @@ function TrackerBig({
- {trackerName} + + {trackerName} +
@@ -76,8 +78,10 @@ function TrackerSmol({
-
- {trackerName} +
+ + {trackerName} +
{device && device.hardwareStatus && ( diff --git a/gui/src/hooks/config.ts b/gui/src/hooks/config.ts index 0be8880f06..864591aa12 100644 --- a/gui/src/hooks/config.ts +++ b/gui/src/hooks/config.ts @@ -34,7 +34,6 @@ export interface Config { textSize: number; fonts: string[]; useTray: boolean | null; - doneManualMounting: boolean; mirrorView: boolean; assignMode: AssignMode; discordPresence: boolean; @@ -60,7 +59,6 @@ export const defaultConfig: Omit = { textSize: 12, fonts: ['poppins'], useTray: null, - doneManualMounting: false, mirrorView: true, assignMode: AssignMode.Core, discordPresence: false, diff --git a/gui/src/hooks/imu-logic.ts b/gui/src/hooks/imu-logic.ts index 6a9c5209b2..db331b8e46 100644 --- a/gui/src/hooks/imu-logic.ts +++ b/gui/src/hooks/imu-logic.ts @@ -1,19 +1,24 @@ import { useMemo } from 'react'; import { FlatDeviceTracker } from './app'; -import { ImuType } from 'solarxr-protocol'; -export function useBnoExists(connectedTrackers: FlatDeviceTracker[]): boolean { - const bnoExists = useMemo( - () => - connectedTrackers.some( - (tracker) => - tracker.tracker.info?.imuType && - [ImuType.BNO055, ImuType.BNO080, ImuType.BNO085].includes( - tracker.tracker.info?.imuType - ) - ), +export function useIsRestCalibrationTrackers( + connectedTrackers: FlatDeviceTracker[] +): boolean { + const imuExists = useMemo( + () => connectedTrackers.some((tracker) => tracker.tracker.info?.isImu), [connectedTrackers] ); - return bnoExists; + return imuExists; +} + +export function useRestCalibrationTrackers( + connectedTrackers: FlatDeviceTracker[] +): FlatDeviceTracker[] { + const restTrackers = useMemo( + () => connectedTrackers.filter((tracker) => tracker.tracker.info?.isImu), + [connectedTrackers] + ); + + return restTrackers; } diff --git a/gui/src/maths/vector3.ts b/gui/src/maths/vector3.ts index c753f6d8fa..fcee442279 100644 --- a/gui/src/maths/vector3.ts +++ b/gui/src/maths/vector3.ts @@ -3,6 +3,12 @@ import { Vector3 } from 'three'; export type Vector3Object = { x: number; y: number; z: number }; +export function averageVector(vecs: Vector3[]) { + if (vecs.length === 0) return new Vector3(); + const sum = vecs.reduce((prev, curr) => prev.add(curr), new Vector3()); + return sum.divideScalar(vecs.length); +} + export function Vector3FromVec3fT(vec?: Vector3Object | null) { return vec ? new Vector3(vec.x, vec.y, vec.z) : new Vector3(); }