Initial Commit

This commit is contained in:
2026-05-06 07:01:51 +02:00
commit aced61ec47
31 changed files with 2806 additions and 0 deletions

7
.gitignore vendored Normal file
View File

@@ -0,0 +1,7 @@
Unreal/PS_ViveVBS/.vsconfig
Unreal/PS_ViveVBS/.vs/
Unreal/PS_ViveVBS/Binaries/
Unreal/PS_ViveVBS/Intermediate/
Unreal/PS_ViveVBS/Plugins/PS_ViveVBS/Binaries/
Unreal/PS_ViveVBS/Plugins/PS_ViveVBS/Intermediate/
Unreal/PS_ViveVBS/Saved/

View File

@@ -0,0 +1,92 @@
[/Script/EngineSettings.GameMapsSettings]
GameDefaultMap=/Engine/Maps/Templates/OpenWorld
[/Script/Engine.RendererSettings]
r.AllowStaticLighting=False
r.GenerateMeshDistanceFields=True
r.DynamicGlobalIlluminationMethod=1
r.ReflectionMethod=1
r.SkinCache.CompileShaders=True
r.RayTracing=True
r.Shadow.Virtual.Enable=1
r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange=True
r.DefaultFeature.LocalExposure.HighlightContrastScale=0.8
r.DefaultFeature.LocalExposure.ShadowContrastScale=0.8
[/Script/WindowsTargetPlatform.WindowsTargetSettings]
DefaultGraphicsRHI=DefaultGraphicsRHI_DX12
DefaultGraphicsRHI=DefaultGraphicsRHI_DX12
-D3D12TargetedShaderFormats=PCD3D_SM5
+D3D12TargetedShaderFormats=PCD3D_SM6
-D3D11TargetedShaderFormats=PCD3D_SM5
+D3D11TargetedShaderFormats=PCD3D_SM5
Compiler=Default
AudioSampleRate=48000
AudioCallbackBufferFrameSize=1024
AudioNumBuffersToEnqueue=1
AudioMaxChannels=0
AudioNumSourceWorkers=4
SpatializationPlugin=
SourceDataOverridePlugin=
ReverbPlugin=
OcclusionPlugin=
CompressionOverrides=(bOverrideCompressionTimes=False,DurationThreshold=5.000000,MaxNumRandomBranches=0,SoundCueQualityIndex=0)
CacheSizeKB=65536
MaxChunkSizeOverrideKB=0
bResampleForDevice=False
MaxSampleRate=48000.000000
HighSampleRate=32000.000000
MedSampleRate=24000.000000
LowSampleRate=12000.000000
MinSampleRate=8000.000000
CompressionQualityModifier=1.000000
AutoStreamingThreshold=0.000000
SoundCueCookQualityIndex=-1
[/Script/LinuxTargetPlatform.LinuxTargetSettings]
-TargetedRHIs=SF_VULKAN_SM5
+TargetedRHIs=SF_VULKAN_SM6
[/Script/HardwareTargeting.HardwareTargetingSettings]
TargetedHardwareClass=Desktop
AppliedTargetedHardwareClass=Desktop
DefaultGraphicsPerformance=Maximum
AppliedDefaultGraphicsPerformance=Maximum
[/Script/WorldPartitionEditor.WorldPartitionEditorSettings]
CommandletClass=Class'/Script/UnrealEd.WorldPartitionConvertCommandlet'
[/Script/Engine.UserInterfaceSettings]
bAuthorizeAutomaticWidgetVariableCreation=False
FontDPIPreset=Standard
FontDPI=72
[/Script/Engine.Engine]
+ActiveGameNameRedirects=(OldGameName="TP_Blank",NewGameName="/Script/PS_ViveVBS")
+ActiveGameNameRedirects=(OldGameName="/Script/TP_Blank",NewGameName="/Script/PS_ViveVBS")
[/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings]
bEnablePlugin=True
bAllowNetworkConnection=True
SecurityToken=57BB0A574FFB6D1B1C2B8CBB575DB429
bIncludeInShipping=False
bAllowExternalStartInShipping=False
bCompileAFSProject=False
bUseCompression=False
bLogFiles=False
bReportStats=False
ConnectionType=USBOnly
bUseManualIPAddress=False
ManualIPAddress=

