mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-12-02 14:52:36 -08:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4df2d8771c | ||
|
|
a92dec8805 | ||
|
|
942f64a2f1 | ||
|
|
5211d340d2 | ||
|
|
f3cefdcc61 | ||
|
|
00e0824a84 |
No files matched your search
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
YELLOW="\033[1;33m"
|
||||
GREEN="\033[1;32m"
|
||||
RESET="\033[0m"
|
||||
|
||||
if git rev-parse -q --verify MERGE_HEAD; then
|
||||
echo -e "${YELLOW}Skipping precommit hook because of merge${RESET}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
APP_PRE_COMMIT_OPTIONS="$(dirname "$0")/_/pre-commit.options"
|
||||
|
||||
if ! [ -f "$APP_PRE_COMMIT_OPTIONS" ]; then
|
||||
echo -e "${YELLOW}\nSkipping pre-commit hook."
|
||||
echo -e "If you want to use pre-commit for lint-staged, run:\n"
|
||||
echo -e " ${GREEN}echo -e 'APP_LINT=true;' > ${APP_PRE_COMMIT_OPTIONS}${RESET}"
|
||||
echo -e "${YELLOW}\nIt will add some delay before committing!\n${RESET}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
source $APP_PRE_COMMIT_OPTIONS
|
||||
|
||||
if [ -n "${APP_LINT}" ] && [ "${APP_LINT}" == "true" ]; then
|
||||
echo -e "${GREEN}[husky] [pre-commit] [lint-staged]${RESET}"
|
||||
case "$(uname -sr)" in
|
||||
CYGWIN*|MINGW*|MINGW32*|MSYS*)
|
||||
npx.cmd lint-staged
|
||||
;;
|
||||
|
||||
*)
|
||||
npx lint-staged
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
@@ -0,0 +1,9 @@
|
||||
export default {
|
||||
'server/**/*.{java,kt,kts}': (filenames) =>
|
||||
filenames.map(
|
||||
(filename) =>
|
||||
`./gradlew${
|
||||
process.platform === 'win32' ? '.bat' : ''
|
||||
} spotlessApply "-PspotlessIdeHook=${filename}"`
|
||||
),
|
||||
};
|
||||
Generated
+688
-201
File diff suppressed because it is too large.
Load diff
File mode changed.
@@ -28,3 +28,6 @@ yarn-error.log*
|
||||
# vite
|
||||
/dist
|
||||
/stats.html
|
||||
|
||||
# eslint
|
||||
.eslintcache
|
||||
@@ -0,0 +1,5 @@
|
||||
export default {
|
||||
"**/*.{ts,tsx}": () => "tsc -p tsconfig.json --noEmit",
|
||||
"**/*.{js,jsx,ts,tsx}": "eslint --cache --fix",
|
||||
"**/*.{js,jsx,ts,tsx,css,md,json}": "prettier --write"
|
||||
};
|
||||
+4
-4
@@ -8,7 +8,7 @@
|
||||
"@fontsource/poppins": "^4.5.8",
|
||||
"@formatjs/intl-localematcher": "^0.2.32",
|
||||
"@react-three/fiber": "^8.10.0",
|
||||
"@tauri-apps/api": "^2.0.0-alpha.5",
|
||||
"@tauri-apps/api": "^2.0.0-alpha.6",
|
||||
"@tauri-apps/plugin-app": "github:tauri-apps/tauri-plugin-app#v2",
|
||||
"@tauri-apps/plugin-dialog": "github:tauri-apps/tauri-plugin-dialog#v2",
|
||||
"@tauri-apps/plugin-fs": "github:tauri-apps/tauri-plugin-fs#v2",
|
||||
@@ -47,8 +47,8 @@
|
||||
"dev": "tauri dev",
|
||||
"skipbundler": "tauri build -b none",
|
||||
"tauri": "tauri",
|
||||
"lint": "eslint --max-warnings=0 \"src/**/*.{js,jsx,ts,tsx,json}\" && prettier --check \"src/**/*.{js,jsx,ts,tsx,css,md,json}\"",
|
||||
"lint:fix": "eslint --fix \"src/**/*.{js,jsx,ts,tsx,json}\"",
|
||||
"lint": "tsc --noEmit && eslint --max-warnings=0 \"src/**/*.{js,jsx,ts,tsx,json}\" && prettier --check \"src/**/*.{js,jsx,ts,tsx,css,md,json}\"",
|
||||
"lint:fix": "tsc --noEmit && eslint --fix --max-warnings=0 \"src/**/*.{js,jsx,ts,tsx,json}\" && npm run format",
|
||||
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,md,json}\"",
|
||||
"preview-vite": "vite preview",
|
||||
"javaversion-build": "cd src-tauri/src/ && javac JavaVersion.java && jar cvfe JavaVersion.jar JavaVersion JavaVersion.class"
|
||||
@@ -72,7 +72,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/forms": "^0.5.3",
|
||||
"@tauri-apps/cli": "^2.0.0-alpha.10",
|
||||
"@tauri-apps/cli": "^2.0.0-alpha.11",
|
||||
"@types/file-saver": "^2.0.5",
|
||||
"@types/react": "18.0.25",
|
||||
"@types/react-dom": "^18.0.5",
|
||||
|
||||
@@ -612,8 +612,8 @@ onboarding-assignment_tutorial = How to prepare a Slime Tracker before putting i
|
||||
onboarding-assignment_tutorial-first_step = 1. Place a body part sticker (if you have one) on the tracker according to your choosing
|
||||
# This text has a character limit of around 11 characters, so please keep it short
|
||||
onboarding-assignment_tutorial-sticker = Sticker
|
||||
onboarding-assignment_tutorial-second_step = 2. Attach the strap to your tracker, keeping the hook and loop side of the strap face in the following orientation:
|
||||
onboarding-assignment_tutorial-second_step-continuation = The hook and loop side for the extension should be in this orientation:
|
||||
onboarding-assignment_tutorial-second_step-v2 = 2. Attach the strap to your tracker, keeping the velcro side of the strap facing the same direction as the slime face of your tracker:
|
||||
onboarding-assignment_tutorial-second_step-continuation-v2 = The velcro side for the extension should be facing up like the following image:
|
||||
onboarding-assignment_tutorial-done = I put stickers and straps!
|
||||
|
||||
## Tracker assignment setup
|
||||
|
||||
@@ -21,15 +21,15 @@ default = ["custom-protocol"]
|
||||
custom-protocol = ["tauri/custom-protocol"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "2.0.0-alpha.6", features = [] }
|
||||
tauri-build = { version = "2.0.0-alpha.8", features = [] }
|
||||
cfg_aliases = "0.1"
|
||||
shadow-rs = "0.23"
|
||||
|
||||
[dependencies]
|
||||
serde_json = "1"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
tauri = { version = "2.0.0-alpha.10", features = ["devtools"] }
|
||||
tauri-runtime = "0.13.0-alpha.6"
|
||||
tauri = { version = "2.0.0-alpha.11", features = ["devtools"] }
|
||||
tauri-runtime = "1.0.0-alpha.0"
|
||||
tauri-plugin-dialog = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
|
||||
tauri-plugin-fs = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
|
||||
tauri-plugin-os = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
|
||||
|
||||
@@ -205,7 +205,7 @@ fn main() -> Result<()> {
|
||||
app.manage(Mutex::new(window_state));
|
||||
|
||||
if let Some((java_bin, p)) = server_info {
|
||||
let app_handle = app.app_handle();
|
||||
let app_handle = app.app_handle().clone();
|
||||
tauri::async_runtime::spawn(async move {
|
||||
use tauri_plugin_shell::{process::CommandEvent, ShellExt};
|
||||
|
||||
@@ -239,7 +239,7 @@ fn main() -> Result<()> {
|
||||
};
|
||||
app_handle
|
||||
.emit_all("server-status", emit_me)
|
||||
.expect("Failed to emit");
|
||||
.expect("Check server log files. \nFailed to emit");
|
||||
}
|
||||
log::error!("Java server receiver died");
|
||||
app_handle
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
import React from 'react';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import App from './App';
|
||||
|
||||
test('renders learn react link', () => {
|
||||
render(<App />);
|
||||
const linkElement = screen.getByText(/learn react/i);
|
||||
expect(linkElement).toBeInTheDocument();
|
||||
});
|
||||
@@ -3,10 +3,30 @@ import { ClearMountingResetRequestT, RpcMessage } from 'solarxr-protocol';
|
||||
import { useWebsocketAPI } from '../hooks/websocket-api';
|
||||
import { BigButton } from './commons/BigButton';
|
||||
import { TrashIcon } from './commons/icon/TrashIcon';
|
||||
import { useTrackers } from '../hooks/tracker';
|
||||
import { Quaternion } from 'three';
|
||||
import { QuaternionFromQuatT, similarQuaternions } from '../maths/quaternion';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
const _q = new Quaternion();
|
||||
|
||||
export function ClearMountingButton() {
|
||||
const { l10n } = useLocalization();
|
||||
const { sendRPCPacket } = useWebsocketAPI();
|
||||
const { useAssignedTrackers } = useTrackers();
|
||||
const assignedTrackers = useAssignedTrackers();
|
||||
|
||||
const trackerWithMounting = useMemo(
|
||||
() =>
|
||||
assignedTrackers.some(
|
||||
(d) =>
|
||||
!similarQuaternions(
|
||||
QuaternionFromQuatT(d?.tracker.info?.mountingResetOrientation),
|
||||
_q
|
||||
)
|
||||
),
|
||||
[assignedTrackers]
|
||||
);
|
||||
|
||||
const clearMounting = () => {
|
||||
const record = new ClearMountingResetRequestT();
|
||||
@@ -18,8 +38,7 @@ export function ClearMountingButton() {
|
||||
text={l10n.getString('widget-clear_mounting')}
|
||||
icon={<TrashIcon width={20} />}
|
||||
onClick={clearMounting}
|
||||
>
|
||||
{}
|
||||
</BigButton>
|
||||
disabled={!trackerWithMounting}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -12,7 +12,7 @@ export function NumberSelector({
|
||||
step,
|
||||
disabled = false,
|
||||
}: {
|
||||
label: string;
|
||||
label?: string;
|
||||
valueLabelFormat?: (value: number) => string;
|
||||
control: Control<any>;
|
||||
name: string;
|
||||
|
||||
@@ -44,7 +44,7 @@ export function AssignmentTutorialPage() {
|
||||
<div>
|
||||
<Typography variant="section-title">
|
||||
{l10n.getString(
|
||||
'onboarding-assignment_tutorial-second_step'
|
||||
'onboarding-assignment_tutorial-second_step-v2'
|
||||
)}
|
||||
</Typography>
|
||||
</div>
|
||||
@@ -54,7 +54,7 @@ export function AssignmentTutorialPage() {
|
||||
<div>
|
||||
<Typography variant="section-title">
|
||||
{l10n.getString(
|
||||
'onboarding-assignment_tutorial-second_step-continuation'
|
||||
'onboarding-assignment_tutorial-second_step-continuation-v2'
|
||||
)}
|
||||
</Typography>
|
||||
</div>
|
||||
|
||||
@@ -45,18 +45,21 @@ interface FlatDeviceTrackerDummy {
|
||||
export function TrackersAssignPage() {
|
||||
const { isMobile } = useBreakpoint('mobile');
|
||||
const { l10n } = useLocalization();
|
||||
const { config, setConfig } = useConfig();
|
||||
const { useAssignedTrackers, trackers } = useTrackers();
|
||||
const { applyProgress, state } = useOnboarding();
|
||||
const { sendRPCPacket, useRPCPacket } = useWebsocketAPI();
|
||||
|
||||
const { control, watch } = useForm<{ advanced: boolean }>({
|
||||
defaultValues: { advanced: false },
|
||||
defaultValues: { advanced: config?.advancedAssign ?? false },
|
||||
});
|
||||
const { advanced } = watch();
|
||||
const [selectedRole, setSelectRole] = useState<BodyPart>(BodyPart.NONE);
|
||||
const assignedTrackers = useAssignedTrackers();
|
||||
useEffect(() => {
|
||||
setConfig({ advancedAssign: advanced });
|
||||
}, [advanced]);
|
||||
|
||||
const { config } = useConfig();
|
||||
const [tapDetectionSettings, setTapDetectionSettings] = useState<Omit<
|
||||
TapDetectionSettingsT,
|
||||
'pack'
|
||||
|
||||
@@ -78,7 +78,7 @@ interface SettingsForm {
|
||||
yawResetTaps: number;
|
||||
fullResetTaps: number;
|
||||
mountingResetTaps: number;
|
||||
numberTrackersOverThreshold;
|
||||
numberTrackersOverThreshold: number;
|
||||
};
|
||||
legTweaks: {
|
||||
correctionStrength: number;
|
||||
|
||||
@@ -22,6 +22,7 @@ export interface Config {
|
||||
theme: string;
|
||||
textSize: number;
|
||||
fonts: string[];
|
||||
advancedAssign: boolean;
|
||||
}
|
||||
|
||||
export interface ConfigContext {
|
||||
@@ -41,6 +42,7 @@ export const defaultConfig = {
|
||||
theme: 'slime',
|
||||
textSize: 12,
|
||||
fonts: ['poppins'],
|
||||
advancedAssign: false,
|
||||
};
|
||||
|
||||
function fallbackToDefaults(loadedConfig: any): Config {
|
||||
|
||||
@@ -11,7 +11,7 @@ export function useCountdown({
|
||||
}) {
|
||||
const [isCounting, setIsCounting] = useState(false);
|
||||
const [timer, setDisplayTimer] = useState(0);
|
||||
const countdownTimer = useRef<NodeJS.Timer>();
|
||||
const countdownTimer = useRef<NodeJS.Timeout>();
|
||||
const counter = useRef(0);
|
||||
|
||||
const startCountdown = () => {
|
||||
|
||||
@@ -132,7 +132,7 @@ export function parseStatusToLocale(
|
||||
}
|
||||
case StatusData.StatusTrackerError: {
|
||||
const data = status.data as StatusTrackerErrorT;
|
||||
if (!data.trackerId?.trackerNum || !trackers) {
|
||||
if (data.trackerId?.trackerNum === undefined || !trackers) {
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import { ReportHandler } from 'web-vitals';
|
||||
|
||||
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
|
||||
if (onPerfEntry && onPerfEntry instanceof Function) {
|
||||
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
|
||||
getCLS(onPerfEntry);
|
||||
getFID(onPerfEntry);
|
||||
getFCP(onPerfEntry);
|
||||
getLCP(onPerfEntry);
|
||||
getTTFB(onPerfEntry);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export default reportWebVitals;
|
||||
Generated
+892
-152
File diff suppressed because it is too large.
Load diff
+2
-1
@@ -15,6 +15,7 @@
|
||||
"prepare": "husky install && npm run update-solarxr"
|
||||
},
|
||||
"devDependencies": {
|
||||
"husky": "^8.0.3"
|
||||
"husky": "^8.0.3",
|
||||
"lint-staged": "^13.2.3"
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,6 @@
|
||||
package dev.slimevr.osc;
|
||||
|
||||
import com.illposed.osc.OSCSerializerAndParserBuilder;
|
||||
import com.illposed.osc.argument.ArgumentHandler;
|
||||
import com.illposed.osc.argument.handler.Activator;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class OSCStatic {
|
||||
@@ -12,18 +8,10 @@ public class OSCStatic {
|
||||
|
||||
static {
|
||||
// Really hacky workaround for getting the OSC library to work on
|
||||
// Android
|
||||
// (Removes reference to java.awt.Color)
|
||||
// https://github.com/hoijui/JavaOSC/issues/60#issuecomment-960713779
|
||||
// Android (Removes reference to java.awt.Color)
|
||||
OSCSerializerAndParserBuilder serializer = new OSCSerializerAndParserBuilder();
|
||||
serializer.setUsingDefaultHandlers(false);
|
||||
List<ArgumentHandler> defaultParserTypes = Activator.createSerializerTypes();
|
||||
defaultParserTypes.remove(16);
|
||||
char typeChar = 'a';
|
||||
for (ArgumentHandler argumentHandler : defaultParserTypes) {
|
||||
serializer.registerArgumentHandler(argumentHandler, typeChar);
|
||||
typeChar++;
|
||||
}
|
||||
serializer.setUsingDefaultHandlers(true);
|
||||
serializer.unregisterArgumentHandler('r');
|
||||
|
||||
OSCStatic.serializer = serializer;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,13 @@ abstract class SerialHandler {
|
||||
Pair(0x10C4, 0xEA60),
|
||||
// / Espressif
|
||||
// ESP32-C3
|
||||
Pair(0x303A, 0x1001)
|
||||
Pair(0x303A, 0x1001),
|
||||
// / FTDI
|
||||
// FT232BM/L/Q, FT245BM/L/Q
|
||||
// FT232RL/Q, FT245RL/Q
|
||||
// VNC1L with VDPS Firmware
|
||||
// VNC2 with FT232Slave
|
||||
Pair(0x0403, 0x6001)
|
||||
)
|
||||
fun isKnownBoard(port: SerialPort): Boolean =
|
||||
supportedSerial.contains(Pair(port.vendorId, port.productId))
|
||||
|
||||
+8
-2
@@ -1199,12 +1199,16 @@ public class HumanSkeleton {
|
||||
.getLocalTransform()
|
||||
.setTranslation(offset);
|
||||
case LEFT_UPPER_ARM -> {
|
||||
if (!isTrackingLeftArmFromController()) {
|
||||
if (isTrackingLeftArmFromController()) {
|
||||
leftElbowNode.getLocalTransform().setTranslation(Vector3.Companion.getNULL());
|
||||
} else {
|
||||
leftElbowNode.getLocalTransform().setTranslation(offset);
|
||||
}
|
||||
}
|
||||
case RIGHT_UPPER_ARM -> {
|
||||
if (!isTrackingRightArmFromController()) {
|
||||
if (isTrackingRightArmFromController()) {
|
||||
rightElbowNode.getLocalTransform().setTranslation(Vector3.Companion.getNULL());
|
||||
} else {
|
||||
rightElbowNode.getLocalTransform().setTranslation(offset);
|
||||
}
|
||||
}
|
||||
@@ -1254,6 +1258,8 @@ public class HumanSkeleton {
|
||||
humanPoseManager.computeNodeOffset(BoneType.RIGHT_UPPER_ARM);
|
||||
humanPoseManager.computeNodeOffset(BoneType.LEFT_LOWER_ARM);
|
||||
humanPoseManager.computeNodeOffset(BoneType.RIGHT_LOWER_ARM);
|
||||
humanPoseManager.computeNodeOffset(BoneType.LEFT_HAND);
|
||||
humanPoseManager.computeNodeOffset(BoneType.RIGHT_HAND);
|
||||
}
|
||||
|
||||
public TransformNode getTailNodeOfBone(BoneType bone) {
|
||||
|
||||
Reference in new issue
Block a user