From 555014cf3680d9a6bc9eea1398c9465861248ca1 Mon Sep 17 00:00:00 2001 From: Hyblocker Date: Fri, 11 Feb 2022 02:00:31 +0100 Subject: [PATCH] Initial commit --- .gitignore | 488 +++++++++ .gitmodules | 3 + AugmentedHip.sln | 31 + AugmentedHip/AbstractDevice.h | 29 + AugmentedHip/AugmentedHip.vcxproj | 218 ++++ AugmentedHip/AugmentedHip.vcxproj.filters | 87 ++ AugmentedHip/AugmentedHipDevice.cpp | 408 +++++++ AugmentedHip/AugmentedHipDevice.h | 94 ++ AugmentedHip/AugmentedHipSettings.h | 46 + AugmentedHip/DeviceProvider.cpp | 77 ++ AugmentedHip/DeviceProvider.h | 26 + AugmentedHip/IK/FABRIKSolver.cpp | 135 +++ AugmentedHip/IK/FABRIKSolver.h | 35 + AugmentedHip/IK/Transform.cpp | 2 + AugmentedHip/IK/Transform.h | 57 + AugmentedHip/basis.cpp | 1139 ++++++++++++++++++++ AugmentedHip/basis.h | 300 ++++++ AugmentedHip/driverlog.cpp | 59 + AugmentedHip/driverlog.h | 25 + AugmentedHip/drivermain.cpp | 24 + AugmentedHip/quat.cpp | 218 ++++ AugmentedHip/quat.h | 265 +++++ AugmentedHip/quaternion.h | 114 ++ AugmentedHip/shared.h | 130 +++ AugmentedHip/util.h | 47 + AugmentedHip/vector3.cpp | 119 ++ AugmentedHip/vector3.h | 420 ++++++++ LICENSE | 674 ++++++++++++ README.md | 90 ++ assets/driver.vrdrivermanifest | 10 + assets/resources/driver.vrresources | 6 + assets/resources/input/remote_profile.json | 20 + github/banner.png | Bin 0 -> 52179 bytes github/icon.png | Bin 0 -> 38045 bytes openvr | 1 + 35 files changed, 5397 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 AugmentedHip.sln create mode 100644 AugmentedHip/AbstractDevice.h create mode 100644 AugmentedHip/AugmentedHip.vcxproj create mode 100644 AugmentedHip/AugmentedHip.vcxproj.filters create mode 100644 AugmentedHip/AugmentedHipDevice.cpp create mode 100644 AugmentedHip/AugmentedHipDevice.h create mode 100644 AugmentedHip/AugmentedHipSettings.h create mode 100644 AugmentedHip/DeviceProvider.cpp create mode 100644 AugmentedHip/DeviceProvider.h create mode 100644 AugmentedHip/IK/FABRIKSolver.cpp create mode 100644 AugmentedHip/IK/FABRIKSolver.h create mode 100644 AugmentedHip/IK/Transform.cpp create mode 100644 AugmentedHip/IK/Transform.h create mode 100644 AugmentedHip/basis.cpp create mode 100644 AugmentedHip/basis.h create mode 100644 AugmentedHip/driverlog.cpp create mode 100644 AugmentedHip/driverlog.h create mode 100644 AugmentedHip/drivermain.cpp create mode 100644 AugmentedHip/quat.cpp create mode 100644 AugmentedHip/quat.h create mode 100644 AugmentedHip/quaternion.h create mode 100644 AugmentedHip/shared.h create mode 100644 AugmentedHip/util.h create mode 100644 AugmentedHip/vector3.cpp create mode 100644 AugmentedHip/vector3.h create mode 100644 LICENSE create mode 100644 README.md create mode 100644 assets/driver.vrdrivermanifest create mode 100644 assets/resources/driver.vrresources create mode 100644 assets/resources/input/remote_profile.json create mode 100644 github/banner.png create mode 100644 github/icon.png create mode 160000 openvr diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..721a166 --- /dev/null +++ b/.gitignore @@ -0,0 +1,488 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml + + +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + + +# Object files +*.ko +*.elf + +# Linker output +*.ilk +*.map +*.exp + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lo + +# Shared objects (inc. Windows DLLs) +*.so.* + +# Executables +*.i*86 +*.x86_64 +*.hex + +# Debug files +*.dSYM/ +*.su +*.idb +*.pdb + +# Kernel Module Compile Results +*.mod* +*.cmd +.tmp_versions/ +modules.order +Module.symvers +Mkfile.old +dkms.conf + +# CMake +CMakeLists.txt.user +CMakeCache.txt +CMakeFiles +CMakeScripts +Testing +Makefile +cmake_install.cmake +install_manifest.txt +compile_commands.json +CTestTestfile.cmake +_deps + +# OpenVR driver directory +driver/ \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..7bf82e7 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "openvr"] + path = openvr + url = https://github.com/ValveSoftware/openvr.git diff --git a/AugmentedHip.sln b/AugmentedHip.sln new file mode 100644 index 0000000..a701833 --- /dev/null +++ b/AugmentedHip.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31402.337 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AugmentedHip", "AugmentedHip\AugmentedHip.vcxproj", "{4CB78C73-BC6E-4E50-A626-79CD4C45706A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4CB78C73-BC6E-4E50-A626-79CD4C45706A}.Debug|x64.ActiveCfg = Debug|x64 + {4CB78C73-BC6E-4E50-A626-79CD4C45706A}.Debug|x64.Build.0 = Debug|x64 + {4CB78C73-BC6E-4E50-A626-79CD4C45706A}.Debug|x86.ActiveCfg = Debug|Win32 + {4CB78C73-BC6E-4E50-A626-79CD4C45706A}.Debug|x86.Build.0 = Debug|Win32 + {4CB78C73-BC6E-4E50-A626-79CD4C45706A}.Release|x64.ActiveCfg = Release|x64 + {4CB78C73-BC6E-4E50-A626-79CD4C45706A}.Release|x64.Build.0 = Release|x64 + {4CB78C73-BC6E-4E50-A626-79CD4C45706A}.Release|x86.ActiveCfg = Release|Win32 + {4CB78C73-BC6E-4E50-A626-79CD4C45706A}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {BA14BC94-5482-4BA7-93E1-D939FCB04DA9} + EndGlobalSection +EndGlobal diff --git a/AugmentedHip/AbstractDevice.h b/AugmentedHip/AbstractDevice.h new file mode 100644 index 0000000..59d79a6 --- /dev/null +++ b/AugmentedHip/AbstractDevice.h @@ -0,0 +1,29 @@ +#pragma once + +#include +#include "driverlog.h" +#include "util.h" + +class AbstractDevice : public vr::ITrackedDeviceServerDriver { +protected: + vr::TrackedDeviceIndex_t m_unObjectId; + vr::PropertyContainerHandle_t m_ulPropertyContainer; + + std::string m_sSerialNumber; + std::string m_sModelNumber; + +public: + virtual vr::EVRInitError Activate(vr::TrackedDeviceIndex_t unObjectId) = 0; + virtual void Deactivate() = 0; + virtual void EnterStandby() = 0; + virtual void* GetComponent(const char* pchComponentNameAndVersion) = 0; + virtual void PowerOff() = 0; + virtual void DebugRequest(const char* pchRequest, char* pchResponseBuffer, uint32_t unResponseBufferSize) = 0; + virtual vr::DriverPose_t GetPose() = 0; + virtual void RunFrame(vr::TrackedDevicePose_t* poses) = 0; + virtual void ProcessEvent(const vr::VREvent_t& vrEvent) = 0; + + virtual const char* GetModelNumber() const = 0; + virtual const char* GetSerialNumber() const = 0; + virtual const char* GetId() const = 0; +}; diff --git a/AugmentedHip/AugmentedHip.vcxproj b/AugmentedHip/AugmentedHip.vcxproj new file mode 100644 index 0000000..b35b918 --- /dev/null +++ b/AugmentedHip/AugmentedHip.vcxproj @@ -0,0 +1,218 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {4cb78c73-bc6e-4e50-a626-79cd4c45706a} + AugmentedHip + 10.0 + + + + DynamicLibrary + true + v142 + Unicode + + + DynamicLibrary + false + v142 + true + Unicode + + + DynamicLibrary + true + v142 + Unicode + + + DynamicLibrary + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)$(ProjectName)\$(Configuration)\$(Platform) + + + false + $(SolutionDir)$(ProjectName)\$(Configuration)\$(Platform) + + + true + $(SolutionDir)$(ProjectName)\$(Configuration)\$(Platform) + + + false + $(SolutionDir)$(ProjectName)\$(Configuration)\$(Platform) + + + + Level3 + true + WIN32;_DEBUG;AUGMENTEDHIP_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + NotUsing + pch.h + $(SolutionDir)openvr\headers;%(AdditionalIncludeDirectories) + + + Windows + true + false + $(SolutionDir)openvr\lib\win32\openvr_api.lib;%(AdditionalDependencies) + + + copy /y "$(SolutionDir)$(ProjectName)\$(Configuration)\$(Platform)\$(ProjectName).dll" "$(SolutionDir)driver\bin\win32\driver_$(ProjectName).dll" + + + xcopy /s /e /Y "$(SolutionDir)assets\" "$(SolutionDir)driver\" + + + + + Level3 + true + true + true + WIN32;NDEBUG;AUGMENTEDHIP_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + NotUsing + pch.h + $(SolutionDir)openvr\headers;%(AdditionalIncludeDirectories) + + + Windows + true + true + true + false + $(SolutionDir)openvr\lib\win32\openvr_api.lib;%(AdditionalDependencies) + + + copy /y "$(SolutionDir)$(ProjectName)\$(Configuration)\$(Platform)\$(ProjectName).dll" "$(SolutionDir)driver\bin\win32\driver_$(ProjectName).dll" + + + xcopy /s /e /Y "$(SolutionDir)assets\" "$(SolutionDir)driver\" + + + + + Level3 + true + _DEBUG;AUGMENTEDHIP_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + NotUsing + pch.h + $(SolutionDir)openvr\headers;%(AdditionalIncludeDirectories) + + + Windows + true + false + $(SolutionDir)openvr\lib\win64\openvr_api.lib;%(AdditionalDependencies) + + + copy /y "$(SolutionDir)$(ProjectName)\$(Configuration)\$(Platform)\$(ProjectName).dll" "$(SolutionDir)driver\bin\win64\driver_$(ProjectName).dll" + + + xcopy /s /e /Y "$(SolutionDir)assets\" "$(SolutionDir)driver\" + + + + + Level3 + true + true + true + NDEBUG;AUGMENTEDHIP_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + NotUsing + pch.h + $(SolutionDir)openvr\headers;%(AdditionalIncludeDirectories) + + + Windows + true + true + true + false + $(SolutionDir)openvr\lib\win64\openvr_api.lib;%(AdditionalDependencies) + + + copy /y "$(SolutionDir)$(ProjectName)\$(Configuration)\$(Platform)\$(ProjectName).dll" "$(SolutionDir)driver\bin\win64\driver_$(ProjectName).dll" + + + xcopy /s /e /Y "$(SolutionDir)assets\" "$(SolutionDir)driver\" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AugmentedHip/AugmentedHip.vcxproj.filters b/AugmentedHip/AugmentedHip.vcxproj.filters new file mode 100644 index 0000000..adeed37 --- /dev/null +++ b/AugmentedHip/AugmentedHip.vcxproj.filters @@ -0,0 +1,87 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/AugmentedHip/AugmentedHipDevice.cpp b/AugmentedHip/AugmentedHipDevice.cpp new file mode 100644 index 0000000..2cbf27a --- /dev/null +++ b/AugmentedHip/AugmentedHipDevice.cpp @@ -0,0 +1,408 @@ +#include "AugmentedHipDevice.h" + +AugmentedHipDevice::AugmentedHipDevice( + const int& id_v, + AugmentedHipSettings settings_v +) + : + settings(settings_v), + id(id_v) +{ + m_unObjectId = vr::k_unTrackedDeviceIndexInvalid; + m_ulPropertyContainer = vr::k_ulInvalidPropertyContainer; + + m_sSerialNumber = "AUG_HIP_" + std::to_string(id); + m_sModelNumber = "AUGMNT_HIP_" + std::to_string(id); + + // Init FABRIK solvers + headChainSolver.Resize(3); + rightLegChainSolver.Resize(3); + leftLegChainSolver.Resize(3); +} + +AugmentedHipDevice::~AugmentedHipDevice() +{ + +} + +vr::EVRInitError AugmentedHipDevice::Activate(vr::TrackedDeviceIndex_t unObjectId) +{ + vr::VRSettings()->SetString(vr::k_pch_Trackers_Section, ("/devices/htc/vive_tracker" + m_sSerialNumber).c_str(), "TrackerRole_Waist"); + + // Taken from https://github.com/KinectToVR/k2vr-application/blob/dff6aa8deee966d5fe9fba93fbacbd59343fedba/driver_KinectToVR/K2Tracker.cpp#L159 + + m_unObjectId = unObjectId; + m_ulPropertyContainer = vr::VRProperties()->TrackedDeviceToPropertyContainer(m_unObjectId); + augHipSerialCode = "htc/vive_tracker" + m_sSerialNumber; + + // strings for this to use the vive puck render model + vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_ResourceRoot_String, "htc"); + vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_ManufacturerName_String, "HTC"); + vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_ModelNumber_String, "Vive. Tracker PVT"); + vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_RenderModelName_String, "{htc}vr_tracker_vive_1_0"); + + // Tracker type + vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, vr::Prop_NeverTracked_Bool, false); + vr::VRProperties()->SetInt32Property(m_ulPropertyContainer, vr::Prop_DeviceClass_Int32, vr::TrackedDeviceClass_GenericTracker); + + // register as a vive tracker + vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_RegisteredDeviceType_String, augHipSerialCode.c_str()); + vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_InputProfilePath_String, "{htc}/input/tracker/waist_profile.json"); + + // Properties to make this appear as though it were a real vive tracker, but not actually offer things like firmware updates + vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, vr::Prop_Identifiable_Bool, true); + vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, vr::Prop_Firmware_RemindUpdate_Bool, false); + vr::VRProperties()->SetInt32Property(m_ulPropertyContainer, vr::Prop_ControllerRoleHint_Int32, vr::TrackedControllerRole_Invalid); // should this be OptOut? see IsRoleAllowedAsHand + + // Set role to waist tracker + vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_ControllerType_String, "vive_tracker_waist"); + + vr::VRProperties()->SetInt32Property(m_ulPropertyContainer, vr::Prop_ControllerHandSelectionPriority_Int32, -1); + + // Disable HMD specific props; this is a tracker + vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, vr::Prop_HasDisplayComponent_Bool, false); + vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, vr::Prop_HasCameraComponent_Bool, false); + vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, vr::Prop_HasDriverDirectModeComponent_Bool, false); + vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, vr::Prop_HasVirtualDisplayComponent_Bool, false); + + vr::VRProperties()->SetUint64Property(m_ulPropertyContainer, vr::Prop_CurrentUniverseId_Uint64, 2); + + // Battery + vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, vr::Prop_DeviceProvidesBatteryStatus_Bool, true); + vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, vr::Prop_DeviceCanPowerOff_Bool, true); + vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, vr::Prop_DeviceIsCharging_Bool, false); + vr::VRProperties()->SetFloatProperty(m_ulPropertyContainer, vr::Prop_DeviceBatteryPercentage_Float, 1); + + // Wireless + vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, vr::Prop_DeviceIsWireless_Bool, true); + vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_ConnectedWirelessDongle_String, "D0000BE000"); + + // "Firmware" + vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, vr::Prop_WillDriftInYaw_Bool, false); + vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_TrackingFirmwareVersion_String, + "1541800000 RUNNER-WATCHMAN$runner-watchman@runner-watchman 2018-01-01 FPGA 512(2.56/0/0) BL 0 VRC 1541800000 Radio 1518800000"); + vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_HardwareRevision_String, + "product 128 rev 2.5.6 lot 2000/0/0 0"); + + // Updating stuff + vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, vr::Prop_Firmware_UpdateAvailable_Bool, false); + vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, vr::Prop_Firmware_ManualUpdate_Bool, false); + vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_Firmware_ManualUpdateURL_String, + "https://developer.valvesoftware.com/wiki/SteamVR/HowTo_Update_Firmware"); + vr::VRProperties()->SetUint64Property(m_ulPropertyContainer, vr::Prop_HardwareRevision_Uint64, 2214720000); + vr::VRProperties()->SetUint64Property(m_ulPropertyContainer, vr::Prop_FirmwareVersion_Uint64, 1541800000); + vr::VRProperties()->SetUint64Property(m_ulPropertyContainer, vr::Prop_FPGAVersion_Uint64, 512); + vr::VRProperties()->SetUint64Property(m_ulPropertyContainer, vr::Prop_VRCVersion_Uint64, 1514800000); + vr::VRProperties()->SetUint64Property(m_ulPropertyContainer, vr::Prop_RadioVersion_Uint64, 1518800000); + vr::VRProperties()->SetUint64Property(m_ulPropertyContainer, vr::Prop_DongleVersion_Uint64, 8933539758); + + // YOU CAN'T VIBRATE THE AIR UNLESS YOU'RE LISTENING TO REALLY LOUD DRUM AND BASS!!!! + vr::VRProperties()->SetBoolProperty(m_ulPropertyContainer, vr::Prop_Identifiable_Bool, false); + + // Vive tracker icons + vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceOff_String, + "{htc}/icons/tracker_status_off.png"); + vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceSearching_String, + "{htc}/icons/tracker_status_searching.gif"); + vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceSearchingAlert_String, + "{htc}/icons/tracker_status_searching_alert.gif"); + vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceReady_String, + "{htc}/icons/tracker_status_ready.png"); + vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceReadyAlert_String, + "{htc}/icons/tracker_status_ready_alert.png"); + vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceNotReady_String, + "{htc}/icons/tracker_status_error.png"); + vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceStandby_String, + "{htc}/icons/tracker_status_standby.png"); + vr::VRProperties()->SetStringProperty(m_ulPropertyContainer, vr::Prop_NamedIconPathDeviceAlertLow_String, + "{htc}/icons/tracker_status_ready_low.png"); + + // vr::VRDriverInput()->CreateHapticComponent(m_ulPropertyContainer, "/output/haptic", &haptic); + + activated = true; + + return vr::VRInitError_None; +} + +void AugmentedHipDevice::Deactivate() +{ + m_unObjectId = vr::k_unTrackedDeviceIndexInvalid; +} + +void AugmentedHipDevice::EnterStandby() {} + +void* AugmentedHipDevice::GetComponent(const char* pchComponentNameAndVersion) +{ + // override this to add a component to a driver + return NULL; +} + +void AugmentedHipDevice::PowerOff() {} + +void AugmentedHipDevice::DebugRequest(const char* pchRequest, char* pchResponseBuffer, uint32_t unResponseBufferSize) {} + +// Stolen from owotrack +vr::DriverPose_t AugmentedHipDevice::GetPose() +{ + vr::DriverPose_t pose = { 0 }; + pose.poseIsValid = false; + pose.result = vr::TrackingResult_Calibrating_OutOfRange; + pose.deviceIsConnected = false; + + pose.vecPosition[0] = 9999999; + pose.vecPosition[1] = 9999999; + pose.vecPosition[2] = 9999999; + + pose.vecVelocity[0] = 0.0; + pose.vecVelocity[1] = 0.0; + pose.vecVelocity[2] = 0.0; + + pose.qWorldFromDriverRotation = quaternion::init(0, 0, 0, 1); + pose.qDriverFromHeadRotation = quaternion::init(0, 0, 0, 1); + + return pose; +} + + +void AugmentedHipDevice::send_invalid_pose() { + vr::DriverPose_t pose = GetPose(); + + vr::VRServerDriverHost()->TrackedDevicePoseUpdated(m_unObjectId, pose, sizeof(pose)); +} + +void AugmentedHipDevice::RunFrame(vr::TrackedDevicePose_t* poses) { + if (!activated) return; + + vr::DriverPose_t pose = { 0 }; + pose.poseIsValid = true; + pose.result = vr::TrackingResult_Running_OK; + pose.deviceIsConnected = true; + + int trackedDevicePositionContributorCount = 0; + + // Find the trackers we want to pull off this algorithm + for (int i = 0; i < vr::k_unMaxTrackedDeviceCount; i++) { + if (poses[i].bDeviceIsConnected && poses[i].bPoseIsValid) { + auto balls = vr::VRProperties()->TrackedDeviceToPropertyContainer(i); + auto deviceID = vr::VRProperties()->GetInt32Property(balls, vr::Prop_DeviceClass_Int32); + auto ballsHD_RTX = vr::VRProperties()->GetStringProperty(balls, vr::Prop_RegisteredDeviceType_String); + + switch (deviceID) { + case vr::TrackedDeviceClass_GenericTracker: + if (ballsHD_RTX != augHipSerialCode) { + + // Generic tracker + auto trackerRole = vr::VRProperties()->GetStringProperty(balls, vr::Prop_ControllerType_String); + + if (trackerRole == "vive_tracker_left_foot") + { + left_tracker = from_hmdMatrix(poses[i].mDeviceToAbsoluteTracking).get_rotation_quat(); + + left_leg_pos.x = poses[i].mDeviceToAbsoluteTracking.m[0][3]; + left_leg_pos.y = poses[i].mDeviceToAbsoluteTracking.m[1][3]; + left_leg_pos.z = poses[i].mDeviceToAbsoluteTracking.m[2][3]; + } + else if (trackerRole == "vive_tracker_right_foot") { + + right_tracker = from_hmdMatrix(poses[i].mDeviceToAbsoluteTracking).get_rotation_quat(); + + right_leg_pos.x = poses[i].mDeviceToAbsoluteTracking.m[0][3]; + right_leg_pos.y = poses[i].mDeviceToAbsoluteTracking.m[1][3]; + right_leg_pos.z = poses[i].mDeviceToAbsoluteTracking.m[2][3]; + } + + pose.vecPosition[0] += poses[i].mDeviceToAbsoluteTracking.m[0][3]; + pose.vecPosition[1] += poses[i].mDeviceToAbsoluteTracking.m[1][3]; + pose.vecPosition[2] += poses[i].mDeviceToAbsoluteTracking.m[2][3]; + + trackedDevicePositionContributorCount++; + + } + break; + case vr::TrackedDeviceClass_Controller: + // A controller + break; + case vr::TrackedDeviceClass_HMD: + + // HMD + + Basis offset_basis; + offset_basis.set( + poses[i].mDeviceToAbsoluteTracking.m[0][0], + poses[i].mDeviceToAbsoluteTracking.m[0][1], + poses[i].mDeviceToAbsoluteTracking.m[0][2], + poses[i].mDeviceToAbsoluteTracking.m[1][0], + poses[i].mDeviceToAbsoluteTracking.m[1][1], + poses[i].mDeviceToAbsoluteTracking.m[1][2], + poses[i].mDeviceToAbsoluteTracking.m[2][0], + poses[i].mDeviceToAbsoluteTracking.m[2][1], + poses[i].mDeviceToAbsoluteTracking.m[2][2] + ); + + Quat quat = from_hmdMatrix(poses[i].mDeviceToAbsoluteTracking).get_rotation_quat(); + + hmd_tracker = from_hmdMatrix(poses[i].mDeviceToAbsoluteTracking).get_rotation_quat(); + + pose.vecPosition[0] += poses[i].mDeviceToAbsoluteTracking.m[0][3]; + pose.vecPosition[1] += poses[i].mDeviceToAbsoluteTracking.m[1][3]; + pose.vecPosition[2] += poses[i].mDeviceToAbsoluteTracking.m[2][3]; + + hmd_pos.x = poses[i].mDeviceToAbsoluteTracking.m[0][3]; + hmd_pos.y = poses[i].mDeviceToAbsoluteTracking.m[1][3]; + hmd_pos.z = poses[i].mDeviceToAbsoluteTracking.m[2][3]; + + trackedDevicePositionContributorCount++; + + break; + } + } + } + + // If we have less than 3 devices then disable the tracker + if (trackedDevicePositionContributorCount < 3) { + // identity rotation + pose.qRotation = quaternion::init(0,0,0,1); + + // fallback with hmd rotation + pose.vecPosition[0] = hmd_pos.x; + pose.vecPosition[1] = hmd_pos.y; + pose.vecPosition[2] = hmd_pos.z; + + // "hip offset" + Vector3 rotatedOffsetFromHead = hip_tracker.xform(settings.offset_local_tracker); + pose.vecPosition[0] += rotatedOffsetFromHead.x; + pose.vecPosition[1] += rotatedOffsetFromHead.y; + pose.vecPosition[2] += rotatedOffsetFromHead.z; + + // deactivate + send_invalid_pose(); + return; + } else { + + // automagically try calibrating our height + AutoCalibHeight(); + + // average orientation of legs + balls_tracker = left_tracker.slerp(right_tracker, 0.5); + + Quat final_hip_rot; + final_hip_rot = balls_tracker; + final_hip_rot *= Quat(Vector3(Math_PI/2.0, Math_PI, 0)); + final_hip_rot.normalize(); + +#define PrtVec3(vec) ("{ x: " + std::to_string(vec.x) + " y: " + std::to_string(vec.y) + " z: " + std::to_string(vec.z) + " }") + + double delta = left_tracker.dot(right_tracker); + + // Calculate the average position of the trackers to get a REALLY rough estimate as to hip position + // This will get refined in the IK pass below + pose.vecPosition[0] /= trackedDevicePositionContributorCount; + pose.vecPosition[1] /= trackedDevicePositionContributorCount; + pose.vecPosition[2] /= trackedDevicePositionContributorCount; + + // Prepare for Inverse Kinematics + Transform headBone = Transform(hmd_pos); + Transform leftLegBone = Transform(left_leg_pos); + Transform rightLegBone = Transform(right_leg_pos); + Vector3 hipPosition = Vector3(pose.vecPosition[0], pose.vecPosition[1], pose.vecPosition[2]); + Transform targetTransform = Transform(hipPosition); + +#define CalcBone(bone, rot, delta) Transform(delta * Vector3(0, 1, 0)) + + auto waistTrans = CalcBone(headBone, hmd_tracker, -SPINE_HEIGHT * getHeightRatio()); + auto waistEstimate = hmd_pos + waistTrans.position; + + // Inverse painematics + headChainSolver.SetLocalTransform(0, headBone); // head + headChainSolver.SetLocalTransform(1, CalcBone(headBone, hmd_tracker, -NECK_HEIGHT * getHeightRatio())); // neck + headChainSolver.SetLocalTransform(2, CalcBone(headBone, hmd_tracker, -SPINE_HEIGHT * getHeightRatio())); // "hip" + headChainSolver.Solve(targetTransform); + + rightLegChainSolver.SetLocalTransform(0, rightLegBone); // foot + rightLegChainSolver.SetLocalTransform(1, rightLegBone.lerp(rightLegBone, hipPosition, LOWER_LEG_HEIGHT* getHeightRatio()) - rightLegBone); // knee + rightLegChainSolver.SetLocalTransform(2, rightLegBone.lerp(rightLegBone, hipPosition, THIGH_HEIGHT* getHeightRatio()) - rightLegBone); // "hip" + rightLegChainSolver.Solve(targetTransform); + + leftLegChainSolver.SetLocalTransform(0, leftLegBone); // foot + leftLegChainSolver.SetLocalTransform(1, leftLegBone.lerp(leftLegBone, hipPosition, LOWER_LEG_HEIGHT* getHeightRatio()) - leftLegBone); // knee + leftLegChainSolver.SetLocalTransform(2, leftLegBone.lerp(leftLegBone, hipPosition, THIGH_HEIGHT* getHeightRatio()) - leftLegBone); // "hip" + leftLegChainSolver.Solve(targetTransform); + + // apply IK pos + Vector3 trackerPos = headChainSolver.GetGlobalTransform(2).position * 0.5; + trackerPos += rightLegChainSolver.GetGlobalTransform(2).position * 0.25; + trackerPos += leftLegChainSolver.GetGlobalTransform(2).position * 0.25; + + pose.vecPosition[0] = trackerPos.x; + pose.vecPosition[1] = trackerPos.y; + pose.vecPosition[2] = trackerPos.z; + + // rotation + + // leg directions + Vector3 leftLegDir = (trackerPos - left_leg_pos).normalized(); + Vector3 rightLegDir = (trackerPos - right_leg_pos).normalized(); + + // since we dont actually have a spine direction with this IK rig, we have to guess it using the hmd position... + Vector3 spineDir = (trackerPos - hmd_pos).normalized(); + spineDir = final_hip_rot.xform(Vector3(0, 1, 0)).normalized(); + + // hip tracker direction + Vector3 roughAngle = leftLegDir.cross(rightLegDir).normalized(); + + // interpolate between hip and spine + roughAngle = (roughAngle * 0.4 + (spineDir * 0.6)).normalized(); + + // angle between hip and HMD + double dotProd = roughAngle.dot(hmd_tracker.xform(Vector3(0, 0, 1))); + + // flip if we're facing the negative direction to fix the cross product's result + if (dotProd < 0) { + roughAngle = -(leftLegDir.cross(rightLegDir).normalized()); + + // interpolate between hip and spine + roughAngle = (roughAngle * 0.4 + (-spineDir * 0.6)).normalized(); + } + + final_hip_rot = Basis::looking_at(roughAngle, Vector3(0, 1, 0)).get_rotation_quat().normalized(); + pose.qRotation = quaternion::from_Quat(final_hip_rot); + } + + // values no one gives a shit about + pose.vecVelocity[0] = 0.0; + pose.vecVelocity[1] = 0.0; + pose.vecVelocity[2] = 0.0; + pose.qWorldFromDriverRotation = quaternion::init(0, 0, 0, 1); + pose.qDriverFromHeadRotation = quaternion::init(0, 0, 0, 1); + + // submit + vr::VRServerDriverHost()->TrackedDevicePoseUpdated(m_unObjectId, pose, sizeof(pose)); +} + +void AugmentedHipDevice::ProcessEvent(const vr::VREvent_t& vrEvent) +{ +} + +const Basis& AugmentedHipDevice::get_last_basis() { + return last_basis; +} + +const char* AugmentedHipDevice::GetSerialNumber() const { return m_sSerialNumber.c_str(); } +const char* AugmentedHipDevice::GetModelNumber() const { return m_sModelNumber.c_str(); } + +const char* AugmentedHipDevice::GetId() const { return GetSerialNumber(); } + +void AugmentedHipDevice::AutoCalibHeight() { + + // Average the legs' position, then calculate the distance between them and our hmd to get a good enough guess on player height + Vector3 avg_leg_pos = (left_leg_pos + right_leg_pos) * 0.5; + + double guesstimatedHeight = avg_leg_pos.distance_to(hmd_pos); + + guesstimatedHeight = CLAMP(guesstimatedHeight, MIN_AUTO_HEIGHT, MAX_AUTO_HEIGHT); + + // THIS IS BAD, as it will make you shorter when you enter a "brace for impact" position + // TODO: better algorithm for auto height calib that takes an average over time, maximising for tallest height or something + settings.realPlayerHeight = guesstimatedHeight; + +} \ No newline at end of file diff --git a/AugmentedHip/AugmentedHipDevice.h b/AugmentedHip/AugmentedHipDevice.h new file mode 100644 index 0000000..cb21b59 --- /dev/null +++ b/AugmentedHip/AugmentedHipDevice.h @@ -0,0 +1,94 @@ +#pragma once + +#include +#include "driverlog.h" +#include "basis.h" +#include "quaternion.h" + +#include "AbstractDevice.h" +#include "AugmentedHipSettings.h" + +#include "IK/FABRIKSolver.h" + +class AugmentedHipDevice : public AbstractDevice { + +private: + + vr::VRInputComponentHandle_t haptic; + AugmentedHipSettings settings; + + bool is_calibrating = false; + bool is_down_calibrating = false; + + Basis last_basis; + + bool activated = false; +public: + unsigned int id = 0; + unsigned int port_no = 0; + + AugmentedHipDevice(const int& id, AugmentedHipSettings settings_v); + ~AugmentedHipDevice(); + + vr::EVRInitError Activate(vr::TrackedDeviceIndex_t unObjectId) override; + + void Deactivate() override; + void EnterStandby() override; + + void* GetComponent(const char* pchComponentNameAndVersion) override; + + void PowerOff() override; + + /** debug request from a client */ + void DebugRequest(const char* pchRequest, char* pchResponseBuffer, uint32_t unResponseBufferSize) override; + + vr::DriverPose_t GetPose() override; + + void RunFrame(vr::TrackedDevicePose_t* poses) override; + + void ProcessEvent(const vr::VREvent_t& vrEvent) override; + + const char* GetSerialNumber() const override; + const char* GetModelNumber() const override; + const char* GetId() const override; + + void AutoCalibHeight(); + + void send_invalid_pose(); + const Basis& get_last_basis(); + + // Yes i know this is a shit IK system. I'm going to improve it with a better rig later + FABRIKSolver headChainSolver = FABRIKSolver(); + FABRIKSolver rightLegChainSolver = FABRIKSolver(); + FABRIKSolver leftLegChainSolver = FABRIKSolver(); + + // Variables + Vector3 hmd_pos; + Vector3 left_leg_pos; + Vector3 right_leg_pos; + + // My behated + Quat identity = Quat::Quat(0, 0, 0, 1); + + Quat hmd_tracker = Quat::Quat(0, 0, 0, 1); + Quat left_tracker = Quat::Quat(0, 0, 0, 1); + Quat right_tracker = Quat::Quat(0, 0, 0, 1); + Quat balls_tracker = Quat::Quat(0, 0, 0, 1); + Quat hip_tracker = Quat::Quat(0, 0, 0, 1); + + // This tracker's serial code + std::string augHipSerialCode; + + // Measurements are currently rough; taken from https://hpc.invisualdata.com/, using a 183cm human as a basis +#define SPINE_HEIGHT 0.604 +#define NECK_HEIGHT 0.077 +#define THIGH_HEIGHT 0.458 +#define LOWER_LEG_HEIGHT 0.457 + + inline double getHeightRatio() { + return settings.realPlayerHeight / 1.83; + } + +#define MIN_AUTO_HEIGHT 1.0 +#define MAX_AUTO_HEIGHT 2.0 +}; \ No newline at end of file diff --git a/AugmentedHip/AugmentedHipSettings.h b/AugmentedHip/AugmentedHipSettings.h new file mode 100644 index 0000000..54ede20 --- /dev/null +++ b/AugmentedHip/AugmentedHipSettings.h @@ -0,0 +1,46 @@ +#pragma once +#include +#include "vector3.h" + +// override an axis +struct AxisOverride { + bool enabled = false; + double to = 0.0; +}; + +struct AugmentedHipSettings { + // device to anchor to + // if -1 then it should be treated as having no anchor + // with all offsets done from (0, 0, 0) + unsigned int anchor_device_id; + + // meters to offset in global space + Vector3 offset_global; + + // meters to offset in anchor device space + Vector3 offset_local_device; + + // meters to offset in local tracker space + Vector3 offset_local_tracker; + + // yaw offset (true north vs vr north) + double yaw_offset; + + // rotation = (Quat(global_rot_euler) * rotation) * Quat(local_rot_euler) + Vector3 global_rot_euler; // radians btw + Vector3 local_rot_euler; // still radians + + // override axises + AxisOverride x_override = { false, 0.0 }; + AxisOverride y_override = { false, 0.0 }; + AxisOverride z_override = { false, 0.0 }; + + // predict position? + bool should_predict_position = true; + double position_prediction_strength = 1.0; + + // Whether to automagically calculate the player's height + bool autoCalcHeight = true; + // The player's height in metres + double realPlayerHeight = 1.8; +}; \ No newline at end of file diff --git a/AugmentedHip/DeviceProvider.cpp b/AugmentedHip/DeviceProvider.cpp new file mode 100644 index 0000000..677d2c2 --- /dev/null +++ b/AugmentedHip/DeviceProvider.cpp @@ -0,0 +1,77 @@ +#include "DeviceProvider.h" + +int DeviceProvider::add_tracker() { + + unsigned int id = trackers.size(); + + AugmentedHipSettings defaults; + + defaults.anchor_device_id = 0; + defaults.offset_global = Vector3(0.0, 0.0, 0.0); + defaults.offset_local_device = Vector3(0.0, 0.0, 0.0); + defaults.offset_local_tracker = Vector3(0.0, -0.73, 0.0); + + defaults.local_rot_euler = Vector3(0.0, 0.0, 0.0); + defaults.global_rot_euler = Vector3(0.0, 0.0, 0.0); + + defaults.yaw_offset = 0.0; + + defaults.should_predict_position = false; + + AugmentedHipDevice* tracker = new AugmentedHipDevice(id, defaults); + vr::VRServerDriverHost()->TrackedDeviceAdded(tracker->GetSerialNumber(), vr::TrackedDeviceClass_GenericTracker, tracker); + + devices.push_back(tracker); + trackers.push_back(tracker); + + return (int) id; + +} + +vr::EVRInitError DeviceProvider::Init(vr::IVRDriverContext* pDriverContext) { + + VR_INIT_SERVER_DRIVER_CONTEXT(pDriverContext); + InitDriverLog(vr::VRDriverLog()); + DriverLog("Initialising Augmented Hip..."); + + poses = (vr::TrackedDevicePose_t*)malloc(sizeof(vr::TrackedDevicePose_t) * vr::k_unMaxTrackedDeviceCount); + unsigned int id = add_tracker(); + + if (trackers.size() <= id) return vr::EVRInitError::VRInitError_Init_Internal; + AugmentedHipDevice* tracker = trackers[id]; + + if (tracker == nullptr) { + return vr::EVRInitError::VRInitError_Init_Internal; + } + else { + tracker->Activate(id); + vr::VRServerDriverHost()->TrackedDeviceAdded(tracker->GetSerialNumber(), vr::TrackedDeviceClass_Controller, tracker); + } + + return vr::EVRInitError::VRInitError_None; +} + +void DeviceProvider::Cleanup() { + CleanupDriverLog(); + for (auto v : trackers) { + delete ((AugmentedHipDevice*)(v)); + } +} + +void DeviceProvider::RunFrame() { + + vr::VRServerDriverHost()->GetRawTrackedDevicePoses(0, poses, vr::k_unMaxTrackedDeviceCount); + + for (auto v : devices) { + if (v == nullptr) continue; + v->RunFrame(poses); + } + + vr::VREvent_t vrEvent; + while (vr::VRServerDriverHost()->PollNextEvent(&vrEvent, sizeof(vrEvent))) { + for (auto v : devices) { + if (v == nullptr) continue; + v->ProcessEvent(vrEvent); + } + } +} \ No newline at end of file diff --git a/AugmentedHip/DeviceProvider.h b/AugmentedHip/DeviceProvider.h new file mode 100644 index 0000000..f4618df --- /dev/null +++ b/AugmentedHip/DeviceProvider.h @@ -0,0 +1,26 @@ +#pragma once + +#include +#include "driverlog.h" + +#include "AbstractDevice.h" +#include "AugmentedHipDevice.h" + +class DeviceProvider : public vr::IServerTrackedDeviceProvider { +private: + + int add_tracker(); + + std::vector trackers; + std::vector devices; + + vr::TrackedDevicePose_t* poses; +public: + virtual vr::EVRInitError Init(vr::IVRDriverContext* pDriverContext); + virtual void Cleanup(); + virtual const char* const* GetInterfaceVersions() { return vr::k_InterfaceVersions; } + virtual void RunFrame(); + virtual bool ShouldBlockStandbyMode() { return false; } + virtual void EnterStandby() {} + virtual void LeaveStandby() {} +}; \ No newline at end of file diff --git a/AugmentedHip/IK/FABRIKSolver.cpp b/AugmentedHip/IK/FABRIKSolver.cpp new file mode 100644 index 0000000..55f4ded --- /dev/null +++ b/AugmentedHip/IK/FABRIKSolver.cpp @@ -0,0 +1,135 @@ +#include "FABRIKSolver.h" + +FABRIKSolver::FABRIKSolver() { + mNumSteps = 2; + mThreshold = 0.00001f; +} + +unsigned int FABRIKSolver::GetNumSteps() { + return mNumSteps; +} +void FABRIKSolver::SetNumSteps(unsigned int numSteps) { + mNumSteps = numSteps; +} +float FABRIKSolver::GetThreshold() { + return mThreshold; +} +void FABRIKSolver::SetThreshold(float value) { + mThreshold = value; +} + +unsigned int FABRIKSolver::Size() { + return mIKChain.size(); +} +void FABRIKSolver::Resize(unsigned int newSize) { + mIKChain.resize(newSize); + mWorldChain.resize(newSize); + mLengths.resize(newSize); +} + +Transform FABRIKSolver::GetLocalTransform(unsigned int index) { + return mIKChain[index]; +} +void FABRIKSolver::SetLocalTransform(unsigned int index, const Transform& t) { + mIKChain[index] = t; +} + +Transform FABRIKSolver::GetGlobalTransform(unsigned int index) { + unsigned int size = (unsigned int)mIKChain.size(); + Transform world = mIKChain[index]; + for (int i = (int)index - 1; i >= 0; --i) { + world = Transform::apply(mIKChain[i], world); + } + return world; +} + +void FABRIKSolver::IKChainToWorld() { + unsigned int size = Size(); + for (unsigned int i = 0; i < size; ++i) { + Transform world = GetGlobalTransform(i); + mWorldChain[i] = world.position; + if (i >= 1) { + Vector3 prev = mWorldChain[i - 1]; + mLengths[i] = (world.position - prev).length(); + } + } + if (size > 0) { + mLengths[0] = 0.0f; + } +} + +void FABRIKSolver::WorldToIKChain() { + unsigned int size = Size(); + if (size == 0) { return; } + for (unsigned int i = 0; i < size - 1; ++i) { + Transform world = GetGlobalTransform(i); + Transform next = GetGlobalTransform(i + 1); + Vector3 position = world.position; + Quat rotation = world.rotation; + Vector3 toNext = next.position - position; + toNext = (rotation.inverse()).xform(toNext); + Vector3 toDesired = mWorldChain[i + 1] - position; + toDesired = (rotation.inverse()).xform(toDesired); + Quat delta = Transform::fromTo(toNext, toDesired); + mIKChain[i].rotation = delta * mIKChain[i].rotation; + } +} + +void FABRIKSolver::IterateBackward(const Vector3& goal) { + int size = (int)Size(); + if (size > 0) { + mWorldChain[size - 1] = goal; + } + for (int i = size - 2; i >= 0; --i) { + Vector3 direction = (mWorldChain[i] - mWorldChain[i + 1]); + direction.normalize(); + Vector3 offset = direction * mLengths[i + 1]; + mWorldChain[i] = mWorldChain[i + 1] + offset; + } +} + +void FABRIKSolver::IterateForward(const Vector3& base) { + unsigned int size = Size(); + if (size > 0) { + mWorldChain[0] = base; + } + for (int i = 1; i < size; ++i) { + Vector3 direction = (mWorldChain[i] - mWorldChain[i - 1]); + direction.normalize(); + Vector3 offset = direction * mLengths[i]; + mWorldChain[i] = mWorldChain[i - 1] + offset; + } +} + +bool FABRIKSolver::Solve(const Transform& target) { + unsigned int size = Size(); + if (size == 0) { return false; } + unsigned int last = size - 1; + float thresholdSq = mThreshold * mThreshold; + + IKChainToWorld(); + Vector3 goal = target.position; + Vector3 base = mWorldChain[0]; + + for (unsigned int i = 0; i < mNumSteps; ++i) { + Vector3 effector = mWorldChain[last]; + if ((goal - effector).length_squared() < thresholdSq) { + WorldToIKChain(); + return true; + } + IterateBackward(goal); + IterateForward(base); + + // Constraints + //WorldToIKChain(); + // -> APPLY CONSTRAINTS HERE! + //IKChainToWorld(); + } + + WorldToIKChain(); + Vector3 effector = GetGlobalTransform(last).position; + if ((goal - effector).length_squared() < thresholdSq) { + return true; + } + return false; +} \ No newline at end of file diff --git a/AugmentedHip/IK/FABRIKSolver.h b/AugmentedHip/IK/FABRIKSolver.h new file mode 100644 index 0000000..a5986c9 --- /dev/null +++ b/AugmentedHip/IK/FABRIKSolver.h @@ -0,0 +1,35 @@ +#pragma once +#include "../vector3.h" +#include +#include "Transform.h" + +class FABRIKSolver { +protected: + std::vector mIKChain; + unsigned int mNumSteps; + float mThreshold; + std::vector mWorldChain; + std::vector mLengths; +protected: + void IKChainToWorld(); + void IterateForward(const Vector3& goal); + void IterateBackward(const Vector3& base); + void WorldToIKChain(); +public: + FABRIKSolver(); + + unsigned int Size(); + void Resize(unsigned int newSize); + + Transform GetLocalTransform(unsigned int index); + void SetLocalTransform(unsigned int index, const Transform& t); + Transform GetGlobalTransform(unsigned int index); + + unsigned int GetNumSteps(); + void SetNumSteps(unsigned int numSteps); + + float GetThreshold(); + void SetThreshold(float value); + + bool Solve(const Transform& target); +}; \ No newline at end of file diff --git a/AugmentedHip/IK/Transform.cpp b/AugmentedHip/IK/Transform.cpp new file mode 100644 index 0000000..3b249da --- /dev/null +++ b/AugmentedHip/IK/Transform.cpp @@ -0,0 +1,2 @@ +#include "Transform.h" + diff --git a/AugmentedHip/IK/Transform.h b/AugmentedHip/IK/Transform.h new file mode 100644 index 0000000..4beaf2a --- /dev/null +++ b/AugmentedHip/IK/Transform.h @@ -0,0 +1,57 @@ +#pragma once + +#include "../vector3.h" +#include "../quat.h" + +struct Transform { + +public: + Transform() {} + Transform(Vector3 pos) : position(pos) {} + +public: + Vector3 position; + Quat rotation; + + +public: + // Applies the parent transform (other) to the current transform, and returns the final value + static Transform apply(const Transform& parent, const Transform& child) { + Transform appliedTransform; + appliedTransform.position = parent.position + child.rotation.xform(child.position); + appliedTransform.rotation = parent.rotation * child.rotation; + return appliedTransform; + } + + static Quat fromTo(const Vector3& lhs, const Vector3& rhs) { + // https://stackoverflow.com/questions/1171849/finding-quaternion-representing-the-rotation-from-one-vector-to-another + Quat q; + Vector3 a = lhs.cross(rhs); + q.x = a.x; + q.y = a.y; + q.z = a.z; + q.w = sqrt((lhs.length_squared()) * (rhs.length_squared())) + lhs.dot(rhs); + q.normalize(); + + return q; + } + + static Transform lerp(const Transform& left, const Transform& right, double delta = 0.5) { + Transform ret; + ret.position = left.position.lerp(right.position, delta); + // ret.rotation = left.rotation.slerp(right.rotation, delta); + + return ret; + } + + Transform lerp(const Vector3& pos, double delta = 0.5) { + Transform ret; + ret.position = this->position.lerp(pos, delta); + return ret; + } + + Transform operator- (const Transform& v) const { + return Transform(this->position - v.position); + // yes ik no rotation bla bla i got IK figuring that out fuck you :D + } +}; \ No newline at end of file diff --git a/AugmentedHip/basis.cpp b/AugmentedHip/basis.cpp new file mode 100644 index 0000000..5790600 --- /dev/null +++ b/AugmentedHip/basis.cpp @@ -0,0 +1,1139 @@ + +#include "basis.h" + +#define cofac(row1, col1, row2, col2) \ + (elements[row1][col1] * elements[row2][col2] - elements[row1][col2] * elements[row2][col1]) + +void Basis::from_z(const Vector3& p_z) { + if (std::abs(p_z.z) > Math_SQRT12) { + // choose p in y-z plane + double a = p_z[1] * p_z[1] + p_z[2] * p_z[2]; + double k = 1.0 / std::sqrt(a); + elements[0] = Vector3(0, -p_z[2] * k, p_z[1] * k); + elements[1] = Vector3(a * k, -p_z[0] * elements[0][2], p_z[0] * elements[0][1]); + } + else { + // choose p in x-y plane + double a = p_z.x * p_z.x + p_z.y * p_z.y; + double k = 1.0 / std::sqrt(a); + elements[0] = Vector3(-p_z.y * k, p_z.x * k, 0); + elements[1] = Vector3(-p_z.z * elements[0].y, p_z.z * elements[0].x, a * k); + } + elements[2] = p_z; +} + +void Basis::invert() { + double co[3] = { + cofac(1, 1, 2, 2), cofac(1, 2, 2, 0), cofac(1, 0, 2, 1) + }; + double det = elements[0][0] * co[0] + + elements[0][1] * co[1] + + elements[0][2] * co[2]; +#ifdef MATH_CHECKS + ERR_FAIL_COND(det == 0); +#endif + double s = 1.0 / det; + + set(co[0] * s, cofac(0, 2, 2, 1) * s, cofac(0, 1, 1, 2) * s, + co[1] * s, cofac(0, 0, 2, 2) * s, cofac(0, 2, 1, 0) * s, + co[2] * s, cofac(0, 1, 2, 0) * s, cofac(0, 0, 1, 1) * s); +} + +void Basis::orthonormalize() { + // Gram-Schmidt Process + + Vector3 x = get_axis(0); + Vector3 y = get_axis(1); + Vector3 z = get_axis(2); + + x.normalize(); + y = (y - x * (x.dot(y))); + y.normalize(); + z = (z - x * (x.dot(z)) - y * (y.dot(z))); + z.normalize(); + + set_axis(0, x); + set_axis(1, y); + set_axis(2, z); +} + +Basis Basis::orthonormalized() const { + Basis c = *this; + c.orthonormalize(); + return c; +} + +bool Basis::is_orthogonal() const { + Basis identity; + Basis m = (*this) * transposed(); + + return m.is_equal_approx(identity); +} + +bool Basis::is_diagonal() const { + return ( + Math::is_zero_approx(elements[0][1]) && Math::is_zero_approx(elements[0][2]) && + Math::is_zero_approx(elements[1][0]) && Math::is_zero_approx(elements[1][2]) && + Math::is_zero_approx(elements[2][0]) && Math::is_zero_approx(elements[2][1])); +} + +bool Basis::is_rotation() const { + return Math::is_equal_approx(determinant(), 1, UNIT_EPSILON) && is_orthogonal(); +} + +#ifdef MATH_CHECKS +// This method is only used once, in diagonalize. If it's desired elsewhere, feel free to remove the #ifdef. +bool Basis::is_symmetric() const { + if (!Math::is_equal_approx(elements[0][1], elements[1][0])) { + return false; + } + if (!Math::is_equal_approx(elements[0][2], elements[2][0])) { + return false; + } + if (!Math::is_equal_approx(elements[1][2], elements[2][1])) { + return false; + } + + return true; +} +#endif + +Basis Basis::diagonalize() { + //NOTE: only implemented for symmetric matrices + //with the Jacobi iterative method method +#ifdef MATH_CHECKS + ERR_FAIL_COND_V(!is_symmetric(), Basis()); +#endif + const int ite_max = 1024; + + double off_matrix_norm_2 = elements[0][1] * elements[0][1] + elements[0][2] * elements[0][2] + elements[1][2] * elements[1][2]; + + int ite = 0; + Basis acc_rot; + while (off_matrix_norm_2 > UNIT_EPSILON && ite++ < ite_max) { + double el01_2 = elements[0][1] * elements[0][1]; + double el02_2 = elements[0][2] * elements[0][2]; + double el12_2 = elements[1][2] * elements[1][2]; + // Find the pivot element + int i, j; + if (el01_2 > el02_2) { + if (el12_2 > el01_2) { + i = 1; + j = 2; + } + else { + i = 0; + j = 1; + } + } + else { + if (el12_2 > el02_2) { + i = 1; + j = 2; + } + else { + i = 0; + j = 2; + } + } + + // Compute the rotation angle + double angle; + if (Math::is_equal_approx(elements[j][j], elements[i][i])) { + angle = Math_PI / 4; + } + else { + angle = 0.5 * std::atan(2 * elements[i][j] / (elements[j][j] - elements[i][i])); + } + + // Compute the rotation matrix + Basis rot; + rot.elements[i][i] = rot.elements[j][j] = std::cos(angle); + rot.elements[i][j] = -(rot.elements[j][i] = std::sin(angle)); + + // Update the off matrix norm + off_matrix_norm_2 -= elements[i][j] * elements[i][j]; + + // Apply the rotation + *this = rot * *this * rot.transposed(); + acc_rot = rot * acc_rot; + } + + return acc_rot; +} + +Basis Basis::inverse() const { + Basis inv = *this; + inv.invert(); + return inv; +} + +void Basis::transpose() { + SWAP(elements[0][1], elements[1][0]); + SWAP(elements[0][2], elements[2][0]); + SWAP(elements[1][2], elements[2][1]); +} + +Basis Basis::transposed() const { + Basis tr = *this; + tr.transpose(); + return tr; +} + +// Multiplies the matrix from left by the scaling matrix: M -> S.M +// See the comment for Basis::rotated for further explanation. +void Basis::scale(const Vector3& p_scale) { + elements[0][0] *= p_scale.x; + elements[0][1] *= p_scale.x; + elements[0][2] *= p_scale.x; + elements[1][0] *= p_scale.y; + elements[1][1] *= p_scale.y; + elements[1][2] *= p_scale.y; + elements[2][0] *= p_scale.z; + elements[2][1] *= p_scale.z; + elements[2][2] *= p_scale.z; +} + +Basis Basis::scaled(const Vector3& p_scale) const { + Basis m = *this; + m.scale(p_scale); + return m; +} + +void Basis::scale_local(const Vector3& p_scale) { + // performs a scaling in object-local coordinate system: + // M -> (M.S.Minv).M = M.S. + *this = scaled_local(p_scale); +} + +float Basis::get_uniform_scale() const { + return (elements[0].length() + elements[1].length() + elements[2].length()) / 3.0; +} + +void Basis::make_scale_uniform() { + float l = (elements[0].length() + elements[1].length() + elements[2].length()) / 3.0; + for (int i = 0; i < 3; i++) { + elements[i].normalize(); + elements[i] *= l; + } +} + +Basis Basis::scaled_local(const Vector3& p_scale) const { + Basis b; + b.set_diagonal(p_scale); + + return (*this) * b; +} + +Vector3 Basis::get_scale_abs() const { + return Vector3( + Vector3(elements[0][0], elements[1][0], elements[2][0]).length(), + Vector3(elements[0][1], elements[1][1], elements[2][1]).length(), + Vector3(elements[0][2], elements[1][2], elements[2][2]).length()); +} + +Vector3 Basis::get_scale_local() const { + double det_sign = Math::sign(determinant()); + return det_sign * Vector3(elements[0].length(), elements[1].length(), elements[2].length()); +} + +// get_scale works with get_rotation, use get_scale_abs if you need to enforce positive signature. +Vector3 Basis::get_scale() const { + // FIXME: We are assuming M = R.S (R is rotation and S is scaling), and use polar decomposition to extract R and S. + // A polar decomposition is M = O.P, where O is an orthogonal matrix (meaning rotation and reflection) and + // P is a positive semi-definite matrix (meaning it contains absolute values of scaling along its diagonal). + // + // Despite being different from what we want to achieve, we can nevertheless make use of polar decomposition + // here as follows. We can split O into a rotation and a reflection as O = R.Q, and obtain M = R.S where + // we defined S = Q.P. Now, R is a proper rotation matrix and S is a (signed) scaling matrix, + // which can involve negative scalings. However, there is a catch: unlike the polar decomposition of M = O.P, + // the decomposition of O into a rotation and reflection matrix as O = R.Q is not unique. + // Therefore, we are going to do this decomposition by sticking to a particular convention. + // This may lead to confusion for some users though. + // + // The convention we use here is to absorb the sign flip into the scaling matrix. + // The same convention is also used in other similar functions such as get_rotation_axis_angle, get_rotation, ... + // + // A proper way to get rid of this issue would be to store the scaling values (or at least their signs) + // as a part of Basis. However, if we go that path, we need to disable direct (write) access to the + // matrix elements. + // + // The rotation part of this decomposition is returned by get_rotation* functions. + double det_sign = Math::sign(determinant()); + return det_sign * Vector3( + Vector3(elements[0][0], elements[1][0], elements[2][0]).length(), + Vector3(elements[0][1], elements[1][1], elements[2][1]).length(), + Vector3(elements[0][2], elements[1][2], elements[2][2]).length()); +} + +// Decomposes a Basis into a rotation-reflection matrix (an element of the group O(3)) and a positive scaling matrix as B = O.S. +// Returns the rotation-reflection matrix via reference argument, and scaling information is returned as a Vector3. +// This (internal) function is too specific and named too ugly to expose to users, and probably there's no need to do so. +Vector3 Basis::rotref_posscale_decomposition(Basis& rotref) const { +#ifdef MATH_CHECKS + ERR_FAIL_COND_V(determinant() == 0, Vector3()); + + Basis m = transposed() * (*this); + ERR_FAIL_COND_V(!m.is_diagonal(), Vector3()); +#endif + Vector3 scale = get_scale(); + Basis inv_scale = Basis().scaled(scale.inverse()); // this will also absorb the sign of scale + rotref = (*this) * inv_scale; + +#ifdef MATH_CHECKS + ERR_FAIL_COND_V(!rotref.is_orthogonal(), Vector3()); +#endif + return scale.abs(); +} + +// Multiplies the matrix from left by the rotation matrix: M -> R.M +// Note that this does *not* rotate the matrix itself. +// +// The main use of Basis is as Transform.basis, which is used a the transformation matrix +// of 3D object. Rotate here refers to rotation of the object (which is R * (*this)), +// not the matrix itself (which is R * (*this) * R.transposed()). +Basis Basis::rotated(const Vector3& p_axis, double p_phi) const { + return Basis(p_axis, p_phi) * (*this); +} + +void Basis::rotate(const Vector3& p_axis, double p_phi) { + *this = rotated(p_axis, p_phi); +} + +void Basis::rotate_local(const Vector3& p_axis, double p_phi) { + // performs a rotation in object-local coordinate system: + // M -> (M.R.Minv).M = M.R. + *this = rotated_local(p_axis, p_phi); +} + +Basis Basis::rotated_local(const Vector3& p_axis, double p_phi) const { + return (*this) * Basis(p_axis, p_phi); +} + +Basis Basis::rotated(const Vector3& p_euler) const { + return Basis(p_euler) * (*this); +} + +void Basis::rotate(const Vector3& p_euler) { + *this = rotated(p_euler); +} + +Basis Basis::rotated(const Quat& p_quat) const { + return Basis(p_quat) * (*this); +} + +void Basis::rotate(const Quat& p_quat) { + *this = rotated(p_quat); +} + +Vector3 Basis::get_rotation_euler() const { + // Assumes that the matrix can be decomposed into a proper rotation and scaling matrix as M = R.S, + // and returns the Euler angles corresponding to the rotation part, complementing get_scale(). + // See the comment in get_scale() for further information. + Basis m = orthonormalized(); + double det = m.determinant(); + if (det < 0) { + // Ensure that the determinant is 1, such that result is a proper rotation matrix which can be represented by Euler angles. + m.scale(Vector3(-1, -1, -1)); + } + + return m.get_euler(); +} + +Quat Basis::get_rotation_quat() const { + // Assumes that the matrix can be decomposed into a proper rotation and scaling matrix as M = R.S, + // and returns the Euler angles corresponding to the rotation part, complementing get_scale(). + // See the comment in get_scale() for further information. + Basis m = orthonormalized(); + double det = m.determinant(); + if (det < 0) { + // Ensure that the determinant is 1, such that result is a proper rotation matrix which can be represented by Euler angles. + m.scale(Vector3(-1, -1, -1)); + } + + return m.get_quat(); +} + +void Basis::get_rotation_axis_angle(Vector3& p_axis, double& p_angle) const { + // Assumes that the matrix can be decomposed into a proper rotation and scaling matrix as M = R.S, + // and returns the Euler angles corresponding to the rotation part, complementing get_scale(). + // See the comment in get_scale() for further information. + Basis m = orthonormalized(); + double det = m.determinant(); + if (det < 0) { + // Ensure that the determinant is 1, such that result is a proper rotation matrix which can be represented by Euler angles. + m.scale(Vector3(-1, -1, -1)); + } + + m.get_axis_angle(p_axis, p_angle); +} + +void Basis::get_rotation_axis_angle_local(Vector3& p_axis, double& p_angle) const { + // Assumes that the matrix can be decomposed into a proper rotation and scaling matrix as M = R.S, + // and returns the Euler angles corresponding to the rotation part, complementing get_scale(). + // See the comment in get_scale() for further information. + Basis m = transposed(); + m.orthonormalize(); + double det = m.determinant(); + if (det < 0) { + // Ensure that the determinant is 1, such that result is a proper rotation matrix which can be represented by Euler angles. + m.scale(Vector3(-1, -1, -1)); + } + + m.get_axis_angle(p_axis, p_angle); + p_angle = -p_angle; +} + +// get_euler_xyz returns a vector containing the Euler angles in the format +// (a1,a2,a3), where a3 is the angle of the first rotation, and a1 is the last +// (following the convention they are commonly defined in the literature). +// +// The current implementation uses XYZ convention (Z is the first rotation), +// so euler.z is the angle of the (first) rotation around Z axis and so on, +// +// And thus, assuming the matrix is a rotation matrix, this function returns +// the angles in the decomposition R = X(a1).Y(a2).Z(a3) where Z(a) rotates +// around the z-axis by a and so on. +Vector3 Basis::get_euler_xyz() const { + // Euler angles in XYZ convention. + // See https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix + // + // rot = cy*cz -cy*sz sy + // cz*sx*sy+cx*sz cx*cz-sx*sy*sz -cy*sx + // -cx*cz*sy+sx*sz cz*sx+cx*sy*sz cx*cy + + Vector3 euler; + double sy = elements[0][2]; + if (sy < (1.0 - UNIT_EPSILON)) { + if (sy > -(1.0 - UNIT_EPSILON)) { + // is this a pure Y rotation? + if (elements[1][0] == 0.0 && elements[0][1] == 0.0 && elements[1][2] == 0 && elements[2][1] == 0 && elements[1][1] == 1) { + // return the simplest form (human friendlier in editor and scripts) + euler.x = 0; + euler.y = atan2(elements[0][2], elements[0][0]); + euler.z = 0; + } + else { + euler.x = std::atan2(-elements[1][2], elements[2][2]); + euler.y = std::asin(sy); + euler.z = std::atan2(-elements[0][1], elements[0][0]); + } + } + else { + euler.x = std::atan2(elements[2][1], elements[1][1]); + euler.y = -Math_PI / 2.0; + euler.z = 0.0; + } + } + else { + euler.x = std::atan2(elements[2][1], elements[1][1]); + euler.y = Math_PI / 2.0; + euler.z = 0.0; + } + return euler; +} + +// set_euler_xyz expects a vector containing the Euler angles in the format +// (ax,ay,az), where ax is the angle of rotation around x axis, +// and similar for other axes. +// The current implementation uses XYZ convention (Z is the first rotation). +void Basis::set_euler_xyz(const Vector3& p_euler) { + double c, s; + + c = std::cos(p_euler.x); + s = std::sin(p_euler.x); + Basis xmat(1.0, 0.0, 0.0, 0.0, c, -s, 0.0, s, c); + + c = std::cos(p_euler.y); + s = std::sin(p_euler.y); + Basis ymat(c, 0.0, s, 0.0, 1.0, 0.0, -s, 0.0, c); + + c = std::cos(p_euler.z); + s = std::sin(p_euler.z); + Basis zmat(c, -s, 0.0, s, c, 0.0, 0.0, 0.0, 1.0); + + //optimizer will optimize away all this anyway + *this = xmat * (ymat * zmat); +} + +Vector3 Basis::get_euler_xzy() const { + // Euler angles in XZY convention. + // See https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix + // + // rot = cz*cy -sz cz*sy + // sx*sy+cx*cy*sz cx*cz cx*sz*sy-cy*sx + // cy*sx*sz cz*sx cx*cy+sx*sz*sy + + Vector3 euler; + double sz = elements[0][1]; + if (sz < (1.0 - UNIT_EPSILON)) { + if (sz > -(1.0 - UNIT_EPSILON)) { + euler.x = std::atan2(elements[2][1], elements[1][1]); + euler.y = std::atan2(elements[0][2], elements[0][0]); + euler.z = std::asin(-sz); + } + else { + // It's -1 + euler.x = -std::atan2(elements[1][2], elements[2][2]); + euler.y = 0.0; + euler.z = Math_PI / 2.0; + } + } + else { + // It's 1 + euler.x = -std::atan2(elements[1][2], elements[2][2]); + euler.y = 0.0; + euler.z = -Math_PI / 2.0; + } + return euler; +} + +void Basis::set_euler_xzy(const Vector3& p_euler) { + double c, s; + + c = std::cos(p_euler.x); + s = std::sin(p_euler.x); + Basis xmat(1.0, 0.0, 0.0, 0.0, c, -s, 0.0, s, c); + + c = std::cos(p_euler.y); + s = std::sin(p_euler.y); + Basis ymat(c, 0.0, s, 0.0, 1.0, 0.0, -s, 0.0, c); + + c = std::cos(p_euler.z); + s = std::sin(p_euler.z); + Basis zmat(c, -s, 0.0, s, c, 0.0, 0.0, 0.0, 1.0); + + *this = xmat * zmat * ymat; +} + +Vector3 Basis::get_euler_yzx() const { + // Euler angles in YZX convention. + // See https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix + // + // rot = cy*cz sy*sx-cy*cx*sz cx*sy+cy*sz*sx + // sz cz*cx -cz*sx + // -cz*sy cy*sx+cx*sy*sz cy*cx-sy*sz*sx + + Vector3 euler; + double sz = elements[1][0]; + if (sz < (1.0 - UNIT_EPSILON)) { + if (sz > -(1.0 - UNIT_EPSILON)) { + euler.x = std::atan2(-elements[1][2], elements[1][1]); + euler.y = std::atan2(-elements[2][0], elements[0][0]); + euler.z = std::asin(sz); + } + else { + // It's -1 + euler.x = std::atan2(elements[2][1], elements[2][2]); + euler.y = 0.0; + euler.z = -Math_PI / 2.0; + } + } + else { + // It's 1 + euler.x = std::atan2(elements[2][1], elements[2][2]); + euler.y = 0.0; + euler.z = Math_PI / 2.0; + } + return euler; +} + +void Basis::set_euler_yzx(const Vector3& p_euler) { + double c, s; + + c = std::cos(p_euler.x); + s = std::sin(p_euler.x); + Basis xmat(1.0, 0.0, 0.0, 0.0, c, -s, 0.0, s, c); + + c = std::cos(p_euler.y); + s = std::sin(p_euler.y); + Basis ymat(c, 0.0, s, 0.0, 1.0, 0.0, -s, 0.0, c); + + c = std::cos(p_euler.z); + s = std::sin(p_euler.z); + Basis zmat(c, -s, 0.0, s, c, 0.0, 0.0, 0.0, 1.0); + + *this = ymat * zmat * xmat; +} + +// get_euler_yxz returns a vector containing the Euler angles in the YXZ convention, +// as in first-Z, then-X, last-Y. The angles for X, Y, and Z rotations are returned +// as the x, y, and z components of a Vector3 respectively. +Vector3 Basis::get_euler_yxz() const { + // Euler angles in YXZ convention. + // See https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix + // + // rot = cy*cz+sy*sx*sz cz*sy*sx-cy*sz cx*sy + // cx*sz cx*cz -sx + // cy*sx*sz-cz*sy cy*cz*sx+sy*sz cy*cx + + Vector3 euler; + + double m12 = elements[1][2]; + + if (m12 < (1 - UNIT_EPSILON)) { + if (m12 > -(1 - UNIT_EPSILON)) { + // is this a pure X rotation? + if (elements[1][0] == 0 && elements[0][1] == 0 && elements[0][2] == 0 && elements[2][0] == 0 && elements[0][0] == 1) { + // return the simplest form (human friendlier in editor and scripts) + euler.x = atan2(-m12, elements[1][1]); + euler.y = 0; + euler.z = 0; + } + else { + euler.x = asin(-m12); + euler.y = atan2(elements[0][2], elements[2][2]); + euler.z = atan2(elements[1][0], elements[1][1]); + } + } + else { // m12 == -1 + euler.x = Math_PI * 0.5; + euler.y = atan2(elements[0][1], elements[0][0]); + euler.z = 0; + } + } + else { // m12 == 1 + euler.x = -Math_PI * 0.5; + euler.y = -atan2(elements[0][1], elements[0][0]); + euler.z = 0; + } + + return euler; +} + +// set_euler_yxz expects a vector containing the Euler angles in the format +// (ax,ay,az), where ax is the angle of rotation around x axis, +// and similar for other axes. +// The current implementation uses YXZ convention (Z is the first rotation). +void Basis::set_euler_yxz(const Vector3& p_euler) { + double c, s; + + c = std::cos(p_euler.x); + s = std::sin(p_euler.x); + Basis xmat(1.0, 0.0, 0.0, 0.0, c, -s, 0.0, s, c); + + c = std::cos(p_euler.y); + s = std::sin(p_euler.y); + Basis ymat(c, 0.0, s, 0.0, 1.0, 0.0, -s, 0.0, c); + + c = std::cos(p_euler.z); + s = std::sin(p_euler.z); + Basis zmat(c, -s, 0.0, s, c, 0.0, 0.0, 0.0, 1.0); + + //optimizer will optimize away all this anyway + *this = ymat * xmat * zmat; +} + +Vector3 Basis::get_euler_zxy() const { + // Euler angles in ZXY convention. + // See https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix + // + // rot = cz*cy-sz*sx*sy -cx*sz cz*sy+cy*sz*sx + // cy*sz+cz*sx*sy cz*cx sz*sy-cz*cy*sx + // -cx*sy sx cx*cy + Vector3 euler; + double sx = elements[2][1]; + if (sx < (1.0 - UNIT_EPSILON)) { + if (sx > -(1.0 - UNIT_EPSILON)) { + euler.x = std::asin(sx); + euler.y = std::atan2(-elements[2][0], elements[2][2]); + euler.z = std::atan2(-elements[0][1], elements[1][1]); + } + else { + // It's -1 + euler.x = -Math_PI / 2.0; + euler.y = std::atan2(elements[0][2], elements[0][0]); + euler.z = 0; + } + } + else { + // It's 1 + euler.x = Math_PI / 2.0; + euler.y = std::atan2(elements[0][2], elements[0][0]); + euler.z = 0; + } + return euler; +} + +void Basis::set_euler_zxy(const Vector3& p_euler) { + double c, s; + + c = std::cos(p_euler.x); + s = std::sin(p_euler.x); + Basis xmat(1.0, 0.0, 0.0, 0.0, c, -s, 0.0, s, c); + + c = std::cos(p_euler.y); + s = std::sin(p_euler.y); + Basis ymat(c, 0.0, s, 0.0, 1.0, 0.0, -s, 0.0, c); + + c = std::cos(p_euler.z); + s = std::sin(p_euler.z); + Basis zmat(c, -s, 0.0, s, c, 0.0, 0.0, 0.0, 1.0); + + *this = zmat * xmat * ymat; +} + +Vector3 Basis::get_euler_zyx() const { + // Euler angles in ZYX convention. + // See https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix + // + // rot = cz*cy cz*sy*sx-cx*sz sz*sx+cz*cx*cy + // cy*sz cz*cx+sz*sy*sx cx*sz*sy-cz*sx + // -sy cy*sx cy*cx + Vector3 euler; + double sy = elements[2][0]; + if (sy < (1.0 - UNIT_EPSILON)) { + if (sy > -(1.0 - UNIT_EPSILON)) { + euler.x = std::atan2(elements[2][1], elements[2][2]); + euler.y = std::asin(-sy); + euler.z = std::atan2(elements[1][0], elements[0][0]); + } + else { + // It's -1 + euler.x = 0; + euler.y = Math_PI / 2.0; + euler.z = -std::atan2(elements[0][1], elements[1][1]); + } + } + else { + // It's 1 + euler.x = 0; + euler.y = -Math_PI / 2.0; + euler.z = -std::atan2(elements[0][1], elements[1][1]); + } + return euler; +} + +void Basis::set_euler_zyx(const Vector3& p_euler) { + double c, s; + + c = std::cos(p_euler.x); + s = std::sin(p_euler.x); + Basis xmat(1.0, 0.0, 0.0, 0.0, c, -s, 0.0, s, c); + + c = std::cos(p_euler.y); + s = std::sin(p_euler.y); + Basis ymat(c, 0.0, s, 0.0, 1.0, 0.0, -s, 0.0, c); + + c = std::cos(p_euler.z); + s = std::sin(p_euler.z); + Basis zmat(c, -s, 0.0, s, c, 0.0, 0.0, 0.0, 1.0); + + *this = zmat * ymat * xmat; +} + +bool Basis::is_equal_approx(const Basis& p_basis) const { + return elements[0].is_equal_approx(p_basis.elements[0]) && elements[1].is_equal_approx(p_basis.elements[1]) && elements[2].is_equal_approx(p_basis.elements[2]); +} + +bool Basis::operator==(const Basis& p_matrix) const { + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 3; j++) { + if (elements[i][j] != p_matrix.elements[i][j]) { + return false; + } + } + } + + return true; +} + +bool Basis::operator!=(const Basis& p_matrix) const { + return (!(*this == p_matrix)); +} + + +Quat Basis::get_quat() const { +#ifdef MATH_CHECKS + ERR_FAIL_COND_V_MSG(!is_rotation(), Quat(), "Basis must be normalized in order to be casted to a Quaternion. Use get_rotation_quat() or call orthonormalized() instead."); +#endif + /* Allow getting a quaternion from an unnormalized transform */ + Basis m = *this; + double trace = m.elements[0][0] + m.elements[1][1] + m.elements[2][2]; + double temp[4]; + + if (trace > 0.0) { + double s = std::sqrt(trace + 1.0); + temp[3] = (s * 0.5); + s = 0.5 / s; + + temp[0] = ((m.elements[2][1] - m.elements[1][2]) * s); + temp[1] = ((m.elements[0][2] - m.elements[2][0]) * s); + temp[2] = ((m.elements[1][0] - m.elements[0][1]) * s); + } + else { + int i = m.elements[0][0] < m.elements[1][1] ? + (m.elements[1][1] < m.elements[2][2] ? 2 : 1) : + (m.elements[0][0] < m.elements[2][2] ? 2 : 0); + int j = (i + 1) % 3; + int k = (i + 2) % 3; + + double s = std::sqrt(m.elements[i][i] - m.elements[j][j] - m.elements[k][k] + 1.0); + temp[i] = s * 0.5; + s = 0.5 / s; + + temp[3] = (m.elements[k][j] - m.elements[j][k]) * s; + temp[j] = (m.elements[j][i] + m.elements[i][j]) * s; + temp[k] = (m.elements[k][i] + m.elements[i][k]) * s; + } + + return Quat(temp[0], temp[1], temp[2], temp[3]); +} + +static const Basis _ortho_bases[24] = { + Basis(1, 0, 0, 0, 1, 0, 0, 0, 1), + Basis(0, -1, 0, 1, 0, 0, 0, 0, 1), + Basis(-1, 0, 0, 0, -1, 0, 0, 0, 1), + Basis(0, 1, 0, -1, 0, 0, 0, 0, 1), + Basis(1, 0, 0, 0, 0, -1, 0, 1, 0), + Basis(0, 0, 1, 1, 0, 0, 0, 1, 0), + Basis(-1, 0, 0, 0, 0, 1, 0, 1, 0), + Basis(0, 0, -1, -1, 0, 0, 0, 1, 0), + Basis(1, 0, 0, 0, -1, 0, 0, 0, -1), + Basis(0, 1, 0, 1, 0, 0, 0, 0, -1), + Basis(-1, 0, 0, 0, 1, 0, 0, 0, -1), + Basis(0, -1, 0, -1, 0, 0, 0, 0, -1), + Basis(1, 0, 0, 0, 0, 1, 0, -1, 0), + Basis(0, 0, -1, 1, 0, 0, 0, -1, 0), + Basis(-1, 0, 0, 0, 0, -1, 0, -1, 0), + Basis(0, 0, 1, -1, 0, 0, 0, -1, 0), + Basis(0, 0, 1, 0, 1, 0, -1, 0, 0), + Basis(0, -1, 0, 0, 0, 1, -1, 0, 0), + Basis(0, 0, -1, 0, -1, 0, -1, 0, 0), + Basis(0, 1, 0, 0, 0, -1, -1, 0, 0), + Basis(0, 0, 1, 0, -1, 0, 1, 0, 0), + Basis(0, 1, 0, 0, 0, 1, 1, 0, 0), + Basis(0, 0, -1, 0, 1, 0, 1, 0, 0), + Basis(0, -1, 0, 0, 0, -1, 1, 0, 0) +}; + +int Basis::get_orthogonal_index() const { + //could be sped up if i come up with a way + Basis orth = *this; + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 3; j++) { + double v = orth[i][j]; + if (v > 0.5) { + v = 1.0; + } + else if (v < -0.5) { + v = -1.0; + } + else { + v = 0; + } + + orth[i][j] = v; + } + } + + for (int i = 0; i < 24; i++) { + if (_ortho_bases[i] == orth) { + return i; + } + } + + return 0; +} + +void Basis::set_orthogonal_index(int p_index) { + //there only exist 24 orthogonal bases in r3 + + *this = _ortho_bases[p_index]; +} + +void Basis::get_axis_angle(Vector3& r_axis, double& r_angle) const { + /* checking this is a bad idea, because obtaining from scaled transform is a valid use case +#ifdef MATH_CHECKS + ERR_FAIL_COND(!is_rotation()); +#endif +*/ + double angle, x, y, z; // variables for result + double epsilon = 0.01; // margin to allow for rounding errors + double epsilon2 = 0.1; // margin to distinguish between 0 and 180 degrees + + if ((std::abs(elements[1][0] - elements[0][1]) < epsilon) && (std::abs(elements[2][0] - elements[0][2]) < epsilon) && (std::abs(elements[2][1] - elements[1][2]) < epsilon)) { + // singularity found + // first check for identity matrix which must have +1 for all terms + // in leading diagonaland zero in other terms + if ((std::abs(elements[1][0] + elements[0][1]) < epsilon2) && (std::abs(elements[2][0] + elements[0][2]) < epsilon2) && (std::abs(elements[2][1] + elements[1][2]) < epsilon2) && (std::abs(elements[0][0] + elements[1][1] + elements[2][2] - 3) < epsilon2)) { + // this singularity is identity matrix so angle = 0 + r_axis = Vector3(0, 1, 0); + r_angle = 0; + return; + } + // otherwise this singularity is angle = 180 + angle = Math_PI; + double xx = (elements[0][0] + 1) / 2; + double yy = (elements[1][1] + 1) / 2; + double zz = (elements[2][2] + 1) / 2; + double xy = (elements[1][0] + elements[0][1]) / 4; + double xz = (elements[2][0] + elements[0][2]) / 4; + double yz = (elements[2][1] + elements[1][2]) / 4; + if ((xx > yy) && (xx > zz)) { // elements[0][0] is the largest diagonal term + if (xx < epsilon) { + x = 0; + y = Math_SQRT12; + z = Math_SQRT12; + } + else { + x = std::sqrt(xx); + y = xy / x; + z = xz / x; + } + } + else if (yy > zz) { // elements[1][1] is the largest diagonal term + if (yy < epsilon) { + x = Math_SQRT12; + y = 0; + z = Math_SQRT12; + } + else { + y = std::sqrt(yy); + x = xy / y; + z = yz / y; + } + } + else { // elements[2][2] is the largest diagonal term so base result on this + if (zz < epsilon) { + x = Math_SQRT12; + y = Math_SQRT12; + z = 0; + } + else { + z = std::sqrt(zz); + x = xz / z; + y = yz / z; + } + } + r_axis = Vector3(x, y, z); + r_angle = angle; + return; + } + // as we have reached here there are no singularities so we can handle normally + double s = std::sqrt((elements[1][2] - elements[2][1]) * (elements[1][2] - elements[2][1]) + (elements[2][0] - elements[0][2]) * (elements[2][0] - elements[0][2]) + (elements[0][1] - elements[1][0]) * (elements[0][1] - elements[1][0])); // s=|axis||sin(angle)|, used to normalise + + angle = std::acos((elements[0][0] + elements[1][1] + elements[2][2] - 1) / 2); + if (angle < 0) { + s = -s; + } + x = (elements[2][1] - elements[1][2]) / s; + y = (elements[0][2] - elements[2][0]) / s; + z = (elements[1][0] - elements[0][1]) / s; + + r_axis = Vector3(x, y, z); + r_angle = angle; +} + +void Basis::set_quat(const Quat& p_quat) { + double d = p_quat.length_squared(); + double s = 2.0 / d; + double xs = p_quat.x * s, ys = p_quat.y * s, zs = p_quat.z * s; + double wx = p_quat.w * xs, wy = p_quat.w * ys, wz = p_quat.w * zs; + double xx = p_quat.x * xs, xy = p_quat.x * ys, xz = p_quat.x * zs; + double yy = p_quat.y * ys, yz = p_quat.y * zs, zz = p_quat.z * zs; + set(1.0 - (yy + zz), xy - wz, xz + wy, + xy + wz, 1.0 - (xx + zz), yz - wx, + xz - wy, yz + wx, 1.0 - (xx + yy)); +} + +void Basis::set_axis_angle(const Vector3& p_axis, double p_phi) { + // Rotation matrix from axis and angle, see https://en.wikipedia.org/wiki/Rotation_matrix#Rotation_matrix_from_axis_angle +#ifdef MATH_CHECKS + ERR_FAIL_COND_MSG(!p_axis.is_normalized(), "The axis Vector3 must be normalized."); +#endif + Vector3 axis_sq(p_axis.x * p_axis.x, p_axis.y * p_axis.y, p_axis.z * p_axis.z); + double cosine = std::cos(p_phi); + elements[0][0] = axis_sq.x + cosine * (1.0 - axis_sq.x); + elements[1][1] = axis_sq.y + cosine * (1.0 - axis_sq.y); + elements[2][2] = axis_sq.z + cosine * (1.0 - axis_sq.z); + + double sine = std::sin(p_phi); + double t = 1 - cosine; + + double xyzt = p_axis.x * p_axis.y * t; + double zyxs = p_axis.z * sine; + elements[0][1] = xyzt - zyxs; + elements[1][0] = xyzt + zyxs; + + xyzt = p_axis.x * p_axis.z * t; + zyxs = p_axis.y * sine; + elements[0][2] = xyzt + zyxs; + elements[2][0] = xyzt - zyxs; + + xyzt = p_axis.y * p_axis.z * t; + zyxs = p_axis.x * sine; + elements[1][2] = xyzt - zyxs; + elements[2][1] = xyzt + zyxs; +} + +void Basis::set_axis_angle_scale(const Vector3& p_axis, double p_phi, const Vector3& p_scale) { + set_diagonal(p_scale); + rotate(p_axis, p_phi); +} + +void Basis::set_euler_scale(const Vector3& p_euler, const Vector3& p_scale) { + set_diagonal(p_scale); + rotate(p_euler); +} + +void Basis::set_quat_scale(const Quat& p_quat, const Vector3& p_scale) { + set_diagonal(p_scale); + rotate(p_quat); +} + +void Basis::set_diagonal(const Vector3& p_diag) { + elements[0][0] = p_diag.x; + elements[0][1] = 0; + elements[0][2] = 0; + + elements[1][0] = 0; + elements[1][1] = p_diag.y; + elements[1][2] = 0; + + elements[2][0] = 0; + elements[2][1] = 0; + elements[2][2] = p_diag.z; +} + +Basis Basis::slerp(const Basis& target, const double& t) const { + //consider scale + Quat from(*this); + Quat to(target); + + Basis b(from.slerp(to, t)); + b.elements[0] *= Math::lerp(elements[0].length(), target.elements[0].length(), t); + b.elements[1] *= Math::lerp(elements[1].length(), target.elements[1].length(), t); + b.elements[2] *= Math::lerp(elements[2].length(), target.elements[2].length(), t); + + return b; +} + +void Basis::rotate_sh(double* p_values) { + // code by John Hable + // http://filmicworlds.com/blog/simple-and-fast-spherical-harmonic-rotation/ + // this code is Public Domain + + const static double s_c3 = 0.94617469575; // (3*sqrt(5))/(4*sqrt(pi)) + const static double s_c4 = -0.31539156525; // (-sqrt(5))/(4*sqrt(pi)) + const static double s_c5 = 0.54627421529; // (sqrt(15))/(4*sqrt(pi)) + + const static double s_c_scale = 1.0 / 0.91529123286551084; + const static double s_c_scale_inv = 0.91529123286551084; + + const static double s_rc2 = 1.5853309190550713 * s_c_scale; + const static double s_c4_div_c3 = s_c4 / s_c3; + const static double s_c4_div_c3_x2 = (s_c4 / s_c3) * 2.0; + + const static double s_scale_dst2 = s_c3 * s_c_scale_inv; + const static double s_scale_dst4 = s_c5 * s_c_scale_inv; + + double src[9] = { p_values[0], p_values[1], p_values[2], p_values[3], p_values[4], p_values[5], p_values[6], p_values[7], p_values[8] }; + + double m00 = elements[0][0]; + double m01 = elements[0][1]; + double m02 = elements[0][2]; + double m10 = elements[1][0]; + double m11 = elements[1][1]; + double m12 = elements[1][2]; + double m20 = elements[2][0]; + double m21 = elements[2][1]; + double m22 = elements[2][2]; + + p_values[0] = src[0]; + p_values[1] = m11 * src[1] - m12 * src[2] + m10 * src[3]; + p_values[2] = -m21 * src[1] + m22 * src[2] - m20 * src[3]; + p_values[3] = m01 * src[1] - m02 * src[2] + m00 * src[3]; + + double sh0 = src[7] + src[8] + src[8] - src[5]; + double sh1 = src[4] + s_rc2 * src[6] + src[7] + src[8]; + double sh2 = src[4]; + double sh3 = -src[7]; + double sh4 = -src[5]; + + // Rotations. R0 and R1 just use the raw matrix columns + double r2x = m00 + m01; + double r2y = m10 + m11; + double r2z = m20 + m21; + + double r3x = m00 + m02; + double r3y = m10 + m12; + double r3z = m20 + m22; + + double r4x = m01 + m02; + double r4y = m11 + m12; + double r4z = m21 + m22; + + // dense matrix multiplication one column at a time + + // column 0 + double sh0_x = sh0 * m00; + double sh0_y = sh0 * m10; + double d0 = sh0_x * m10; + double d1 = sh0_y * m20; + double d2 = sh0 * (m20 * m20 + s_c4_div_c3); + double d3 = sh0_x * m20; + double d4 = sh0_x * m00 - sh0_y * m10; + + // column 1 + double sh1_x = sh1 * m02; + double sh1_y = sh1 * m12; + d0 += sh1_x * m12; + d1 += sh1_y * m22; + d2 += sh1 * (m22 * m22 + s_c4_div_c3); + d3 += sh1_x * m22; + d4 += sh1_x * m02 - sh1_y * m12; + + // column 2 + double sh2_x = sh2 * r2x; + double sh2_y = sh2 * r2y; + d0 += sh2_x * r2y; + d1 += sh2_y * r2z; + d2 += sh2 * (r2z * r2z + s_c4_div_c3_x2); + d3 += sh2_x * r2z; + d4 += sh2_x * r2x - sh2_y * r2y; + + // column 3 + double sh3_x = sh3 * r3x; + double sh3_y = sh3 * r3y; + d0 += sh3_x * r3y; + d1 += sh3_y * r3z; + d2 += sh3 * (r3z * r3z + s_c4_div_c3_x2); + d3 += sh3_x * r3z; + d4 += sh3_x * r3x - sh3_y * r3y; + + // column 4 + double sh4_x = sh4 * r4x; + double sh4_y = sh4 * r4y; + d0 += sh4_x * r4y; + d1 += sh4_y * r4z; + d2 += sh4 * (r4z * r4z + s_c4_div_c3_x2); + d3 += sh4_x * r4z; + d4 += sh4_x * r4x - sh4_y * r4y; + + // extra multipliers + p_values[4] = d0; + p_values[5] = -d1; + p_values[6] = d2 * s_scale_dst2; + p_values[7] = -d3; + p_values[8] = d4 * s_scale_dst4; +} + + +Basis Basis::looking_at(const Vector3& p_target, const Vector3& p_up) { +#ifdef MATH_CHECKS + ERR_FAIL_COND_V_MSG(p_target.is_equal_approx(Vector3()), Basis(), "The target vector can't be zero."); + ERR_FAIL_COND_V_MSG(p_up.is_equal_approx(Vector3()), Basis(), "The up vector can't be zero."); +#endif + Vector3 v_z = -p_target.normalized(); + Vector3 v_x = p_up.cross(v_z); +#ifdef MATH_CHECKS + ERR_FAIL_COND_V_MSG(v_x.is_equal_approx(Vector3()), Basis(), "The target vector and up vector can't be parallel to each other."); +#endif + v_x.normalize(); + Vector3 v_y = v_z.cross(v_x); + + Basis basis; + basis.set(v_x, v_y, v_z); + return basis; +} \ No newline at end of file diff --git a/AugmentedHip/basis.h b/AugmentedHip/basis.h new file mode 100644 index 0000000..a2ca903 --- /dev/null +++ b/AugmentedHip/basis.h @@ -0,0 +1,300 @@ +#pragma once + +#include "vector3.h" +#include "quat.h" + +class Basis { +public: + Vector3 elements[3] = { + Vector3(1, 0, 0), + Vector3(0, 1, 0), + Vector3(0, 0, 1) + }; + + inline const Vector3& operator[](int axis) const { + return elements[axis]; + } + inline Vector3& operator[](int axis) { + return elements[axis]; + } + + void invert(); + void transpose(); + + Basis inverse() const; + Basis transposed() const; + + inline double determinant() const; + + void from_z(const Vector3& p_z); + + inline Vector3 get_axis(int p_axis) const { + // get actual basis axis (elements is transposed for performance) + return Vector3(elements[0][p_axis], elements[1][p_axis], elements[2][p_axis]); + } + inline void set_axis(int p_axis, const Vector3& p_value) { + // get actual basis axis (elements is transposed for performance) + elements[0][p_axis] = p_value.x; + elements[1][p_axis] = p_value.y; + elements[2][p_axis] = p_value.z; + } + + void rotate(const Vector3& p_axis, double p_phi); + Basis rotated(const Vector3& p_axis, double p_phi) const; + + void rotate_local(const Vector3& p_axis, double p_phi); + Basis rotated_local(const Vector3& p_axis, double p_phi) const; + + void rotate(const Vector3& p_euler); + Basis rotated(const Vector3& p_euler) const; + + void rotate(const Quat& p_quat); + Basis rotated(const Quat& p_quat) const; + + Vector3 get_rotation_euler() const; + void get_rotation_axis_angle(Vector3& p_axis, double& p_angle) const; + void get_rotation_axis_angle_local(Vector3& p_axis, double& p_angle) const; + Quat get_rotation_quat() const; + Vector3 get_rotation() const { return get_rotation_euler(); }; + + Vector3 rotref_posscale_decomposition(Basis& rotref) const; + + Vector3 get_euler_xyz() const; + void set_euler_xyz(const Vector3& p_euler); + + Vector3 get_euler_xzy() const; + void set_euler_xzy(const Vector3& p_euler); + + Vector3 get_euler_yzx() const; + void set_euler_yzx(const Vector3& p_euler); + + Vector3 get_euler_yxz() const; + void set_euler_yxz(const Vector3& p_euler); + + Vector3 get_euler_zxy() const; + void set_euler_zxy(const Vector3& p_euler); + + Vector3 get_euler_zyx() const; + void set_euler_zyx(const Vector3& p_euler); + + Quat get_quat() const; + void set_quat(const Quat& p_quat); + + Vector3 get_euler() const { return get_euler_yxz(); } + void set_euler(const Vector3& p_euler) { set_euler_yxz(p_euler); } + + void get_axis_angle(Vector3& r_axis, double& r_angle) const; + void set_axis_angle(const Vector3& p_axis, double p_phi); + + void scale(const Vector3& p_scale); + Basis scaled(const Vector3& p_scale) const; + + void scale_local(const Vector3& p_scale); + Basis scaled_local(const Vector3& p_scale) const; + + void make_scale_uniform(); + float get_uniform_scale() const; + + Vector3 get_scale() const; + Vector3 get_scale_abs() const; + Vector3 get_scale_local() const; + + void set_axis_angle_scale(const Vector3& p_axis, double p_phi, const Vector3& p_scale); + void set_euler_scale(const Vector3& p_euler, const Vector3& p_scale); + void set_quat_scale(const Quat& p_quat, const Vector3& p_scale); + + // transposed dot products + inline double tdotx(const Vector3& v) const { + return elements[0][0] * v[0] + elements[1][0] * v[1] + elements[2][0] * v[2]; + } + inline double tdoty(const Vector3& v) const { + return elements[0][1] * v[0] + elements[1][1] * v[1] + elements[2][1] * v[2]; + } + inline double tdotz(const Vector3& v) const { + return elements[0][2] * v[0] + elements[1][2] * v[1] + elements[2][2] * v[2]; + } + + bool is_equal_approx(const Basis& p_basis) const; + + bool operator==(const Basis& p_matrix) const; + bool operator!=(const Basis& p_matrix) const; + + inline Vector3 xform(const Vector3& p_vector) const; + inline Vector3 xform_inv(const Vector3& p_vector) const; + inline void operator*=(const Basis& p_matrix); + inline Basis operator*(const Basis& p_matrix) const; + inline void operator+=(const Basis& p_matrix); + inline Basis operator+(const Basis& p_matrix) const; + inline void operator-=(const Basis& p_matrix); + inline Basis operator-(const Basis& p_matrix) const; + inline void operator*=(double p_val); + inline Basis operator*(double p_val) const; + + int get_orthogonal_index() const; + void set_orthogonal_index(int p_index); + + void set_diagonal(const Vector3& p_diag); + + bool is_orthogonal() const; + bool is_diagonal() const; + bool is_rotation() const; + + Basis slerp(const Basis& target, const double& t) const; + void rotate_sh(double* p_values); + + /* create / set */ + + inline void set(double xx, double xy, double xz, double yx, double yy, double yz, double zx, double zy, double zz) { + elements[0][0] = xx; + elements[0][1] = xy; + elements[0][2] = xz; + elements[1][0] = yx; + elements[1][1] = yy; + elements[1][2] = yz; + elements[2][0] = zx; + elements[2][1] = zy; + elements[2][2] = zz; + } + inline void set(const Vector3& p_x, const Vector3& p_y, const Vector3& p_z) { + set_axis(0, p_x); + set_axis(1, p_y); + set_axis(2, p_z); + } + inline Vector3 get_column(int i) const { + return Vector3(elements[0][i], elements[1][i], elements[2][i]); + } + + inline Vector3 get_row(int i) const { + return Vector3(elements[i][0], elements[i][1], elements[i][2]); + } + inline Vector3 get_main_diagonal() const { + return Vector3(elements[0][0], elements[1][1], elements[2][2]); + } + + inline void set_row(int i, const Vector3& p_row) { + elements[i][0] = p_row.x; + elements[i][1] = p_row.y; + elements[i][2] = p_row.z; + } + + inline void set_zero() { + elements[0].zero(); + elements[1].zero(); + elements[2].zero(); + } + + inline Basis transpose_xform(const Basis& m) const { + return Basis( + elements[0].x * m[0].x + elements[1].x * m[1].x + elements[2].x * m[2].x, + elements[0].x * m[0].y + elements[1].x * m[1].y + elements[2].x * m[2].y, + elements[0].x * m[0].z + elements[1].x * m[1].z + elements[2].x * m[2].z, + elements[0].y * m[0].x + elements[1].y * m[1].x + elements[2].y * m[2].x, + elements[0].y * m[0].y + elements[1].y * m[1].y + elements[2].y * m[2].y, + elements[0].y * m[0].z + elements[1].y * m[1].z + elements[2].y * m[2].z, + elements[0].z * m[0].x + elements[1].z * m[1].x + elements[2].z * m[2].x, + elements[0].z * m[0].y + elements[1].z * m[1].y + elements[2].z * m[2].y, + elements[0].z * m[0].z + elements[1].z * m[1].z + elements[2].z * m[2].z); + } + Basis(double xx, double xy, double xz, double yx, double yy, double yz, double zx, double zy, double zz) { + set(xx, xy, xz, yx, yy, yz, zx, zy, zz); + } + + void orthonormalize(); + Basis orthonormalized() const; + +#ifdef MATH_CHECKS + bool is_symmetric() const; +#endif + Basis diagonalize(); + + operator Quat() const { return get_quat(); } + + static Basis looking_at(const Vector3& p_target, const Vector3& p_up = Vector3(0, 1, 0)); + + Basis(const Quat& p_quat) { set_quat(p_quat); }; + Basis(const Quat& p_quat, const Vector3& p_scale) { set_quat_scale(p_quat, p_scale); } + + Basis(const Vector3& p_euler) { set_euler(p_euler); } + Basis(const Vector3& p_euler, const Vector3& p_scale) { set_euler_scale(p_euler, p_scale); } + + Basis(const Vector3& p_axis, double p_phi) { set_axis_angle(p_axis, p_phi); } + Basis(const Vector3& p_axis, double p_phi, const Vector3& p_scale) { set_axis_angle_scale(p_axis, p_phi, p_scale); } + + inline Basis(const Vector3& row0, const Vector3& row1, const Vector3& row2) { + elements[0] = row0; + elements[1] = row1; + elements[2] = row2; + } + + inline Basis() {} +}; + +inline void Basis::operator*=(const Basis& p_matrix) { + set( + p_matrix.tdotx(elements[0]), p_matrix.tdoty(elements[0]), p_matrix.tdotz(elements[0]), + p_matrix.tdotx(elements[1]), p_matrix.tdoty(elements[1]), p_matrix.tdotz(elements[1]), + p_matrix.tdotx(elements[2]), p_matrix.tdoty(elements[2]), p_matrix.tdotz(elements[2])); +} + +inline Basis Basis::operator*(const Basis& p_matrix) const { + return Basis( + p_matrix.tdotx(elements[0]), p_matrix.tdoty(elements[0]), p_matrix.tdotz(elements[0]), + p_matrix.tdotx(elements[1]), p_matrix.tdoty(elements[1]), p_matrix.tdotz(elements[1]), + p_matrix.tdotx(elements[2]), p_matrix.tdoty(elements[2]), p_matrix.tdotz(elements[2])); +} + +inline void Basis::operator+=(const Basis& p_matrix) { + elements[0] += p_matrix.elements[0]; + elements[1] += p_matrix.elements[1]; + elements[2] += p_matrix.elements[2]; +} + +inline Basis Basis::operator+(const Basis& p_matrix) const { + Basis ret(*this); + ret += p_matrix; + return ret; +} + +inline void Basis::operator-=(const Basis& p_matrix) { + elements[0] -= p_matrix.elements[0]; + elements[1] -= p_matrix.elements[1]; + elements[2] -= p_matrix.elements[2]; +} + +inline Basis Basis::operator-(const Basis& p_matrix) const { + Basis ret(*this); + ret -= p_matrix; + return ret; +} + +inline void Basis::operator*=(double p_val) { + elements[0] *= p_val; + elements[1] *= p_val; + elements[2] *= p_val; +} + +inline Basis Basis::operator*(double p_val) const { + Basis ret(*this); + ret *= p_val; + return ret; +} + +Vector3 Basis::xform(const Vector3& p_vector) const { + return Vector3( + elements[0].dot(p_vector), + elements[1].dot(p_vector), + elements[2].dot(p_vector)); +} + +Vector3 Basis::xform_inv(const Vector3& p_vector) const { + return Vector3( + (elements[0][0] * p_vector.x) + (elements[1][0] * p_vector.y) + (elements[2][0] * p_vector.z), + (elements[0][1] * p_vector.x) + (elements[1][1] * p_vector.y) + (elements[2][1] * p_vector.z), + (elements[0][2] * p_vector.x) + (elements[1][2] * p_vector.y) + (elements[2][2] * p_vector.z)); +} + +double Basis::determinant() const { + return elements[0][0] * (elements[1][1] * elements[2][2] - elements[2][1] * elements[1][2]) - + elements[1][0] * (elements[0][1] * elements[2][2] - elements[2][1] * elements[0][2]) + + elements[2][0] * (elements[0][1] * elements[1][2] - elements[1][1] * elements[0][2]); +} \ No newline at end of file diff --git a/AugmentedHip/driverlog.cpp b/AugmentedHip/driverlog.cpp new file mode 100644 index 0000000..2413c1c --- /dev/null +++ b/AugmentedHip/driverlog.cpp @@ -0,0 +1,59 @@ +//========= Copyright Valve Corporation ============// + +#include "driverlog.h" + +#include +#include + +static vr::IVRDriverLog* s_pLogFile = NULL; + +#if !defined( WIN32) +#define vsnprintf_s vsnprintf +#endif + +bool InitDriverLog(vr::IVRDriverLog* pDriverLog) +{ + if (s_pLogFile) + return false; + s_pLogFile = pDriverLog; + return s_pLogFile != NULL; +} + +void CleanupDriverLog() +{ + s_pLogFile = NULL; +} + +static void DriverLogVarArgs(const char* pMsgFormat, va_list args) +{ + char buf[1024]; + vsnprintf_s(buf, sizeof(buf), pMsgFormat, args); + + if (s_pLogFile) + s_pLogFile->Log(buf); +} + + +void DriverLog(const char* pMsgFormat, ...) +{ + va_list args; + va_start(args, pMsgFormat); + + DriverLogVarArgs(pMsgFormat, args); + + va_end(args); +} + + +void DebugDriverLog(const char* pMsgFormat, ...) +{ +#ifdef _DEBUG + va_list args; + va_start(args, pMsgFormat); + + DriverLogVarArgs(pMsgFormat, args); + + va_end(args); +#endif +} + diff --git a/AugmentedHip/driverlog.h b/AugmentedHip/driverlog.h new file mode 100644 index 0000000..97eb487 --- /dev/null +++ b/AugmentedHip/driverlog.h @@ -0,0 +1,25 @@ +//========= Copyright Valve Corporation ============// + +#ifndef DRIVERLOG_H +#define DRIVERLOG_H + +#pragma once + +#include +#include + +extern void DriverLog(const char* pchFormat, ...); + + +// -------------------------------------------------------------------------- +// Purpose: Write to the log file only in debug builds +// -------------------------------------------------------------------------- +extern void DebugDriverLog(const char* pchFormat, ...); + + +extern bool InitDriverLog(vr::IVRDriverLog* pDriverLog); +extern void CleanupDriverLog(); + + + +#endif // DRIVERLOG_H \ No newline at end of file diff --git a/AugmentedHip/drivermain.cpp b/AugmentedHip/drivermain.cpp new file mode 100644 index 0000000..1ca191b --- /dev/null +++ b/AugmentedHip/drivermain.cpp @@ -0,0 +1,24 @@ +#include + +#if defined(_WIN32) +#define HMD_DLL_EXPORT extern "C" __declspec( dllexport ) +#define HMD_DLL_IMPORT extern "C" __declspec( dllimport ) +#endif + +#include "DeviceProvider.h" +DeviceProvider g_serverDriverNull; + +HMD_DLL_EXPORT +void* HmdDriverFactory(const char* pInterfaceName, int* pReturnCode) +{ + if (0 == strcmp(vr::IServerTrackedDeviceProvider_Version, pInterfaceName)) + { + return &g_serverDriverNull; + } + + if (pReturnCode) + *pReturnCode = vr::VRInitError_Init_InterfaceNotFound; + + return NULL; +} + diff --git a/AugmentedHip/quat.cpp b/AugmentedHip/quat.cpp new file mode 100644 index 0000000..c1eb041 --- /dev/null +++ b/AugmentedHip/quat.cpp @@ -0,0 +1,218 @@ + +#include "quat.h" +#include "basis.h" + +// set_euler_xyz expects a vector containing the Euler angles in the format +// (ax,ay,az), where ax is the angle of rotation around x axis, +// and similar for other axes. +// This implementation uses XYZ convention (Z is the first rotation). +void Quat::set_euler_xyz(const Vector3& p_euler) { + double half_a1 = p_euler.x * 0.5; + double half_a2 = p_euler.y * 0.5; + double half_a3 = p_euler.z * 0.5; + + // R = X(a1).Y(a2).Z(a3) convention for Euler angles. + // Conversion to quaternion as listed in https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19770024290.pdf (page A-2) + // a3 is the angle of the first rotation, following the notation in this reference. + + double cos_a1 = std::cos(half_a1); + double sin_a1 = std::sin(half_a1); + double cos_a2 = std::cos(half_a2); + double sin_a2 = std::sin(half_a2); + double cos_a3 = std::cos(half_a3); + double sin_a3 = std::sin(half_a3); + + set(sin_a1 * cos_a2 * cos_a3 + sin_a2 * sin_a3 * cos_a1, + -sin_a1 * sin_a3 * cos_a2 + sin_a2 * cos_a1 * cos_a3, + sin_a1 * sin_a2 * cos_a3 + sin_a3 * cos_a1 * cos_a2, + -sin_a1 * sin_a2 * sin_a3 + cos_a1 * cos_a2 * cos_a3); +} + +// get_euler_xyz returns a vector containing the Euler angles in the format +// (ax,ay,az), where ax is the angle of rotation around x axis, +// and similar for other axes. +// This implementation uses XYZ convention (Z is the first rotation). +Vector3 Quat::get_euler_xyz() const { + Basis m(*this); + return m.get_euler_xyz(); +} + +// set_euler_yxz expects a vector containing the Euler angles in the format +// (ax,ay,az), where ax is the angle of rotation around x axis, +// and similar for other axes. +// This implementation uses YXZ convention (Z is the first rotation). +void Quat::set_euler_yxz(const Vector3& p_euler) { + double half_a1 = p_euler.y * 0.5; + double half_a2 = p_euler.x * 0.5; + double half_a3 = p_euler.z * 0.5; + + // R = Y(a1).X(a2).Z(a3) convention for Euler angles. + // Conversion to quaternion as listed in https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19770024290.pdf (page A-6) + // a3 is the angle of the first rotation, following the notation in this reference. + + double cos_a1 = std::cos(half_a1); + double sin_a1 = std::sin(half_a1); + double cos_a2 = std::cos(half_a2); + double sin_a2 = std::sin(half_a2); + double cos_a3 = std::cos(half_a3); + double sin_a3 = std::sin(half_a3); + + set(sin_a1 * cos_a2 * sin_a3 + cos_a1 * sin_a2 * cos_a3, + sin_a1 * cos_a2 * cos_a3 - cos_a1 * sin_a2 * sin_a3, + -sin_a1 * sin_a2 * cos_a3 + cos_a1 * cos_a2 * sin_a3, + sin_a1 * sin_a2 * sin_a3 + cos_a1 * cos_a2 * cos_a3); +} + +// get_euler_yxz returns a vector containing the Euler angles in the format +// (ax,ay,az), where ax is the angle of rotation around x axis, +// and similar for other axes. +// This implementation uses YXZ convention (Z is the first rotation). +Vector3 Quat::get_euler_yxz() const { +#ifdef MATH_CHECKS + ERR_FAIL_COND_V_MSG(!is_normalized(), Vector3(0, 0, 0), "The quaternion must be normalized."); +#endif + Basis m(*this); + return m.get_euler_yxz(); +} + +void Quat::operator*=(const Quat& q) { + set(w * q.x + x * q.w + y * q.z - z * q.y, + w * q.y + y * q.w + z * q.x - x * q.z, + w * q.z + z * q.w + x * q.y - y * q.x, + w * q.w - x * q.x - y * q.y - z * q.z); +} + +Quat Quat::operator*(const Quat& q) const { + Quat r = *this; + r *= q; + return r; +} + +bool Quat::is_equal_approx(const Quat& p_quat) const { + return Math::is_equal_approx(x, p_quat.x) && Math::is_equal_approx(y, p_quat.y) && Math::is_equal_approx(z, p_quat.z) && Math::is_equal_approx(w, p_quat.w); +} + +double Quat::length() const { + return std::sqrt(length_squared()); +} + +void Quat::normalize() { + *this /= length(); +} + +Quat Quat::normalized() const { + return *this / length(); +} + +bool Quat::is_normalized() const { + return Math::is_equal_approx(length_squared(), 1.0, UNIT_EPSILON); //use less epsilon +} + +Quat Quat::inverse() const { +#ifdef MATH_CHECKS + ERR_FAIL_COND_V_MSG(!is_normalized(), Quat(), "The quaternion must be normalized."); +#endif + return Quat(-x, -y, -z, w); +} + +Quat Quat::slerp(const Quat& q, const double& t) const { +#ifdef MATH_CHECKS + ERR_FAIL_COND_V_MSG(!is_normalized(), Quat(), "The start quaternion must be normalized."); + ERR_FAIL_COND_V_MSG(!q.is_normalized(), Quat(), "The end quaternion must be normalized."); +#endif + Quat to1; + double omega, cosom, sinom, scale0, scale1; + + // calc cosine + cosom = dot(q); + + // adjust signs (if necessary) + if (cosom < 0.0) { + cosom = -cosom; + to1.x = -q.x; + to1.y = -q.y; + to1.z = -q.z; + to1.w = -q.w; + } + else { + to1.x = q.x; + to1.y = q.y; + to1.z = q.z; + to1.w = q.w; + } + + // calculate coefficients + + if ((1.0 - cosom) > CMP_EPSILON) { + // standard case (slerp) + omega = std::acos(cosom); + sinom = std::sin(omega); + scale0 = std::sin((1.0 - t) * omega) / sinom; + scale1 = std::sin(t * omega) / sinom; + } + else { + // "from" and "to" quaternions are very close + // ... so we can do a linear interpolation + scale0 = 1.0 - t; + scale1 = t; + } + // calculate final values + return Quat( + scale0 * x + scale1 * to1.x, + scale0 * y + scale1 * to1.y, + scale0 * z + scale1 * to1.z, + scale0 * w + scale1 * to1.w); +} + +Quat Quat::slerpni(const Quat& q, const double& t) const { +#ifdef MATH_CHECKS + ERR_FAIL_COND_V_MSG(!is_normalized(), Quat(), "The start quaternion must be normalized."); + ERR_FAIL_COND_V_MSG(!q.is_normalized(), Quat(), "The end quaternion must be normalized."); +#endif + const Quat& from = *this; + + double dot = from.dot(q); + + if (std::abs(dot) > 0.9999) { + return from; + } + + double theta = std::acos(dot), + sinT = 1.0 / std::sin(theta), + newFactor = std::sin(t * theta) * sinT, + invFactor = std::sin((1.0 - t) * theta) * sinT; + + return Quat(invFactor * from.x + newFactor * q.x, + invFactor * from.y + newFactor * q.y, + invFactor * from.z + newFactor * q.z, + invFactor * from.w + newFactor * q.w); +} + +Quat Quat::cubic_slerp(const Quat& q, const Quat& prep, const Quat& postq, const double& t) const { +#ifdef MATH_CHECKS + ERR_FAIL_COND_V_MSG(!is_normalized(), Quat(), "The start quaternion must be normalized."); + ERR_FAIL_COND_V_MSG(!q.is_normalized(), Quat(), "The end quaternion must be normalized."); +#endif + //the only way to do slerp :| + double t2 = (1.0 - t) * t * 2; + Quat sp = this->slerp(q, t); + Quat sq = prep.slerpni(postq, t); + return sp.slerpni(sq, t2); +} + +void Quat::set_axis_angle(const Vector3& axis, const double& angle) { +#ifdef MATH_CHECKS + ERR_FAIL_COND_MSG(!axis.is_normalized(), "The axis Vector3 must be normalized."); +#endif + double d = axis.length(); + if (d == 0) { + set(0, 0, 0, 0); + } + else { + double sin_angle = std::sin(angle * 0.5); + double cos_angle = std::cos(angle * 0.5); + double s = sin_angle / d; + set(axis.x * s, axis.y * s, axis.z * s, + cos_angle); + } +} \ No newline at end of file diff --git a/AugmentedHip/quat.h b/AugmentedHip/quat.h new file mode 100644 index 0000000..73c388f --- /dev/null +++ b/AugmentedHip/quat.h @@ -0,0 +1,265 @@ +#pragma once + +#include "shared.h" +#include "vector3.h" +#include + +class Basis; + +class Quat { +public: + union { + struct { + double x; + double y; + double z; + double w; + }; + double components[4] = { 0, 0, 0, 1.0 }; + }; + + inline Vector3 xyz() { + return Vector3(x, y, z); + } + + inline double& operator[](int idx) { + return components[idx]; + } + inline const double& operator[](int idx) const { + return components[idx]; + } + inline double length_squared() const; + bool is_equal_approx(const Quat& p_quat) const; + double length() const; + void normalize(); + Quat normalized() const; + bool is_normalized() const; + Quat inverse() const; + inline double dot(const Quat& q) const; + + void set_euler_xyz(const Vector3& p_euler); + Vector3 get_euler_xyz() const; + void set_euler_yxz(const Vector3& p_euler); + Vector3 get_euler_yxz() const; + + void set_euler(const Vector3& p_euler) { set_euler_yxz(p_euler); }; + Vector3 get_euler() const { return get_euler_yxz(); }; + + Quat slerp(const Quat& q, const double& t) const; + Quat slerpni(const Quat& q, const double& t) const; + Quat cubic_slerp(const Quat& q, const Quat& prep, const Quat& postq, const double& t) const; + + void set_axis_angle(const Vector3& axis, const double& angle); + inline void get_axis_angle(Vector3& r_axis, double& r_angle) const { + r_angle = 2 * std::acos(w); + double r = ((double)1) / std::sqrt(1 - w * w); + r_axis.x = x * r; + r_axis.y = y * r; + r_axis.z = z * r; + } + + void operator*=(const Quat& q); + Quat operator*(const Quat& q) const; + + Quat operator*(const Vector3& v) const { + return Quat(w * v.x + y * v.z - z * v.y, + w * v.y + z * v.x - x * v.z, + w * v.z + x * v.y - y * v.x, + -x * v.x - y * v.y - z * v.z); + } + + inline Vector3 xform(const Vector3& v) const { +#ifdef MATH_CHECKS + ERR_FAIL_COND_V_MSG(!is_normalized(), v, "The quaternion must be normalized."); +#endif + Vector3 u(x, y, z); + Vector3 uv = u.cross(v); + return v + ((uv * w) + u.cross(uv)) * ((double)2); + } + + inline Vector3 xform_inv(const Vector3& v) const { + return inverse().xform(v); + } + + inline void operator+=(const Quat& q); + inline void operator-=(const Quat& q); + inline void operator*=(const double& s); + inline void operator/=(const double& s); + inline Quat operator+(const Quat& q2) const; + inline Quat operator-(const Quat& q2) const; + inline Quat operator-() const; + inline Quat operator*(const double& s) const; + inline Quat operator/(const double& s) const; + + inline bool operator==(const Quat& p_quat) const; + inline bool operator!=(const Quat& p_quat) const; + + inline void set(double p_x, double p_y, double p_z, double p_w) { + x = p_x; + y = p_y; + z = p_z; + w = p_w; + } + + inline Quat() : x(0.0), y(0.0), z(0.0), w(0.0) {} + inline Quat(double p_x, double p_y, double p_z, double p_w) : + x(p_x), + y(p_y), + z(p_z), + w(p_w) { + } + Quat(const Vector3& axis, const double& angle) { set_axis_angle(axis, angle); } + + Quat(const Vector3& euler) { set_euler(euler); } + Quat(const Quat& q) : + x(q.x), + y(q.y), + z(q.z), + w(q.w) { + } + + Quat& operator=(const Quat& q) { + x = q.x; + y = q.y; + z = q.z; + w = q.w; + return *this; + } + + Quat(const Vector3& v0, const Vector3& v1) // shortest arc + { + Vector3 c = v0.cross(v1); + double d = v0.dot(v1); + + if (d < -1.0 + CMP_EPSILON) { + x = 0; + y = 1; + z = 0; + w = 0; + } + else { + double s = std::sqrt((1.0 + d) * 2.0); + double rs = 1.0 / s; + + x = c.x * rs; + y = c.y * rs; + z = c.z * rs; + w = s * 0.5; + } + } + + static Quat lookAt(Vector3& v0, Vector3& v1) { + + Vector3 forward = v0; + v0.normalize(); + Vector3 up = v1.orthogonal(forward); // Keeps up the same, make forward orthogonal to up + Vector3 right = up.cross(forward); + + Quat ret; + ret.w = sqrtf(1.0f + right.x + up.y + forward.z) * 0.5f; + float w4_recip = 1.0f / (4.0f * ret.w); + ret.x = (forward.y - up.z) * w4_recip; + ret.y = (right.z - forward.x) * w4_recip; + ret.z = (up.x - right.y) * w4_recip; + + return ret; + } + + static Quat lookAt(const Vector3& v0, const Vector3& v1) { + double lengthsq = v0.length_squared(); + Vector3 forward; + if (lengthsq == 0) { + forward = Vector3(0, 0, 0); + } + else { + double length = std::sqrt(lengthsq); + forward = Vector3(v0.x / length, v0.y / length, v0.z / length); + } + Vector3 up = v1.orthogonal(forward); // Keeps up the same, make forward orthogonal to up + Vector3 right = up.cross(forward); + + Quat ret; + ret.w = sqrtf(1.0f + right.x + up.y + forward.z) * 0.5f; + float w4_recip = 1.0f / (4.0f * ret.w); + ret.x = (forward.y - up.z) * w4_recip; + ret.y = (right.z - forward.x) * w4_recip; + ret.z = (up.x - right.y) * w4_recip; + + return ret; + } + + static Quat fromToRotation(const Vector3& from, const Vector3& to) { + Vector3 axis = from.cross(to).normalized(); + double angle = from.angle_to(to); + Quat quat = Quat(axis, angle); + return quat; + } +}; + +double Quat::dot(const Quat& q) const { + return x * q.x + y * q.y + z * q.z + w * q.w; +} + +double Quat::length_squared() const { + return dot(*this); +} + +void Quat::operator+=(const Quat& q) { + x += q.x; + y += q.y; + z += q.z; + w += q.w; +} + +void Quat::operator-=(const Quat& q) { + x -= q.x; + y -= q.y; + z -= q.z; + w -= q.w; +} + +void Quat::operator*=(const double& s) { + x *= s; + y *= s; + z *= s; + w *= s; +} + +void Quat::operator/=(const double& s) { + *this *= 1.0 / s; +} + +Quat Quat::operator+(const Quat& q2) const { + const Quat& q1 = *this; + return Quat(q1.x + q2.x, q1.y + q2.y, q1.z + q2.z, q1.w + q2.w); +} + +Quat Quat::operator-(const Quat& q2) const { + const Quat& q1 = *this; + return Quat(q1.x - q2.x, q1.y - q2.y, q1.z - q2.z, q1.w - q2.w); +} + +Quat Quat::operator-() const { + const Quat& q2 = *this; + return Quat(-q2.x, -q2.y, -q2.z, -q2.w); +} + +Quat Quat::operator*(const double& s) const { + return Quat(x * s, y * s, z * s, w * s); +} + +Quat Quat::operator/(const double& s) const { + return *this * (1.0 / s); +} + +bool Quat::operator==(const Quat& p_quat) const { + return x == p_quat.x && y == p_quat.y && z == p_quat.z && w == p_quat.w; +} + +bool Quat::operator!=(const Quat& p_quat) const { + return x != p_quat.x || y != p_quat.y || z != p_quat.z || w != p_quat.w; +} + +inline Quat operator*(const double& p_real, const Quat& p_quat) { + return p_quat * p_real; +} \ No newline at end of file diff --git a/AugmentedHip/quaternion.h b/AugmentedHip/quaternion.h new file mode 100644 index 0000000..b0b6783 --- /dev/null +++ b/AugmentedHip/quaternion.h @@ -0,0 +1,114 @@ +#pragma once + +#include +#include + +#include "quat.h" + +namespace quaternion +{ + inline vr::HmdQuaternion_t fromHmdMatrix34(vr::HmdMatrix34_t matrix) + { + vr::HmdQuaternion_t q; + + q.w = sqrt(fmax(0, + static_cast(1 + matrix.m[0][0] + matrix.m[1][1] + + matrix.m[2][2]))) + / 2; + q.x = sqrt(fmax(0, + static_cast(1 + matrix.m[0][0] - matrix.m[1][1] + - matrix.m[2][2]))) + / 2; + q.y = sqrt(fmax(0, + static_cast(1 - matrix.m[0][0] + matrix.m[1][1] + - matrix.m[2][2]))) + / 2; + q.z = sqrt(fmax(0, + static_cast(1 - matrix.m[0][0] - matrix.m[1][1] + + matrix.m[2][2]))) + / 2; + q.x = copysign(q.x, + static_cast(matrix.m[2][1] - matrix.m[1][2])); + q.y = copysign(q.y, + static_cast(matrix.m[0][2] - matrix.m[2][0])); + q.z = copysign(q.z, + static_cast(matrix.m[1][0] - matrix.m[0][1])); + return q; + } + + inline vr::HmdQuaternion_t multiply(const vr::HmdQuaternion_t& lhs, + const vr::HmdQuaternion_t& q) + { + + double nw = lhs.w * q.w - lhs.x * q.x - lhs.y * q.y - lhs.z * q.z; + double nx = lhs.w * q.x + lhs.x * q.w + lhs.y * q.z - lhs.z * q.y; + double ny = lhs.w * q.y + lhs.y * q.w + lhs.z * q.x - lhs.x * q.z; + + return { nw, nx, ny, lhs.w * q.z + lhs.z * q.w + lhs.x * q.y - lhs.y * q.x }; + } + + inline vr::HmdQuaternion_t conjugate(const vr::HmdQuaternion_t& quat) + { + return { + quat.w, + -quat.x, + -quat.y, + -quat.z, + }; + } + + inline double getYaw(const vr::HmdQuaternion_t& quat) + { + double yawResult + = atan2(2.0 * (quat.y * quat.w + quat.x * quat.z), + (2.0 * (quat.w * quat.w + quat.x * quat.x)) - 1.0); + return yawResult; + } + + inline double getPitch(const vr::HmdQuaternion_t& quat) + { + // positive forward + // negative behind + + double pitchResult + = atan2(2.0 * (quat.x * quat.w + quat.y * quat.z), + 1.0 - 2.0 * (quat.x * quat.x + quat.y * quat.y)); + // double pitchResult + //= atan2( 2.0 * ( quat.x * quat.w + quat.y * quat.z ), + // 2.0 * ( quat.w * quat.w + quat.z * quat.z ) - 1.0 ); + return pitchResult; + } + + inline double getRoll(const vr::HmdQuaternion_t& quat) + { + double rollResult; + double sinp = 2 * (quat.w * quat.z - quat.y * quat.x); + if (std::abs(sinp) >= 1) + + { + rollResult = std::copysign(3.14159265358979323846 / 2, sinp); + } + else + { + rollResult = std::asin(sinp); + } + return rollResult; + } + + inline vr::HmdQuaternion_t fromAxisAngle(double x, double y, double z, double a) { + double s = sin(a / 2.0); + return { cos(a / 2.0), x * s, y * s, z * s }; + } + + inline vr::HmdQuaternion_t init(double x, double y, double z, double w) { + return { w, x, y, z }; + } + + + inline vr::HmdQuaternion_t from_Quat(Quat q) { + return init(q.x, q.y, q.z, q.w); + } + inline Quat to_Quat(vr::HmdQuaternion_t q) { + return Quat(q.x, q.y, q.z, q.w); + } +} // namespace quaternion \ No newline at end of file diff --git a/AugmentedHip/shared.h b/AugmentedHip/shared.h new file mode 100644 index 0000000..e2b0c88 --- /dev/null +++ b/AugmentedHip/shared.h @@ -0,0 +1,130 @@ +#pragma once + +#include + +#define UNIT_EPSILON 0.00001 + +#define CMP_EPSILON 0.00001 +#define CMP_EPSILON2 (CMP_EPSILON * CMP_EPSILON) + +#define CMP_NORMALIZE_TOLERANCE 0.000001 +#define CMP_POINT_IN_PLANE_EPSILON 0.00001 + +#define Math_SQRT12 0.7071067811865475244008443621048490 +#define Math_SQRT2 1.4142135623730950488016887242 +#define Math_LN2 0.6931471805599453094172321215 +#define Math_TAU 6.2831853071795864769252867666 +#define Math_PI 3.14159265358979323846264338332795 +#define Math_E 2.7182818284590452353602874714 +#define Math_INF INFINITY +#define Math_NAN NAN + +#define DEG_TO_RAD (Math_PI / 180.0) + +// Generic ABS function, for math uses please use Math::abs. +#ifndef ABS +#define ABS(m_v) (((m_v) < 0) ? (-(m_v)) : (m_v)) +#endif + +#ifndef SGN +#define SGN(m_v) (((m_v) < 0) ? (-1.0) : (+1.0)) +#endif + +#ifndef MIN +#define MIN(m_a, m_b) (((m_a) < (m_b)) ? (m_a) : (m_b)) +#endif + +#ifndef MAX +#define MAX(m_a, m_b) (((m_a) > (m_b)) ? (m_a) : (m_b)) +#endif + +#ifndef CLAMP +#define CLAMP(m_a, m_min, m_max) (((m_a) < (m_min)) ? (m_min) : (((m_a) > (m_max)) ? m_max : m_a)) +#endif + +// Generic swap template. +#ifndef SWAP +#define SWAP(m_x, m_y) __swap_tmpl((m_x), (m_y)) +template +inline void __swap_tmpl(T& x, T& y) { + T aux = x; + x = y; + y = aux; +} +#endif // SWAP + +namespace Math { + inline double fposmod(double p_x, double p_y) { + return (p_x >= 0) ? std::fmod(p_x, p_y) : p_y - std::fmod(-p_x, p_y); + } + + + inline bool is_equal_approx(double a, double b) { + // Check for exact equality first, required to handle "infinity" values. + if (a == b) { + return true; + } + // Then check for approximate equality. + double tolerance = UNIT_EPSILON * abs(a); + if (tolerance < UNIT_EPSILON) { + tolerance = UNIT_EPSILON; + } + return abs(a - b) < tolerance; + } + + inline bool is_equal_approx(double a, double b, double eps) { + // Check for exact equality first, required to handle "infinity" values. + if (a == b) { + return true; + } + // Then check for approximate equality. + return abs(a - b) < eps; + } + + inline bool is_zero_approx(double a) { + return (is_equal_approx(a, 0.)); + } + + + + static inline double lerp(double p_from, double p_to, double p_weight) { return p_from + (p_to - p_from) * p_weight; } + static inline float lerp(float p_from, float p_to, float p_weight) { return p_from + (p_to - p_from) * p_weight; } + + static inline double lerp_angle(double p_from, double p_to, double p_weight) { + double difference = fmod(p_to - p_from, Math_TAU); + double distance = fmod(2.0 * difference, Math_TAU) - difference; + return p_from + distance * p_weight; + } + static inline float lerp_angle(float p_from, float p_to, float p_weight) { + float difference = fmod(p_to - p_from, (float)Math_TAU); + float distance = fmod(2.0f * difference, (float)Math_TAU) - difference; + return p_from + distance * p_weight; + } + + static inline double inverse_lerp(double p_from, double p_to, double p_value) { return (p_value - p_from) / (p_to - p_from); } + static inline float inverse_lerp(float p_from, float p_to, float p_value) { return (p_value - p_from) / (p_to - p_from); } + + static inline double range_lerp(double p_value, double p_istart, double p_istop, double p_ostart, double p_ostop) { return Math::lerp(p_ostart, p_ostop, Math::inverse_lerp(p_istart, p_istop, p_value)); } + static inline float range_lerp(float p_value, float p_istart, float p_istop, float p_ostart, float p_ostop) { return Math::lerp(p_ostart, p_ostop, Math::inverse_lerp(p_istart, p_istop, p_value)); } + + static inline double smoothstep(double p_from, double p_to, double p_s) { + if (is_equal_approx(p_from, p_to)) { + return p_from; + } + double s = CLAMP((p_s - p_from) / (p_to - p_from), 0.0, 1.0); + return s * s * (3.0 - 2.0 * s); + } + static inline float smoothstep(float p_from, float p_to, float p_s) { + if (is_equal_approx(p_from, p_to)) { + return p_from; + } + float s = CLAMP((p_s - p_from) / (p_to - p_from), 0.0f, 1.0f); + return s * s * (3.0f - 2.0f * s); + } + + + inline int sign(double a) { + return (a > 0) ? 1 : -1; + } + +}; \ No newline at end of file diff --git a/AugmentedHip/util.h b/AugmentedHip/util.h new file mode 100644 index 0000000..76226b5 --- /dev/null +++ b/AugmentedHip/util.h @@ -0,0 +1,47 @@ +#pragma once + +#include +#include "quat.h" +#include "basis.h" + +inline void HmdMatrix_SetIdentity(vr::HmdMatrix34_t* pMatrix) { + pMatrix->m[0][0] = 1.f; + pMatrix->m[0][1] = 0.f; + pMatrix->m[0][2] = 0.f; + pMatrix->m[0][3] = 0.f; + pMatrix->m[1][0] = 0.f; + pMatrix->m[1][1] = 1.f; + pMatrix->m[1][2] = 0.f; + pMatrix->m[1][3] = 0.f; + pMatrix->m[2][0] = 0.f; + pMatrix->m[2][1] = 0.f; + pMatrix->m[2][2] = 1.f; + pMatrix->m[2][3] = 0.f; +} + +inline double get_yaw(Basis basis, Vector3 front_v) { + // xform to get front vector (up points front) + Vector3 front_relative = basis.xform(front_v); + + + // flatten to XZ for yaw + front_relative = (front_relative * Vector3(1, 0, 1)).normalized(); + + // get angle + double angle = front_relative.angle_to(Vector3(0, 0, 1)); + + // convert to offset (idk why front_relative.x works) + return -angle * Math::sign(front_relative.x); +} + +inline double get_yaw(Quat quat) { + return get_yaw(Basis(quat), Vector3(0, 1, 0)); +} + +inline Basis from_hmdMatrix(const vr::HmdMatrix34_t& matrix) { + return Basis( + matrix.m[0][0], matrix.m[0][1], matrix.m[0][2], + matrix.m[1][0], matrix.m[1][1], matrix.m[1][2], + matrix.m[2][0], matrix.m[2][1], matrix.m[2][2] + ); +} \ No newline at end of file diff --git a/AugmentedHip/vector3.cpp b/AugmentedHip/vector3.cpp new file mode 100644 index 0000000..979af2b --- /dev/null +++ b/AugmentedHip/vector3.cpp @@ -0,0 +1,119 @@ + +#include "vector3.h" +#include "basis.h" + +void Vector3::rotate(const Vector3& p_axis, double p_phi) { + *this = Basis(p_axis, p_phi).xform(*this); +} + +Vector3 Vector3::rotated(const Vector3& p_axis, double p_phi) const { + Vector3 r = *this; + r.rotate(p_axis, p_phi); + return r; +} + +void Vector3::set_axis(int p_axis, double p_value) { + coord[p_axis] = p_value; +} + +double Vector3::get_axis(int p_axis) const { + return operator[](p_axis); +} + +int Vector3::min_axis() const { + return x < y ? (x < z ? 0 : 2) : (y < z ? 1 : 2); +} + +int Vector3::max_axis() const { + return x < y ? (y < z ? 2 : 1) : (x < z ? 2 : 0); +} + +/* +void Vector3::snap(Vector3 p_val) { + x = Math::stepify(x, p_val.x); + y = Math::stepify(y, p_val.y); + z = Math::stepify(z, p_val.z); +}*/ +/* +Vector3 Vector3::snapped(Vector3 p_val) const { + Vector3 v = *this; + v.snap(p_val); + return v; +} +*/ + +Vector3 Vector3::cubic_interpolaten(const Vector3& p_b, const Vector3& p_pre_a, const Vector3& p_post_b, double p_t) const { + Vector3 p0 = p_pre_a; + Vector3 p1 = *this; + Vector3 p2 = p_b; + Vector3 p3 = p_post_b; + + { + //normalize + + double ab = p0.distance_to(p1); + double bc = p1.distance_to(p2); + double cd = p2.distance_to(p3); + + if (ab > 0) { + p0 = p1 + (p0 - p1) * (bc / ab); + } + if (cd > 0) { + p3 = p2 + (p3 - p2) * (bc / cd); + } + } + + double t = p_t; + double t2 = t * t; + double t3 = t2 * t; + + Vector3 out; + out = 0.5 * ((p1 * 2.0) + + (-p0 + p2) * t + + (2.0 * p0 - 5.0 * p1 + 4.0 * p2 - p3) * t2 + + (-p0 + 3.0 * p1 - 3.0 * p2 + p3) * t3); + return out; +} + +Vector3 Vector3::cubic_interpolate(const Vector3& p_b, const Vector3& p_pre_a, const Vector3& p_post_b, double p_t) const { + Vector3 p0 = p_pre_a; + Vector3 p1 = *this; + Vector3 p2 = p_b; + Vector3 p3 = p_post_b; + + double t = p_t; + double t2 = t * t; + double t3 = t2 * t; + + Vector3 out; + out = 0.5 * ((p1 * 2.0) + + (-p0 + p2) * t + + (2.0 * p0 - 5.0 * p1 + 4.0 * p2 - p3) * t2 + + (-p0 + 3.0 * p1 - 3.0 * p2 + p3) * t3); + return out; +} + +Vector3 Vector3::move_toward(const Vector3& p_to, const double p_delta) const { + Vector3 v = *this; + Vector3 vd = p_to - v; + double len = vd.length(); + return len <= p_delta || len < UNIT_EPSILON ? p_to : v + vd / len * p_delta; +} + +Basis Vector3::outer(const Vector3& p_b) const { + Vector3 row0(x * p_b.x, x * p_b.y, x * p_b.z); + Vector3 row1(y * p_b.x, y * p_b.y, y * p_b.z); + Vector3 row2(z * p_b.x, z * p_b.y, z * p_b.z); + + return Basis(row0, row1, row2); +} + +Basis Vector3::to_diagonal_matrix() const { + return Basis(x, 0, 0, + 0, y, 0, + 0, 0, z); +} + +bool Vector3::is_equal_approx(const Vector3& p_v) const { + return Math::is_equal_approx(x, p_v.x) && Math::is_equal_approx(y, p_v.y) && Math::is_equal_approx(z, p_v.z); +} \ No newline at end of file diff --git a/AugmentedHip/vector3.h b/AugmentedHip/vector3.h new file mode 100644 index 0000000..99eaab3 --- /dev/null +++ b/AugmentedHip/vector3.h @@ -0,0 +1,420 @@ +#pragma once + +#include "shared.h" + +class Basis; + +struct Vector3 { + enum Axis { + AXIS_X, + AXIS_Y, + AXIS_Z, + }; + + union { + struct { + double x; + double y; + double z; + }; + + double coord[3] = { 0 }; + }; + + inline const double& operator[](int p_axis) const { + return coord[p_axis]; + } + + inline double& operator[](int p_axis) { + return coord[p_axis]; + } + + void set_axis(int p_axis, double p_value); + double get_axis(int p_axis) const; + + int min_axis() const; + int max_axis() const; + + inline double length() const; + inline double length_squared() const; + + inline void normalize(); + inline Vector3 normalized() const; + inline bool is_normalized() const; + inline Vector3 inverse() const; + + inline void zero(); + + // void snap(Vector3 p_val); + // Vector3 snapped(Vector3 p_val) const; + + void rotate(const Vector3& p_axis, double p_phi); + Vector3 rotated(const Vector3& p_axis, double p_phi) const; + + /* Static Methods between 2 vector3s */ + + inline Vector3 lerp(const Vector3& p_b, double p_t) const; + inline Vector3 slerp(const Vector3& p_b, double p_t) const; + Vector3 cubic_interpolate(const Vector3& p_b, const Vector3& p_pre_a, const Vector3& p_post_b, double p_t) const; + Vector3 cubic_interpolaten(const Vector3& p_b, const Vector3& p_pre_a, const Vector3& p_post_b, double p_t) const; + Vector3 move_toward(const Vector3& p_to, const double p_delta) const; + + inline Vector3 cross(const Vector3& p_b) const; + inline double dot(const Vector3& p_b) const; + Basis outer(const Vector3& p_b) const; + Basis to_diagonal_matrix() const; + + inline Vector3 abs() const; + inline Vector3 floor() const; + inline Vector3 sign() const; + inline Vector3 ceil() const; + inline Vector3 round() const; + + inline double distance_to(const Vector3& p_b) const; + inline double distance_squared_to(const Vector3& p_b) const; + + inline Vector3 posmod(const double p_mod) const; + inline Vector3 posmodv(const Vector3& p_modv) const; + inline Vector3 project(const Vector3& p_b) const; + + inline double angle_to(const Vector3& p_b) const; + inline Vector3 direction_to(const Vector3& p_b) const; + + inline Vector3 slide(const Vector3& p_normal) const; + inline Vector3 bounce(const Vector3& p_normal) const; + inline Vector3 reflect(const Vector3& p_normal) const; + + bool is_equal_approx(const Vector3& p_v) const; + + Vector3 orthogonal(Vector3 v) const + { + float x = std::abs(v.x); + float y = std::abs(v.y); + float z = std::abs(v.z); + + Vector3 other = x < y ? (x < z ? Vector3(1,0,0) : Vector3(0, 0, 1)) : (y < z ? Vector3(0, 1, 0) : Vector3(0, 0, 1)); + return v.cross(other); + } + + /* Operators */ + + inline Vector3& operator+=(const Vector3& p_v); + inline Vector3 operator+(const Vector3& p_v) const; + inline Vector3& operator-=(const Vector3& p_v); + inline Vector3 operator-(const Vector3& p_v) const; + inline Vector3& operator*=(const Vector3& p_v); + inline Vector3 operator*(const Vector3& p_v) const; + inline Vector3& operator/=(const Vector3& p_v); + inline Vector3 operator/(const Vector3& p_v) const; + + inline Vector3& operator*=(double p_scalar); + inline Vector3 operator*(double p_scalar) const; + inline Vector3& operator/=(double p_scalar); + inline Vector3 operator/(double p_scalar) const; + + inline Vector3 operator-() const; + + inline bool operator==(const Vector3& p_v) const; + inline bool operator!=(const Vector3& p_v) const; + inline bool operator<(const Vector3& p_v) const; + inline bool operator<=(const Vector3& p_v) const; + inline bool operator>(const Vector3& p_v) const; + inline bool operator>=(const Vector3& p_v) const; + + inline Vector3() {} + inline Vector3(double p_x, double p_y, double p_z) { + x = p_x; + y = p_y; + z = p_z; + } +}; + +Vector3 Vector3::cross(const Vector3& p_b) const { + Vector3 ret( + (y * p_b.z) - (z * p_b.y), + (z * p_b.x) - (x * p_b.z), + (x * p_b.y) - (y * p_b.x)); + + return ret; +} + +double Vector3::dot(const Vector3& p_b) const { + return x * p_b.x + y * p_b.y + z * p_b.z; +} + +Vector3 Vector3::abs() const { + return Vector3(std::abs(x), std::abs(y), std::abs(z)); +} + +Vector3 Vector3::sign() const { + return Vector3(Math::sign(x), Math::sign(y), Math::sign(z)); +} + +Vector3 Vector3::floor() const { + return Vector3(std::floor(x), std::floor(y), std::floor(z)); +} + +Vector3 Vector3::ceil() const { + return Vector3(std::ceil(x), std::ceil(y), std::ceil(z)); +} + +Vector3 Vector3::round() const { + return Vector3(std::round(x), std::round(y), std::round(z)); +} + +Vector3 Vector3::lerp(const Vector3& p_b, double p_t) const { + return Vector3( + x + (p_t * (p_b.x - x)), + y + (p_t * (p_b.y - y)), + z + (p_t * (p_b.z - z))); +} + +Vector3 Vector3::slerp(const Vector3& p_b, double p_t) const { + double theta = angle_to(p_b); + return rotated(cross(p_b).normalized(), theta * p_t); +} + +double Vector3::distance_to(const Vector3& p_b) const { + return (p_b - *this).length(); +} + +double Vector3::distance_squared_to(const Vector3& p_b) const { + return (p_b - *this).length_squared(); +} + +Vector3 Vector3::posmod(const double p_mod) const { + return Vector3(Math::fposmod(x, p_mod), Math::fposmod(y, p_mod), Math::fposmod(z, p_mod)); +} + +Vector3 Vector3::posmodv(const Vector3& p_modv) const { + return Vector3(Math::fposmod(x, p_modv.x), Math::fposmod(y, p_modv.y), Math::fposmod(z, p_modv.z)); +} + +Vector3 Vector3::project(const Vector3& p_b) const { + return p_b * (dot(p_b) / p_b.length_squared()); +} + +double Vector3::angle_to(const Vector3& p_b) const { + return std::atan2(cross(p_b).length(), dot(p_b)); +} + +Vector3 Vector3::direction_to(const Vector3& p_b) const { + Vector3 ret(p_b.x - x, p_b.y - y, p_b.z - z); + ret.normalize(); + return ret; +} + +/* Operators */ + +Vector3& Vector3::operator+=(const Vector3& p_v) { + x += p_v.x; + y += p_v.y; + z += p_v.z; + return *this; +} + +Vector3 Vector3::operator+(const Vector3& p_v) const { + return Vector3(x + p_v.x, y + p_v.y, z + p_v.z); +} + +Vector3& Vector3::operator-=(const Vector3& p_v) { + x -= p_v.x; + y -= p_v.y; + z -= p_v.z; + return *this; +} + +Vector3 Vector3::operator-(const Vector3& p_v) const { + return Vector3(x - p_v.x, y - p_v.y, z - p_v.z); +} + +Vector3& Vector3::operator*=(const Vector3& p_v) { + x *= p_v.x; + y *= p_v.y; + z *= p_v.z; + return *this; +} + +Vector3 Vector3::operator*(const Vector3& p_v) const { + return Vector3(x * p_v.x, y * p_v.y, z * p_v.z); +} + +Vector3& Vector3::operator/=(const Vector3& p_v) { + x /= p_v.x; + y /= p_v.y; + z /= p_v.z; + return *this; +} + +Vector3 Vector3::operator/(const Vector3& p_v) const { + return Vector3(x / p_v.x, y / p_v.y, z / p_v.z); +} + +Vector3& Vector3::operator*=(double p_scalar) { + x *= p_scalar; + y *= p_scalar; + z *= p_scalar; + return *this; +} + +inline Vector3 operator*(double p_scalar, const Vector3& p_vec) { + return p_vec * p_scalar; +} + +Vector3 Vector3::operator*(double p_scalar) const { + return Vector3(x * p_scalar, y * p_scalar, z * p_scalar); +} + +Vector3& Vector3::operator/=(double p_scalar) { + x /= p_scalar; + y /= p_scalar; + z /= p_scalar; + return *this; +} + +Vector3 Vector3::operator/(double p_scalar) const { + return Vector3(x / p_scalar, y / p_scalar, z / p_scalar); +} + +Vector3 Vector3::operator-() const { + return Vector3(-x, -y, -z); +} + +bool Vector3::operator==(const Vector3& p_v) const { + return x == p_v.x && y == p_v.y && z == p_v.z; +} + +bool Vector3::operator!=(const Vector3& p_v) const { + return x != p_v.x || y != p_v.y || z != p_v.z; +} + +bool Vector3::operator<(const Vector3& p_v) const { + if (x == p_v.x) { + if (y == p_v.y) { + return z < p_v.z; + } + else { + return y < p_v.y; + } + } + else { + return x < p_v.x; + } +} + +bool Vector3::operator>(const Vector3& p_v) const { + if (x == p_v.x) { + if (y == p_v.y) { + return z > p_v.z; + } + else { + return y > p_v.y; + } + } + else { + return x > p_v.x; + } +} + +bool Vector3::operator<=(const Vector3& p_v) const { + if (x == p_v.x) { + if (y == p_v.y) { + return z <= p_v.z; + } + else { + return y < p_v.y; + } + } + else { + return x < p_v.x; + } +} + +bool Vector3::operator>=(const Vector3& p_v) const { + if (x == p_v.x) { + if (y == p_v.y) { + return z >= p_v.z; + } + else { + return y > p_v.y; + } + } + else { + return x > p_v.x; + } +} + +inline Vector3 vec3_cross(const Vector3& p_a, const Vector3& p_b) { + return p_a.cross(p_b); +} + +inline double vec3_dot(const Vector3& p_a, const Vector3& p_b) { + return p_a.dot(p_b); +} + +double Vector3::length() const { + double x2 = x * x; + double y2 = y * y; + double z2 = z * z; + + return std::sqrt(x2 + y2 + z2); +} + +double Vector3::length_squared() const { + double x2 = x * x; + double y2 = y * y; + double z2 = z * z; + + return x2 + y2 + z2; +} + +void Vector3::normalize() { + double lengthsq = length_squared(); + if (lengthsq == 0) { + x = y = z = 0; + } + else { + double length = std::sqrt(lengthsq); + x /= length; + y /= length; + z /= length; + } +} + +Vector3 Vector3::normalized() const { + Vector3 v = *this; + v.normalize(); + return v; +} + +bool Vector3::is_normalized() const { + // use length_squared() instead of length() to avoid sqrt(), makes it more stringent. + return Math::is_equal_approx(length_squared(), 1.0, UNIT_EPSILON); +} + +Vector3 Vector3::inverse() const { + return Vector3(1.0 / x, 1.0 / y, 1.0 / z); +} + +void Vector3::zero() { + x = y = z = 0; +} + +// slide returns the component of the vector along the given plane, specified by its normal vector. +Vector3 Vector3::slide(const Vector3& p_normal) const { +#ifdef MATH_CHECKS + ERR_FAIL_COND_V_MSG(!p_normal.is_normalized(), Vector3(), "The normal Vector3 must be normalized."); +#endif + return *this - p_normal * this->dot(p_normal); +} + +Vector3 Vector3::bounce(const Vector3& p_normal) const { + return -reflect(p_normal); +} + +Vector3 Vector3::reflect(const Vector3& p_normal) const { +#ifdef MATH_CHECKS + ERR_FAIL_COND_V_MSG(!p_normal.is_normalized(), Vector3(), "The normal Vector3 must be normalized."); +#endif + return 2.0 * p_normal * this->dot(p_normal) - *this; +} \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md new file mode 100644 index 0000000..8f05d2f --- /dev/null +++ b/README.md @@ -0,0 +1,90 @@ +[![Augmented Hip](https://github.com/hyblocker/pixelcord/blob/master/github/banner.png?raw=true)]((https://github.com/hyblocker/pixelcord/blob/master/github/banner.png?raw=true) + +> Augmented Hip, a new hip tracker, which estimates your hip's position and orientation from your feet and head. + +### Demonstration (Vive Trackers) +[![Watch the video](https://raytracing-benchmarks.are-really.cool/8HCBotk.png)](https://raytracing-benchmarks.are-really.cool/2kKtVWe.mp4) + +### Demonstration (Kinect) +[![Watch the video](https://raytracing-benchmarks.are-really.cool/3MV8wyj.png)](https://raytracing-benchmarks.are-really.cool/7py8Dny.mp4) + +# Install + +### Method 1 + +- Download the zip file from Releases +- Extract it to any folder +- Press the **Windows Key** + **R** to open the Run dialog, and paste in `%localappdata%/openvr` then press **Enter** to open the folder in a file explorer. +- Open the file `openvrpaths.vrpath` with notepad. +- Add the **FULL FILE PATH** to the `"external_drivers"` block, as show below: +- > ⚠ Make sure that the file **ONLY CONTAINS DOUBLE BACKSLASHES** `\\` + > + > You can also use **forward slashes** `/` +```json +{ + "config" : + [ + "C:\\Program Files (x86)\\Steam\\config" + ], + "external_drivers" : + [ + "C:\\VR\\OWOTRACK\\driver", + "C:\\K2EX\\KinectToVR", + "C:\\VR\\AugmentedHip\\driver" + ], + "jsonid" : "vrpathreg", + "log" : + [ + "C:\\Program Files (x86)\\Steam\\logs" + ], + "runtime" : + [ + "C:\\Program Files (x86)\\Steam\\steamapps\\common\\SteamVR" + ], + "version" : 1 +} +``` + +### Method 2 + +You can also install it into the direct drivers folder. + +Access the SteamVR folder + +![opening steamvr local files](https://raytracing-benchmarks.are-really.cool/Af6eSnS.png) + +Go to the `drivers` folder and create a new folder with whatever name you want. Maybe `augmented-hip` + +Copy the files and folders: +``` +bin +resources +driver.vrdrivermanifest +``` +into that newly created folder. + +> *An installer will be coming soon* + +# Troubleshooting + +## My hip flips when I slightly turn around! + +Ensure that the tracker on your left foot is using the "Left Foot" tracker role, and, also, that the tracker on your right foot is using using the "Right Foot" tracker role. + +If you can find the menu to do so by opening SteamVR settings and going to the **Manage Vive Trackers** section under the **Controllers** tab. + +You can figure out which tracker is which by clicking the "Identify" button. + +![Opening the tracker roles page](https://raytracing-benchmarks.are-really.cool/3Vk9xt4.png) + +## AugmentedHip doesn't appear in my SteamVR add-ons list + +Make sure that your `openvrpaths.vrpath` file doesn't contain malformed JSON. If you still have issues join the [KinectToVR Discord server](https://discord.gg/YBQCRDG) for support in the `#aughip-help` channel. + +## I have another problem! + +Join the [KinectToVR Discord server](https://discord.gg/YBQCRDG) for support in the `#aughip-help` channel. + +## License + +This SteamVR Add-on is licensed under GPL-3 \ No newline at end of file diff --git a/assets/driver.vrdrivermanifest b/assets/driver.vrdrivermanifest new file mode 100644 index 0000000..9bb17fc --- /dev/null +++ b/assets/driver.vrdrivermanifest @@ -0,0 +1,10 @@ +{ + "alwaysActivate": true, + "name" : "AugmentedHip", + "directory" : "", + "resourceOnly" : false, + "hmd_presence" : + [ + "*.*" + ] +} \ No newline at end of file diff --git a/assets/resources/driver.vrresources b/assets/resources/driver.vrresources new file mode 100644 index 0000000..16e1d83 --- /dev/null +++ b/assets/resources/driver.vrresources @@ -0,0 +1,6 @@ +{ + "jsonid" : "vrresources", + "statusicons" : { + + } +} diff --git a/assets/resources/input/remote_profile.json b/assets/resources/input/remote_profile.json new file mode 100644 index 0000000..a16d9da --- /dev/null +++ b/assets/resources/input/remote_profile.json @@ -0,0 +1,20 @@ +{ + "jsonid": "input_profile", + "controller_type": "vive_tracker_waist", + "input_bindingui_mode": "single_device", + "input_bindingui_right": { + "image": "{htc}/icons/vive_tracker.svg" + }, + "input_source": { + "/pose/raw" : { + "type" : "pose", + "binding_image_point" : [ 100, 90 ], + "order": 1 + }, + "/output/haptic": { + "type": "vibration", + "binding_image_point": [ 100, 90 ], + "order": 2 + } + } +} diff --git a/github/banner.png b/github/banner.png new file mode 100644 index 0000000000000000000000000000000000000000..a3dcbd1faa88bb577244cb2f2a43c3b551b1e0bb GIT binary patch literal 52179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$Q?sdZiK^uJoBN6@(7fXDrvk&yw_7EW3}c0-1)a1_yl zM-PAxMxtM0PywDF;Qj&Jv@|6}QIM-cd-^FYjgy;%h)5Kz>M|x}_M`DOm>Eq&(+V{* z-)8bcL!9q+!C-^+?NhuprN7pl*qRxSj>p?>?zSltfX?xMf9?Jaz8KM@zMb9rLSZYe ze5u~nt4Hc>-DQ<%$DO>0r5f)S3kBB@@b!XUJg6rjiaq>j_iK~^@!yp|yTQe!X6RZ2 zvlY}m zTVutNE&fYh9_q)2uU}PtdKCcQgB=14?$zp`S$Fv`nbCVZH9ZY$O>j;#p_m7+Vo>-8 zo$Y3ltFggq5~js9-y|%9;q9C zQPF2UWA{J}Ni+k2vyUD<$^)yf(3woW`@Cw0|C&71+K6L|A?{(n_6sb9faZdSi5ZjW z3Pvg5#0ms~s>(`=nUA5pt9qWlupV4IU!gUY+(>dZ^hrmQZh0+b|9x!S1{)$UP)PR!FXZ8BjN%Qv*N|x#D)fau)c)o3X zal{iy8~-DiuXKEC6p#iT9oU}3Qj^ayVdkJYRm(I@Iwm2gsaH)8X zgD!>-G96yxw_y0P+WO4wXyY|8s_&hiCckB6ItBR^B$12S^d*3js~I*|z*qS5_tl6y znWKwKD?I5ir~pI*z@eI&nx7!_ z0llOb_M#*MLpCI&wzkrREAPM+g+AM)1@0n97&1abNiC{XLj2Wy3(zUA*{S@9HvF}u znoEc0wWYq2Pd!2nI=cNp47H1}H9x$kh#!6Jz5?*dz#l`Y5<~nP`v7kD|No8ur|Usn^z;@ZZ9FBi T#`g9a34W+3Xvlw)H4pqh4-r)` literal 0 HcmV?d00001 diff --git a/github/icon.png b/github/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..76fd1bc9d729759bfec206b68e7514c304ab7de7 GIT binary patch literal 38045 zcmYJb2Ut_t_C9<92%;i7i~@szGg4Hf1?g28MWl%+y(vT#2q3*Dj-!qmL5YBL6o)Dx zHT1*=6Of|x8kIokC6o{dIp02bf8YN;&wXYt=j^lhTKiq?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sx9CVQXr3WcvU2ULb_I8Zoz-pwT++)aE3-B8Ar zbjT-&qKj;an0<|dESJCOPH8;8(J?9@{ff}M-P3Gz^!a1rnPYsRWkNswx5Lk3$ts(+ z=jbQh9QM)sM*FuP!pvG_nMTeZIIp_TM-x?Mocw0f;-SC1TY&Wm7&VO&b!N*0A089^ zJqL2b9k-PoL7mbn{*U!wkd1ZXr^@wH*v)T$YmgTBXCIeIMVLS-*zw`;S`exmnC1NK zKI6o9Z0v5~Z%1yw+Q$>RMDQ67H?B z2etU?cEj^|V`|dW3;QW?Qpn7?_9!u_yJo; z>9NuCbm@rQnC|+He^^ME{b52Z&oPNd8-W5vzbNBamJ800{KX>bH-h#WWsdP_9m39} zIQ>GQVdu}8bNFad4*mum7x?jaYC~-dzj?o$z$xs3RySL%+|DUJvH_u!t=534a2FJo zFKE%dl32Sv+~xet!yheb*6_n?-E0?%6$kEz$7oPDi2VHUGwCH)3bpoJI4eKx3!u1< zroqK(LZ`MBKH)w<)*$_?b>|O0TXqxjv_GyKSf>Tj{m=F9cXIwGRAlvh2n&f@a**w= zBa5}wKy&S2xZ^JQYw*jFFu`yKel?exp2{HYFD;u2>dcmVGAGw|o}_dVh8l?Xj;(7f z$38VXh9+HYIn7(AmM8o$ztNNh&pCP*SL~}(*d0?(v!)Q(N9G@p`Z%(M`_x3h7Cidn xYVTZ6p6yJ&Ht?j$bL16?FXT6&%XJLq*(+a`zE`&SLW3~Pb2?|U|FHb)e*o<45>5aB literal 0 HcmV?d00001 diff --git a/openvr b/openvr new file mode 160000 index 0000000..4c85abc --- /dev/null +++ b/openvr @@ -0,0 +1 @@ +Subproject commit 4c85abcb7f7f1f02adaf3812018c99fc593bc341