View File

@@ -0,0 +1,10 @@
[/Script/EngineSettings.GeneralProjectSettings]
ProjectID=4947B4B34ED5B66358981593ECB294D6
[StartupActions]
bAddPacks=True
InsertPack=(PackSource="StarterContent.upack",PackName="StarterContent")
[SectionsToSave]
+Section=StartupActions

View File

@@ -0,0 +1,84 @@
[/Script/Engine.InputSettings]
-AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
-AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
-AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
-AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
-AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f))
-AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f))
-AxisConfig=(AxisKeyName="Mouse2D",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f))
+AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Mouse2D",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MouseWheelAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Gamepad_LeftTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Gamepad_RightTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Gamepad_Special_Left_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Gamepad_Special_Left_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Vive_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Vive_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Vive_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Vive_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Vive_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="Vive_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MixedReality_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MixedReality_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MixedReality_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MixedReality_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MixedReality_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MixedReality_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MixedReality_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MixedReality_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MixedReality_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="MixedReality_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="OculusTouch_Left_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="OculusTouch_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="OculusTouch_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="OculusTouch_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="OculusTouch_Right_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="OculusTouch_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="OculusTouch_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="OculusTouch_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Left_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Left_Grip_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Right_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Right_Grip_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
bAltEnterTogglesFullscreen=True
bF11TogglesFullscreen=True
bUseMouseForTouch=False
bEnableMouseSmoothing=True
bEnableFOVScaling=True
bCaptureMouseOnLaunch=True
bEnableLegacyInputScales=True
bEnableMotionControls=True
bFilterInputByPlatformUser=False
bShouldFlushPressedKeysOnViewportFocusLost=True
bAlwaysShowTouchInterface=False
bShowConsoleOnFourFingerTap=True
bEnableGestureRecognizer=False
bUseAutocorrect=False
DefaultViewportMouseCaptureMode=CapturePermanently_IncludingInitialMouseDown
DefaultViewportMouseLockMode=LockOnCapture
FOVScale=0.011110
DoubleClickTime=0.200000
DefaultPlayerInputClass=/Script/EnhancedInput.EnhancedPlayerInput
DefaultInputComponentClass=/Script/EnhancedInput.EnhancedInputComponent
DefaultTouchInterface=/Engine/MobileResources/HUD/DefaultVirtualJoysticks.DefaultVirtualJoysticks
-ConsoleKeys=Tilde
+ConsoleKeys=Tilde

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,22 @@
{
"FileVersion": 3,
"EngineAssociation": "5.5",
"Category": "",
"Description": "",
"Modules": [
{
"Name": "PS_ViveVBS",
"Type": "Runtime",
"LoadingPhase": "Default"
}
],
"Plugins": [
{
"Name": "ModelingToolsEditorMode",
"Enabled": true,
"TargetAllowList": [
"Editor"
]
}
]
}

View File

