mirror of
https://github.com/DrBeef/JKXR.git
synced 2025-02-07 15:51:07 +00:00
Fix Haptics
This commit is contained in:
parent
43ced097e4
commit
364f732397
4 changed files with 21 additions and 28 deletions
|
@ -1,8 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.drbeef.jk2quest"
|
package="com.drbeef.jkquest"
|
||||||
android:versionCode="30"
|
android:versionCode="31"
|
||||||
android:versionName="0.4.1" android:installLocation="auto" >
|
android:versionName="0.5.0" android:installLocation="auto" >
|
||||||
|
|
||||||
<!-- Tell the system this app requires OpenGL ES 3.1. -->
|
<!-- Tell the system this app requires OpenGL ES 3.1. -->
|
||||||
<uses-feature android:glEsVersion="0x00030002" android:required="true"/>
|
<uses-feature android:glEsVersion="0x00030002" android:required="true"/>
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
#include "VrInput.h"
|
#include "VrInput.h"
|
||||||
#include "VrCvars.h"
|
#include "VrCvars.h"
|
||||||
|
|
||||||
extern ovrApp gAppState;
|
|
||||||
|
|
||||||
#ifdef META_QUEST
|
#ifdef META_QUEST
|
||||||
|
|
||||||
|
extern ovrApp gAppState;
|
||||||
|
|
||||||
XrSpace CreateActionSpace(XrAction poseAction, XrPath subactionPath) {
|
XrSpace CreateActionSpace(XrAction poseAction, XrPath subactionPath) {
|
||||||
XrActionSpaceCreateInfo asci = {};
|
XrActionSpaceCreateInfo asci = {};
|
||||||
asci.type = XR_TYPE_ACTION_SPACE_CREATE_INFO;
|
asci.type = XR_TYPE_ACTION_SPACE_CREATE_INFO;
|
||||||
|
@ -443,17 +443,17 @@ void JKVR_Vibrate( int duration, int chan, float intensity )
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 2; ++i)
|
for (int i = 0; i < 2; ++i)
|
||||||
{
|
{
|
||||||
int channel = (i + 1) & chan;
|
int channel = 1-i;
|
||||||
if (channel)
|
if ((i + 1) & chan)
|
||||||
{
|
{
|
||||||
if (vibration_channel_duration[i] > 0.0f)
|
if (vibration_channel_duration[channel] > 0.0f)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (vibration_channel_duration[i] == -1.0f && duration != 0.0f)
|
if (vibration_channel_duration[channel] == -1.0f && duration != 0.0f)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
vibration_channel_duration[i] = duration;
|
vibration_channel_duration[channel] = duration;
|
||||||
vibration_channel_intensity[i] = intensity * vr_haptic_intensity->value;
|
vibration_channel_intensity[channel] = intensity * vr_haptic_intensity->value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#include "VrInput.h"
|
#include "VrInput.h"
|
||||||
#include "VrCvars.h"
|
#include "VrCvars.h"
|
||||||
|
|
||||||
extern ovrApp gAppState;
|
#ifdef PICO_XR
|
||||||
|
|
||||||
//#ifdef PICO_XR
|
extern ovrApp gAppState;
|
||||||
|
|
||||||
XrResult CheckXrResult(XrResult res, const char* originator) {
|
XrResult CheckXrResult(XrResult res, const char* originator) {
|
||||||
if (XR_FAILED(res)) {
|
if (XR_FAILED(res)) {
|
||||||
|
@ -580,17 +580,17 @@ void JKVR_Vibrate( int duration, int chan, float intensity )
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 2; ++i)
|
for (int i = 0; i < 2; ++i)
|
||||||
{
|
{
|
||||||
int channel = (i + 1) & chan;
|
int channel = 1-i;
|
||||||
if (channel)
|
if ((i + 1) & chan)
|
||||||
{
|
{
|
||||||
if (vibration_channel_duration[i] > 0.0f)
|
if (vibration_channel_duration[channel] > 0.0f)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (vibration_channel_duration[i] == -1.0f && duration != 0.0f)
|
if (vibration_channel_duration[channel] == -1.0f && duration != 0.0f)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
vibration_channel_duration[i] = duration;
|
vibration_channel_duration[channel] = duration;
|
||||||
vibration_channel_intensity[i] = intensity * vr_haptic_intensity->value;
|
vibration_channel_intensity[channel] = intensity * vr_haptic_intensity->value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -638,4 +638,4 @@ void JKVR_processHaptics() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//#endif
|
#endif //PICO_XR
|
||||||
|
|
|
@ -153,7 +153,7 @@ OXR_CheckErrors(XrInstance instance, XrResult result, const char* function, bool
|
||||||
#if defined(DEBUG)
|
#if defined(DEBUG)
|
||||||
#define OXR(func) OXR_CheckErrors(ovrApp_GetInstance(), func, #func, true);
|
#define OXR(func) OXR_CheckErrors(ovrApp_GetInstance(), func, #func, true);
|
||||||
#else
|
#else
|
||||||
#define OXR(func) OXR_CheckErrors(ovrApp_GetInstance(), func, #func, false);
|
#define OXR(func) func;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -226,13 +226,6 @@ void ovrTrackedController_Clear(ovrTrackedController* controller);
|
||||||
ovrMatrix4f ovrMatrix4f_Multiply(const ovrMatrix4f* a, const ovrMatrix4f* b);
|
ovrMatrix4f ovrMatrix4f_Multiply(const ovrMatrix4f* a, const ovrMatrix4f* b);
|
||||||
ovrMatrix4f ovrMatrix4f_CreateRotation(const float radiansX, const float radiansY, const float radiansZ);
|
ovrMatrix4f ovrMatrix4f_CreateRotation(const float radiansX, const float radiansY, const float radiansZ);
|
||||||
ovrMatrix4f ovrMatrix4f_CreateFromQuaternion(const XrQuaternionf* q);
|
ovrMatrix4f ovrMatrix4f_CreateFromQuaternion(const XrQuaternionf* q);
|
||||||
ovrMatrix4f ovrMatrix4f_CreateProjectionFov(
|
|
||||||
const float fovDegreesX,
|
|
||||||
const float fovDegreesY,
|
|
||||||
const float offsetX,
|
|
||||||
const float offsetY,
|
|
||||||
const float nearZ,
|
|
||||||
const float farZ);
|
|
||||||
|
|
||||||
XrVector4f XrVector4f_MultiplyMatrix4f(const ovrMatrix4f* a, const XrVector4f* v);
|
XrVector4f XrVector4f_MultiplyMatrix4f(const ovrMatrix4f* a, const XrVector4f* v);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue