Compare commits

...
13 changed files with 126 additions and 58 deletions

No files matched your search

+10
View File
@@ -65,6 +65,16 @@ work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
</provides>
<releases>
<release version="0.16.0~rc.1" type="development" date="2025-05-27"><url>https://github.com/SlimeVR/SlimeVR-Server/releases/tag/v0.16.0-rc.1</url></release>
<release version="0.15.0" date="2025-05-19"><url>https://github.com/SlimeVR/SlimeVR-Server/releases/tag/v0.15.0</url></release>
<release version="0.15.0~rc.4" type="development" date="2025-05-12"><url>https://github.com/SlimeVR/SlimeVR-Server/releases/tag/v0.15.0-rc.4</url></release>
<release version="0.15.0~rc.3" type="development" date="2025-04-28"><url>https://github.com/SlimeVR/SlimeVR-Server/releases/tag/v0.15.0-rc.3</url></release>
<release version="0.15.0~rc.2" type="development" date="2025-04-25"><url>https://github.com/SlimeVR/SlimeVR-Server/releases/tag/v0.15.0-rc.2</url></release>
<release version="0.15.0~rc.1" type="development" date="2025-04-23"><url>https://github.com/SlimeVR/SlimeVR-Server/releases/tag/v0.15.0-rc.1</url></release>
<release version="0.14.1" date="2025-04-15"><url>https://github.com/SlimeVR/SlimeVR-Server/releases/tag/v0.14.1</url></release>
<release version="0.14.0" date="2025-04-10"><url>https://github.com/SlimeVR/SlimeVR-Server/releases/tag/v0.14.0</url></release>
<release version="0.14.0~rc.2" type="development" date="2025-03-25"><url>https://github.com/SlimeVR/SlimeVR-Server/releases/tag/v0.14.0-rc.2</url></release>
<release version="0.14.0~rc.1" type="development" date="2025-02-12"><url>https://github.com/SlimeVR/SlimeVR-Server/releases/tag/v0.14.0-rc1</url></release>
<release version="0.13.2" date="2024-11-06"><url>https://github.com/SlimeVR/SlimeVR-Server/releases/tag/v0.13.2</url></release>
<release version="0.13.1" date="2024-11-05"><url>https://github.com/SlimeVR/SlimeVR-Server/releases/tag/v0.13.1</url></release>
<release version="0.13.1~rc.3" type="development" date="2024-10-31"><url>https://github.com/SlimeVR/SlimeVR-Server/releases/tag/v0.13.1-rc.3</url></release>
@@ -1,5 +1,5 @@
import classNames from 'classnames';
import { ReactNode, useLayoutEffect, useRef, useState } from 'react';
import { ReactNode, useEffect, useRef, useState } from 'react';
import { BodyPart } from 'solarxr-protocol';
import { PersonFrontIcon } from './PersonFrontIcon';
import { useBreakpoint } from '@/hooks/breakpoint';
@@ -9,7 +9,7 @@ export function BodyInteractions({
rightControls,
highlightedRoles,
assignedRoles,
width = 228,
width = 248,
dotsSize = 15,
variant = 'tracker-select',
mirror,
@@ -30,6 +30,12 @@ export function BodyInteractions({
const personRef = useRef<HTMLDivElement | null>(null);
const leftContainerRef = useRef<HTMLDivElement | null>(null);
const rightContainerRef = useRef<HTMLDivElement | null>(null);
const mutationObserverRef = useRef<MutationObserver>(
new MutationObserver(() => updateSlots())
);
const resizeObserverRef = useRef<ResizeObserver>(
new ResizeObserver(() => updateSlots())
);
const canvasRefRef = useRef<HTMLCanvasElement | null>(null);
const [slotsButtonsPos, setSlotsButtonPos] = useState<
{
@@ -78,7 +84,7 @@ export function BodyInteractions({
};
};
useLayoutEffect(() => {
const updateSlots = () => {
if (
!(
personRef.current &&
@@ -88,7 +94,6 @@ export function BodyInteractions({
)
)
return;
const ctx = canvasRefRef.current.getContext('2d');
if (!ctx) return;
const slotsPos = getSlotsPos();
@@ -147,7 +152,44 @@ export function BodyInteractions({
});
}
setSlotsButtonPos(slots);
}, [leftControls, rightControls, variant]);
};
useEffect(() => {
updateSlots();
}, [variant]);
useEffect(() => {
if (
!rightContainerRef.current ||
!leftContainerRef.current ||
!personRef.current
)
return;
resizeObserverRef.current.observe(personRef.current);
mutationObserverRef.current.observe(rightContainerRef.current, {
attributes: true,
childList: true,
subtree: true,
});
mutationObserverRef.current.observe(leftContainerRef.current, {
attributes: true,
childList: true,
subtree: true,
});
return () => {
if (
!rightContainerRef.current ||
!leftContainerRef.current ||
!personRef.current
)
return;
mutationObserverRef.current.takeRecords();
resizeObserverRef.current.unobserve(personRef.current);
};
}, []);
return (
<div className="relative">
@@ -26,6 +26,7 @@ import { connectedIMUTrackersAtom } from '@/store/app-store';
import { BaseModal } from '@/components/commons/BaseModal';
import { useStatusContext } from '@/hooks/status-system';
import { A } from '@/components/commons/A';
import { CONNECT_TRACKER } from '@/utils/tauri';
const statusLabelMap = {
[WifiProvisioningStatus.NONE]:
@@ -198,7 +199,7 @@ export function ConnectTrackersPage() {
></Typography>
</Localized>
<video
src="/videos/turn-on-tracker.webm"
src={CONNECT_TRACKER}
loop
autoPlay
className="w-full aspect-video rounded-md mt-2"
@@ -21,12 +21,43 @@ const ASSIGN_MODE_OPTIONS = [
{} as Record<AssignMode, number>
);
const ItemContent = ({
mode,
trackersCount,
}: {
mode: string;
trackersCount: number;
}) => {
const { l10n } = useLocalization();
return (
<>
<Typography variant="main-title" textAlign="text-right">
{l10n.getString('onboarding-assign_trackers-option-amount', {
trackersCount,
})}
</Typography>
<div className="flex flex-col">
<Typography>
{l10n.getString('onboarding-assign_trackers-option-label', {
mode,
})}
</Typography>
<Typography variant="standard" color="secondary">
{l10n.getString('onboarding-assign_trackers-option-description', {
mode,
})}
</Typography>
</div>
</>
);
};
export function TrackerAssignOptions({
variant = 'radio',
}: {
variant: 'radio' | 'dropdown';
}) {
const { l10n } = useLocalization();
const connectedIMUTrackers = useAtomValue(connectedIMUTrackersAtom);
const { config, setConfig } = useConfig();
@@ -56,34 +87,6 @@ export function TrackerAssignOptions({
}
}, [connectedIMUTrackers, assignMode]);
const ItemContent = ({
mode,
trackersCount,
}: {
mode: string;
trackersCount: number;
}) => (
<>
<Typography variant="main-title" textAlign="text-right">
{l10n.getString('onboarding-assign_trackers-option-amount', {
trackersCount,
})}
</Typography>
<div className="flex flex-col">
<Typography>
{l10n.getString('onboarding-assign_trackers-option-label', {
mode,
})}
</Typography>
<Typography variant="standard" color="secondary">
{l10n.getString('onboarding-assign_trackers-option-description', {
mode,
})}
</Typography>
</div>
</>
);
if (variant == 'dropdown')
return (
<Dropdown
@@ -21,8 +21,6 @@ function guiDefaults() {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { lang, ...guiDefaults } = defaultGUIConfig;
// Include "devSettings" which has all the properties of "defaultDevConfig"
// @ts-expect-error "devSettings" is not in the "guiDefaults" object but we want to include it (from "defaultDevConfig")
guiDefaults.devSettings = defaultDevConfig;
return guiDefaults;
@@ -195,6 +195,7 @@ function initializePreview(
const render = (delta: number) => {
views.forEach((v) => {
if (v.hidden) return;
v.controls.update(delta);
const left = Math.floor(resolution.x * v.left);
@@ -211,7 +212,6 @@ function initializePreview(
v.camera.aspect = width / height;
v.camera.updateProjectionMatrix();
if (v.hidden) return;
renderer.render(scene, v.camera);
});
};
@@ -220,10 +220,11 @@ function initializePreview(
const animate = (currentTime: number) => {
animationFrameId = requestAnimationFrame(animate);
if (currentTime - lastRenderTimeRef > frameInterval) {
lastRenderTimeRef = currentTime;
render(currentTime);
}
const now = performance.now();
const elapsed = now - lastRenderTimeRef;
if (elapsed < frameInterval) return;
render(currentTime);
lastRenderTimeRef = now - (elapsed % frameInterval);
};
animationFrameId = requestAnimationFrame(animate);
@@ -313,7 +314,7 @@ function initializePreview(
camera.position.copy(position);
})
.onStart(() => (frameInterval = 0))
.onComplete(() => (frameInterval = 1000 / 30));
.onComplete(() => (frameInterval = 1000 / LOW_FRAMERATE));
camera.position.copy(position);
@@ -337,7 +338,7 @@ function initializePreview(
}
const BASE_FRAMERATE = 60;
const LOW_FRAMERATE = 60;
const LOW_FRAMERATE = 30;
type PreviewContext = ReturnType<typeof initializePreview>;
+6 -2
View File
@@ -1,5 +1,8 @@
import { createContext, useContext, useState } from 'react';
import { DeveloperModeWidgetForm } from '@/components/widgets/DeveloperModeWidget';
import {
defaultValues as defaultDevSettings,
DeveloperModeWidgetForm,
} from '@/components/widgets/DeveloperModeWidget';
import { error } from '@/utils/logging';
import { useDebouncedEffect } from './timeout';
import { createStore, Store } from '@tauri-apps/plugin-store';
@@ -50,7 +53,7 @@ export interface ConfigContext {
saveConfig: () => Promise<void>;
}
export const defaultConfig: Omit<Config, 'devSettings'> = {
export const defaultConfig: Config = {
lang: 'en',
debug: false,
doneOnboarding: false,
@@ -69,6 +72,7 @@ export const defaultConfig: Omit<Config, 'devSettings'> = {
decorations: false,
showNavbarOnboarding: true,
vrcMutedWarnings: [],
devSettings: defaultDevSettings,
};
interface CrossStorage {
-1
View File
@@ -7,7 +7,6 @@ body {
font-family: var(--font-name), 'Noto Sans CJK', sans-serif, emoji;
width: 100vw;
height: 100vh;
user-select: none;
background: theme('colors.background.20');
/*Scrollbar for firefox */
+2 -2
View File
@@ -1,7 +1,7 @@
import { ResetType } from 'solarxr-protocol';
import Xylophone from './xylophone';
import Xylophone, { ValidNote } from './xylophone';
const tones = [
const tones: ValidNote[][] = [
['E3', 'G3', 'B3'],
['G3', 'B3', 'D4'],
['B3', 'D4', 'F#4'],
+7 -7
View File
@@ -20,7 +20,7 @@
SOFTWARE.
*/
export const NOTES: { [note: string]: number } = {
export const NOTES = {
C0: 16.35,
'C#0': 17.32,
Db0: 17.32,
@@ -160,11 +160,13 @@ export const NOTES: { [note: string]: number } = {
C8: 4186.01,
};
export type ValidNote = keyof typeof NOTES;
/**
* A measure that can be played on a Xylophone
*/
export interface IMeasure {
notes: string[];
notes: ValidNote[];
length?: number;
offset?: number;
type?: OscillatorOptions['type'];
@@ -172,7 +174,7 @@ export interface IMeasure {
}
export interface INote {
note: string;
note: ValidNote;
length?: number;
offset?: number;
type?: OscillatorOptions['type'];
@@ -193,10 +195,8 @@ export default class Xylophone {
/**
* Converts a named note to hertz (e.g. `toHertz('A4') => 440.00`)
*/
private static toHertz(note: string): number {
note = note.trim();
if (note in NOTES) return NOTES[note];
throw new Error(`${note} is not a valid note`);
private static toHertz(note: ValidNote): number {
return NOTES[note];
}
private oscillator: OscillatorNode | undefined;
+1
View File
@@ -14,6 +14,7 @@ export async function fetchResourceUrl(url: string) {
// FIXME: For some fucking reason, you can't top-level await on a react component file
// on Chromium on developments builds specifically -Uriel
export const AUTOBONE_VIDEO = await fetchResourceUrl('/videos/autobone.webm');
export const CONNECT_TRACKER = await fetchResourceUrl('/videos/turn-on-tracker.webm');
export const isTrayAvailable =
isTauri() && (await invoke<boolean>('is_tray_available'));
@@ -99,7 +99,7 @@ class DesktopVRCConfigHandler : VRCConfigHandler() {
private fun updateCurrentState() {
vrcConfigKeys = getVRChatKeys(VRC_REG_PATH)
val newConfig = VRCConfigValues(
legacyMode = intValue("VRC_IK_LEGACY") == 1,
legacyMode = intValue("VRC_IK_LEGACY_CALIBRATION") == 1,
shoulderTrackingDisabled = intValue("VRC_IK_DISABLE_SHOULDER_TRACKING") == 1,
userHeight = doubleValue("PlayerHeight") ?: -1.0,
calibrationRange = doubleValue("VRC_IK_CALIBRATION_RANGE") ?: -1.0,
@@ -41,6 +41,7 @@ class TrackersHID(name: String, private val trackersConsumer: Consumer<Tracker>)
private val devices: MutableList<HIDDevice> = mutableListOf()
private val devicesBySerial: MutableMap<String, MutableList<Int>> = HashMap()
private val devicesByHID: MutableMap<HidDevice, MutableList<Int>> = HashMap()
private val lastDataByHID: MutableMap<HidDevice, Int> = HashMap()
private val hidServicesSpecification = HidServicesSpecification()
private var hidServices: HidServices? = null
@@ -92,6 +93,7 @@ class TrackersHID(name: String, private val trackersConsumer: Consumer<Tracker>)
val list: MutableList<Int> = mutableListOf()
this.devicesBySerial[serial] = list
this.devicesByHID[hidDevice] = list
this.lastDataByHID[hidDevice] = 0 // initialize last data received
LogManager.info("[TrackerServer] (Probably) Compatible HID device detected: $serial")
}
}
@@ -233,6 +235,7 @@ class TrackersHID(name: String, private val trackersConsumer: Consumer<Tracker>)
continue // Don't continue with this data
}
devicesDataReceived = true // Data is received and is valid (not malformed)
lastDataByHID[hidDevice] = 0 // reset last data received
val packetCount = dataReceived.size / PACKET_SIZE
var i = 0
while (i < packetCount * PACKET_SIZE) {
@@ -465,6 +468,8 @@ class TrackersHID(name: String, private val trackersConsumer: Consumer<Tracker>)
i += PACKET_SIZE
}
// LogManager.info("[TrackerServer] HID received $packetCount tracker packets")
} else {
lastDataByHID[hidDevice] = lastDataByHID[hidDevice]!! + 1 // increment last data received
}
}
if (!devicesPresent) {
@@ -500,7 +505,11 @@ class TrackersHID(name: String, private val trackersConsumer: Consumer<Tracker>)
}
// Quickly reattaching a device may not be detected, so always try to open existing devices
for (device in devicesByHID.keys) {
device.open()
// a receiver sends keep-alive data at 10 packets/s
if (lastDataByHID[device]!! > 100) { // try to reopen device if no data was received recently (about >100ms)
LogManager.info("[TrackerServer] Reopening device ${device.serialNumber} after no data received")
device.open()
}
}
hidDeviceList.removeAll(devicesByHID.keys) // addList
for (device in hidDeviceList) {