@@ -0,0 +1,8 @@
[FilterPlugin]
; This section lists additional files which will be packaged along with your plugin. Paths should be listed relative to the root plugin directory, and
; may include "...", "*", and "?" wildcards to match directories, files, and individual characters respectively.
;
; Examples:
; /README.txt
; /Extras/...
; /Binaries/ThirdParty/*.dll

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,67 @@
// Copyright Asterion VR. All right reserved
#include "../Public/Global.h"
DEFINE_LOG_CATEGORY(PS_ViveVBS);
#define LOCTEXT_NAMESPACE "VBS"
int UGlobal::markerState = 0;
void OnServerStatusUpdate(wchar_t* strName, wchar_t* strValue)
{
if (wcscmp(strName, L"3011") == 0)
{
if (wcscmp(strValue, L"CTdone") == 0)
{
UGlobal::markerState = 2;
}
else if (wcscmp(strValue, L"CTpass") == 0)
{
UGlobal::markerState = 1;
}
UE_LOG(PS_ViveVBS, Display, TEXT("OnServerStatusUpdate strName:%s strValue:%s\n"), strName, strValue);
}
}
void OnSettingChange(const wchar_t* setting)
{
UE_LOG(PS_ViveVBS, Display, TEXT("OnSettingChange : strName:%s\n"), setting);
}
void OnSDKDebugLog(const wchar_t* log)
{
UE_LOG(PS_ViveVBS, Display, TEXT("OnSDKDebugLog : strName:%s\n"), log);
}
int UGlobal::VBS_GetVersion()
{
return VS_Version();
}
int UGlobal::VBS_Init()
{
int retCode = VS_Init();
UGlobal::markerState = 0;
if (retCode == 0)
{
UE_LOG(PS_ViveVBS, Display, TEXT("VBS_Init : SUCCESS \n"));
VS_SetCallbackFunction(OnServerStatusUpdate, OnSettingChange, OnSDKDebugLog);
}
else
{
UE_LOG(PS_ViveVBS, Display, TEXT("VBS_Init : *FAILED with error code %d \n"), retCode);
}
return retCode;
}
int UGlobal::VBS_Release()
{
return VS_Release();
}
#undef LOCTEXT_NAMESPACE

View File

@@ -0,0 +1,41 @@
// Copyright Asterion VR. All right reserved
#include "../Public/GunMode.h"
//DEFINE_LOG_CATEGORY(PS_ViveVBS);
#define LOCTEXT_NAMESPACE "VBS"
bool UGunMode::VBS_SetGunMode(const bool active)
{
bool success = false;
if (active)
{
success = VS_EnableAntiRecoilMode();
if (success)
{
UE_LOG(PS_ViveVBS, Display, TEXT("Enable AntiRecoilMode : SUCCESS \n"));
}
else
{
UE_LOG(PS_ViveVBS, Display, TEXT("Enable AntiRecoilMode : FAILED \n"));
}
}
else
{
success = VS_DisableAntiRecoilMode();
if (success)
{
UE_LOG(PS_ViveVBS, Display, TEXT("Disable AntiRecoilMode : SUCCESS \n"));
}
else
{
UE_LOG(PS_ViveVBS, Display, TEXT("Disable AntiRecoilMode : FAILED \n"));
}
}
return success;
}
#undef LOCTEXT_NAMESPACE

View File

@@ -0,0 +1,203 @@
// Copyright Asterion VR. All right reserved
#include "../Public/MBLS.h"
#include "../Public/Global.h"
//DEFINE_LOG_CATEGORY(PS_ViveVBS);
#define LOCTEXT_NAMESPACE "VBS"
bool UMBLS::DefineSingleArcuoMarker(const int32 IDMarker1, const float sizeMarker1, const float height)
{
UE_LOG(PS_ViveVBS, Display, TEXT("DefineArcuoMarker ID : %d - Size : %f"), IDMarker1, sizeMarker1);
const FString parameters = FString::Printf(TEXT("PLAYER00InitMA{\"marker1\":{\"id\":%d,\"behavior\":3,\"size\":%f,\"pose\":[0,0,0,1,0,%f,0]}}"), IDMarker1, sizeMarker1, height);
if (VS_WVRGetParameters(DEVICE_TYPE_HMD, *parameters))
{
UE_LOG(PS_ViveVBS, Display, TEXT("Define Single ArcuoMarker : SUCCESS"));
return true;
}
else
{
UE_LOG(PS_ViveVBS, Display, TEXT("Define Single ArcuoMarker : FAILED"));
return false;
}
}
bool UMBLS::DefineTwoArcuoMarker(const int32 IDMarker1, const int32 IDMarker2, const float sizeMarker, const float height)
{
UE_LOG(PS_ViveVBS, Display, TEXT("DefineTwoArcuoMarker ID : %d - ID2 : %d - Size : %f"), IDMarker1, IDMarker2, sizeMarker);
FString parameters = FString::Printf(TEXT("PLAYER00InitMA{\"marker1\":{\"id\":%d,\"behavior\":3,\"size\":%f,\"isMainMarker\":true,\"pairMarkerID\":%d,\"pose\":[0,0,0,1,0,%f,0]},\"marker2\":{\"id\":%d,\"behavior\":3,\"size\":%f,\"isMainMarker\":false,\"pairMarkerID\":%d,\"pose\":[0,0,0,1,0,%f,0]}}"), IDMarker1, sizeMarker, IDMarker2, height, IDMarker2, sizeMarker, IDMarker1, height);
if (VS_WVRGetParameters(DEVICE_TYPE_HMD, *parameters))
{
UE_LOG(PS_ViveVBS, Display, TEXT("Define Two ArcuoMarker : SUCCESS"));
return true;
}
else
{
UE_LOG(PS_ViveVBS, Display, TEXT("Define Two ArcuoMarker : FAILED"));
return false;
}
}
/*
bool UMBLS::DefineArcuoMarkerforRtTracking(const int32 IDMarker1, const float sizeMarker1)
{
UE_LOG(PS_ViveVBS, Display, TEXT("DefineArcuoMarkerForRTTracking ID : %d - Size : %f"), IDMarker1, sizeMarker1);
FString returnCode;
FString parameters = FString::Printf(TEXT("PLAYER00InitMA{\"marker1\":{\"id\":%d,\"behavior\":4,\"size\":%f}}"), IDMarker1, sizeMarker1);
GetParameters(0, parameters, returnCode);
if (returnCode == "InitMAErr")
{
UE_LOG(PS_ViveVBS, Display, TEXT("Define ArcuoMarker ERROR"));
}
else {
UE_LOG(PS_ViveVBS, Display, TEXT("Define ArcuoMarker OK"));
}
}
*/
bool UMBLS::RecenterXForm()
{
UE_LOG(LogInit, Display, TEXT("RecenterXForm"));
bool success = true;
success = success && VS_WVRSetParameters(DEVICE_TYPE_HMD, L"ClearRecenterXform");
success = success && VS_WVRSetParameters(DEVICE_TYPE_CONTROLLER_RIGHT, L"ClearRecenterXform");
success = success && VS_WVRSetParameters(DEVICE_TYPE_CONTROLLER_LEFT, L"ClearRecenterXform");
return success;
}
bool UMBLS::RecenterXFormTR()
{
UE_LOG(LogInit, Display, TEXT("RecenterXFormTR"));
bool success = true;
success = success && VS_WVRSetParameters(DEVICE_TYPE_HMD, L"ClearRecenterXformTR");
success = success && VS_WVRSetParameters(DEVICE_TYPE_CONTROLLER_RIGHT, L"ClearRecenterXformTR");
success = success && VS_WVRSetParameters(DEVICE_TYPE_CONTROLLER_LEFT, L"ClearRecenterXformTR");
return success;
}
bool UMBLS::StartMarkerScanning()
{
UE_LOG(LogInit, Display, TEXT("StartMarkerScanning"));
UGlobal::markerState = 0;
if (VS_WVRGetParameters(DEVICE_TYPE_HMD, L"PLAYER00StartScan"))
{
UE_LOG(PS_ViveVBS, Display, TEXT("StartMarkerScanning : SUCCESS"));
return true;
}
else
{
UE_LOG(PS_ViveVBS, Display, TEXT("StartMarkerScanning : FAILED"));
return false;
}
}
bool UMBLS::StopMarkerScanning()
{
UE_LOG(LogInit, Display, TEXT("StopMarkerScanning"));
if (VS_WVRGetParameters(DEVICE_TYPE_HMD, L"PLAYER00StopScan"))
{
UE_LOG(PS_ViveVBS, Display, TEXT("StopMarkerScanning : SUCCESS"));
return true;
}
else
{
UE_LOG(PS_ViveVBS, Display, TEXT("StopMarkerScanning : FAILED"));
return false;
}
}
int32 UMBLS::CheckScanStatus()
{
UE_LOG(LogInit, Display, TEXT("CheckMarkerScanning"));
if (VS_WVRGetParameters(DEVICE_TYPE_HMD, L"PLAYER00CheckMA"))
{
UE_LOG(PS_ViveVBS, Display, TEXT("CheckMarkerScanning : SUCCESS - Value is %d"), UGlobal::markerState);
return UGlobal::markerState;
}
else
{
UE_LOG(PS_ViveVBS, Display, TEXT("CheckMarkerScanning : FAILED"));
return 0;
}
}
void UMBLS::ResetMarkerState()
{
UGlobal::markerState = 0;
UE_LOG(PS_ViveVBS, Display, TEXT("ResetMarkerState"));
}
int32 UMBLS::RetrievePreviousScan()
{
CheckScanStatus();
VS_WVRSetParameters(DEVICE_TYPE_HMD, L"ClearRecenterXform");
VS_WVRSetParameters(DEVICE_TYPE_CONTROLLER_RIGHT, L"ClearRecenterXform");
VS_WVRSetParameters(DEVICE_TYPE_CONTROLLER_LEFT, L"ClearRecenterXform");
return UGlobal::markerState;
}
/*
int32 UMBLS::GetRTArcuoMarkerPose(const int32 IDMarker, FVector& location, FRotator& orientation)
{
FString returnCode;
FQuat quaternion;
FString parameters = FString::Printf(TEXT("PLAYER00GetArucoPoseByID=%d"), IDMarker);
GetParameters(0, parameters, returnCode);
UE_LOG(PS_ViveVBS, Display, TEXT("CheckMarkerScanning %s"), *returnCode);
FString leftS;
FString rightS;
if (returnCode.Mid(0, 1) == FString("f"))
{
UE_LOG(PS_ViveVBS, Display, TEXT("Tracker Not Found"), *returnCode);
return 0;
}
else
{
returnCode.Split(",", &leftS, &rightS);
location.X = FCString::Atof(*leftS);
rightS.Split(",", &leftS, &rightS);
location.Y = FCString::Atof(*leftS);
rightS.Split(",", &leftS, &rightS);
location.Z = FCString::Atof(*leftS);
returnCode.Split(",", &leftS, &rightS);
quaternion.X = FCString::Atof(*leftS);
rightS.Split(",", &leftS, &rightS);
quaternion.Y = FCString::Atof(*leftS);
rightS.Split(",", &leftS, &rightS);
quaternion.Z = FCString::Atof(*leftS);
quaternion.Z = FCString::Atof(*rightS);
//orientation = FRotator::FRotator(quaternion);
return 1;
}
}
*/
#undef LOCTEXT_NAMESPACE

View File

@@ -0,0 +1,41 @@
// Copyright Asterion VR. All right reserved
#include "../Public/Passthrough.h"
//DEFINE_LOG_CATEGORY(PS_ViveVBS);
#define LOCTEXT_NAMESPACE "VBS"
bool UPassthrough::VBS_SetPassthrough(const bool active)
{
bool success = false;
if (active)
{
success = VS_EnablePassthrough();
if (success)
{
UE_LOG(PS_ViveVBS, Display, TEXT("Enable Passthrough : SUCCESS \n"));
}
else
{
UE_LOG(PS_ViveVBS, Display, TEXT("Enable Passthrough : FAILED \n"));
}
}
else
{
success = VS_DisablePassthrough();
if (success)
{
UE_LOG(PS_ViveVBS, Display, TEXT("Disable Passthrough : SUCCESS \n"));
}
else
{
UE_LOG(PS_ViveVBS, Display, TEXT("Disable Passthrough : FAILED \n"));
}
}
return success;
}
#undef LOCTEXT_NAMESPACE

View File

@@ -0,0 +1,21 @@
// Copyright Asterion VR. All right reserved
#include "ViveVBS.h"
#include "VS_PC_SDK.h"
#define LOCTEXT_NAMESPACE "FViveVBSModule"
void FViveVBSModule::StartupModule()
{
// This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module
}
void FViveVBSModule::ShutdownModule()
{
// This function may be called during shutdown to clean up your module. For modules that support dynamic reloading,
// we call this function before unloading the module.
}
#undef LOCTEXT_NAMESPACE
IMPLEMENT_MODULE(FViveVBSModule, ViveVBS)

View File

@@ -0,0 +1,31 @@
// Copyright Asterion VR. All right reserved
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "../VBS_SDK/VS_PC_SDK.h"
#include "Global.generated.h"
DECLARE_LOG_CATEGORY_EXTERN(PS_ViveVBS, Log, All);
/**
*
*/
UCLASS()
class VIVEVBS_API UGlobal : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
UFUNCTION(BlueprintCallable, Category = "ASTERION|VBS")
static int VBS_GetVersion();
UFUNCTION(BlueprintCallable, Category = "ASTERION|VBS")
static int VBS_Init();
UFUNCTION(BlueprintCallable, Category = "ASTERION|VBS")
static int VBS_Release();
public:
static int markerState;
};

View File

@@ -0,0 +1,27 @@
// Copyright Asterion VR. All right reserved
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "../VBS_SDK/VS_PC_SDK.h"
#include "Global.h"
#include "GunMode.generated.h"
//DECLARE_LOG_CATEGORY_EXTERN(PS_ViveVBS, Log, All);
/**
*
*/
UCLASS()
class VIVEVBS_API UGunMode : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
UFUNCTION(BlueprintCallable, Category = "ASTERION|VBS")
static bool VBS_SetGunMode(const bool active);
public:
};

View File

@@ -0,0 +1,58 @@
// Copyright Asterion VR. All right reserved
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "../VBS_SDK/VS_PC_SDK.h"
#include "Global.h"
#include "MBLS.generated.h"
//DECLARE_LOG_CATEGORY_EXTERN(PS_ViveVBS, Log, All);
/**
*
*/
UCLASS()
class VIVEVBS_API UMBLS : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
UFUNCTION(BlueprintCallable, Category = "ASTERION|VBS")
static bool DefineSingleArcuoMarker(const int32 IDMarker1, const float sizeMarker1, const float height);
UFUNCTION(BlueprintCallable, Category = "ASTERION|VBS")
static bool DefineTwoArcuoMarker(const int32 IDMarker1, const int32 IDMarker2, const float sizeMarker, const float height);
UFUNCTION(BlueprintCallable, Category = "ASTERION|VBS")
static bool RecenterXForm();
UFUNCTION(BlueprintCallable, Category = "ASTERION|VBS")
static bool RecenterXFormTR();
UFUNCTION(BlueprintCallable, Category = "ASTERION|VBS")
static void ResetMarkerState();
UFUNCTION(BlueprintCallable, Category = "ASTERION|VBS")
static bool StartMarkerScanning();
UFUNCTION(BlueprintCallable, Category = "VIVE VBS")
static bool StopMarkerScanning();
UFUNCTION(BlueprintCallable, Category = "VIVE VBS")
static int32 CheckScanStatus();
UFUNCTION(BlueprintCallable, Category = "VIVE VBS")
static int32 RetrievePreviousScan();
/*
UFUNCTION(BlueprintCallable, Category = "VIVE VBS")
static bool DefineArcuoMarkerforRtTracking(const int32 IDMarker1, const float sizeMarker1);
UFUNCTION(BlueprintCallable, Category = "VIVE VBS")
static int32 GetRTArcuoMarkerPose(const int32 IDMarker, FVector& location, FRotator& orientation);*/
public:
};

View File

@@ -0,0 +1,27 @@
// Copyright Asterion VR. All right reserved
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "../VBS_SDK/VS_PC_SDK.h"
#include "Global.h"
#include "Passthrough.generated.h"
//DECLARE_LOG_CATEGORY_EXTERN(PS_ViveVBS, Log, All);
/**
*
*/
UCLASS()
class VIVEVBS_API UPassthrough : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
UFUNCTION(BlueprintCallable, Category = "ASTERION|VBS")
static bool VBS_SetPassthrough(const bool active);
public:
};

View File

@@ -0,0 +1,15 @@
// Copyright Asterion VR. All right reserved
#pragma once
#include "CoreMinimal.h"
#include "Modules/ModuleManager.h"
class FViveVBSModule : public IModuleInterface
{
public:
/** IModuleInterface implementation */
virtual void StartupModule() override;
virtual void ShutdownModule() override;
};

View File

@@ -0,0 +1,62 @@
#pragma once
#ifndef HMD_CUSTOMIZE_COMMAND_H
#define HMD_CUSTOMIZE_COMMAND_H
#ifndef EXPORT_COMMAND_API
#define EXPORT_COMMAND_API
#endif
typedef void(*cbServerStatusUpdate)(wchar_t*, wchar_t*);
typedef void(*cbSettingChange)(const wchar_t*);
typedef void(*cbSdkDebugLog)(const wchar_t*);
//for VS_SetDeviceParameter & VS_GetDeviceParameter function to define nDeviceType argument
#define DEVICE_TYPE_HMD 0
#define DEVICE_TYPE_CONTROLLER_RIGHT 1
#define DEVICE_TYPE_CONTROLLER_LEFT 2
///////
//for status code in callback function
#define STAUTS_CODE_GRAPHIC_INFO "2001"
#define STAUTS_CODE_HMD_READY "2003"
#define STAUTS_CODE_HMD_NAME "2004"
#define STAUTS_CODE_FPS "2005"
#define STAUTS_CODE_CONNECT_TYPE "2006"
#define STAUTS_CODE_SERVER_VERSION "2007"
#define STAUTS_CODE_DEVICE_BATTERY_LEVEL "2102"
#define STAUTS_CODE_SERVER_STATE "2105"
#define STAUTS_CODE_RESULT_WVR_SET_HMD "3001"
#define STAUTS_CODE_RESULT_WVR_SET_LEFT_CONTROLLER "3002"
#define STAUTS_CODE_RESULT_WVR_SET_RIGHT_CONTROLLER "3003"
#define STAUTS_CODE_RESULT_WVR_GET_HMD "3011"
#define STAUTS_CODE_RESULT_WVR_GET_LEFT_CONTROLLER "3012"
#define STAUTS_CODE_RESULT_WVR_GET_RIGHT_CONTROLLER "3013"
///////
extern "C"
{
EXPORT_COMMAND_API int VS_Version();
EXPORT_COMMAND_API const wchar_t* VS_SDKVersion();
EXPORT_COMMAND_API int VS_Init();
EXPORT_COMMAND_API int VS_Release();
//For callback function
EXPORT_COMMAND_API void VS_SetCallbackFunction(cbServerStatusUpdate pStatusUpdateCallback, cbSettingChange pSettingChangeCallback, cbSdkDebugLog pDebugLogCallback);
//For Device Parameter
EXPORT_COMMAND_API bool VS_EnableAntiRecoilMode();
EXPORT_COMMAND_API bool VS_DisableAntiRecoilMode();
EXPORT_COMMAND_API bool VS_WVRSetParameters(int nDeviceType, const wchar_t* strParameters);
EXPORT_COMMAND_API bool VS_WVRGetParameters(int nDeviceType, const wchar_t* strParameters);
EXPORT_COMMAND_API bool VS_EnablePassthrough();
EXPORT_COMMAND_API bool VS_DisablePassthrough();
EXPORT_COMMAND_API bool VS_TriggerEyeCalibration();
}
#endif

View File

@@ -0,0 +1,103 @@
// Copyright Asterion VR. All right reserved
using System.IO;
using UnrealBuildTool;
public class ViveVBS : ModuleRules
{
public ViveVBS(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicIncludePaths.AddRange(
new string[] {
// ... add public include paths required here ...
}
);
PrivateIncludePaths.AddRange(
new string[] {
// ... add other private include paths required here ...
}
);
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
// ... add other public dependencies that you statically link with here ...
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"CoreUObject",
"Engine",
"Slate",
"SlateCore",
// ... add private dependencies that you statically link with here ...
}
);
DynamicallyLoadedModuleNames.AddRange(
new string[]
{
// ... add any modules that your module loads dynamically here ...
}
);
#if DYNAMIC_LINKAGE
PublicDefinitions.Add("VBS_DYNAMIC_LINKAGE=1");
#endif
string VBS_SDK_PATH = Path.Combine(PluginDirectory, "Source/ViveVBS/VBS_SDK/");
PublicIncludePaths.Add(VBS_SDK_PATH);
#if DYNAMIC_LINKAGE
PublicDelayLoadDLLs.Add("VS_PC_SDK.dll");
PublicDelayLoadDLLs.Add("RRServerManageAPI.dll");
RuntimeDependencies.Add("$(EngineDir)/Binaries/ThirdParty/VBS_SDK/VS_PC_SDK.dll"));
RuntimeDependencies.Add("$(EngineDir)/Binaries/ThirdParty/VBS_SDK/RRServerManageAPI.dll"));
#else
PublicAdditionalLibraries.Add(Path.Combine(VBS_SDK_PATH, "VS_PC_SDK.lib"));
if (Target.Type == TargetRules.TargetType.Editor)
{
string srcPath = Path.Combine(ModuleDirectory, "../../ThirdParty/Win64/");
string destPath = Path.Combine(ModuleDirectory, "../../../../Binaries/Win64/");
string[] dlls = { "VS_PC_SDK.dll", "RRServerManageAPI.dll", "VSWPipeVarClient64U_MT.dll" };
foreach (string dll in dlls)
{
string src = srcPath + dll;
string dest = destPath + dll;
bool needCopy = !File.Exists(dest);
if (!needCopy)
{
var srcInfo = new FileInfo(src);
var destInfo = new FileInfo(dest);
needCopy = srcInfo.LastWriteTimeUtc > destInfo.LastWriteTimeUtc
|| srcInfo.Length != destInfo.Length;
}
if (needCopy)
{
try
{
File.Copy(src, dest, true);
}
catch (IOException)
{
System.Console.WriteLine("ViveVBS: Could not copy " + dll + " (file locked). Using existing copy.");
}
}
}
}
RuntimeDependencies.Add("$(ProjectDir)/Binaries/Win64/VS_PC_SDK.dll");
RuntimeDependencies.Add("$(ProjectDir)/Binaries/Win64/RRServerManageAPI.dll");
RuntimeDependencies.Add("$(ProjectDir)/Binaries/Win64/VSWPipeVarClient64U_MT.dll");
#endif
}
}

Binary file not shown.

View File

@@ -0,0 +1,27 @@
{
"FileVersion": 3,
"Version": 1,
"VersionName": "1.0",
"FriendlyName": "ViveVBS",
"Description": "",
"Category": "Other",
"CreatedBy": "AsterionVR",
"CreatedByURL": "",
"DocsURL": "",
"MarketplaceURL": "",
"SupportURL": "",
"CanContainContent": true,
"IsBetaVersion": false,
"IsExperimentalVersion": false,
"Installed": false,
"Modules": [
{
"Name": "ViveVBS",
"Type": "Runtime",
"LoadingPhase": "Default",
"WhitelistPlatforms": [
"Win64"
]
}
]
}

View File

@@ -0,0 +1,15 @@
// Copyright Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
using System.Collections.Generic;
public class PS_ViveVBSTarget : TargetRules
{
public PS_ViveVBSTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Game;
DefaultBuildSettings = BuildSettingsVersion.V5;
IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_5;
ExtraModuleNames.Add("PS_ViveVBS");
}
}

View File

@@ -0,0 +1,23 @@
// Copyright Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
public class PS_ViveVBS : ModuleRules
{
public PS_ViveVBS(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "EnhancedInput" });
PrivateDependencyModuleNames.AddRange(new string[] { });
// Uncomment if you are using Slate UI
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
// Uncomment if you are using online features
// PrivateDependencyModuleNames.Add("OnlineSubsystem");
// To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
}
}

View File

@@ -0,0 +1,6 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "PS_ViveVBS.h"
#include "Modules/ModuleManager.h"
IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, PS_ViveVBS, "PS_ViveVBS" );

View File

@@ -0,0 +1,6 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"

View File

@@ -0,0 +1,15 @@
// Copyright Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
using System.Collections.Generic;
public class PS_ViveVBSEditorTarget : TargetRules
{
public PS_ViveVBSEditorTarget( TargetInfo Target) : base(Target)
{
Type = TargetType.Editor;
DefaultBuildSettings = BuildSettingsVersion.V5;
IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_5;
ExtraModuleNames.Add("PS_ViveVBS");
}
}