mirror of
https://github.com/DrBeef/QuestZDoom.git
synced 2025-04-24 18:22:02 +00:00
fix build with latest PCVR branch
moved some common functions inside the gzdoom branch since they are used with OpenVR as well
This commit is contained in:
parent
7b0adaad6c
commit
9bed866c5f
3 changed files with 0 additions and 36 deletions
|
@ -45,7 +45,6 @@ bool resetDoomYaw;
|
|||
bool resetPreviousPitch;
|
||||
float doomYaw;
|
||||
float previousPitch;
|
||||
float vrFOV;
|
||||
vec3_t worldPosition;
|
||||
vec3_t hmdPosition;
|
||||
vec3_t hmdorientation;
|
||||
|
|
|
@ -48,8 +48,6 @@ extern float doomYaw;
|
|||
extern bool resetPreviousPitch;
|
||||
extern float previousPitch;
|
||||
|
||||
extern float vrFOV;
|
||||
|
||||
extern vec3_t worldPosition;
|
||||
|
||||
extern vec3_t hmdPosition;
|
||||
|
|
|
@ -62,37 +62,4 @@ void rotateAboutOrigin(float v1, float v2, float rotation, vec2_t out)
|
|||
out[1] = v[1];
|
||||
}
|
||||
|
||||
float length(float x, float y)
|
||||
{
|
||||
return sqrtf(powf(x, 2.0f) + powf(y, 2.0f));
|
||||
}
|
||||
|
||||
#define NLF_DEADZONE 0.1
|
||||
#define NLF_POWER 2.2
|
||||
|
||||
float nonLinearFilter(float in)
|
||||
{
|
||||
float val = 0.0f;
|
||||
if (in > NLF_DEADZONE)
|
||||
{
|
||||
val = in > 1.0f ? 1.0f : in;
|
||||
val -= NLF_DEADZONE;
|
||||
val /= (1.0f - NLF_DEADZONE);
|
||||
val = powf(val, NLF_POWER);
|
||||
}
|
||||
else if (in < -NLF_DEADZONE)
|
||||
{
|
||||
val = in < -1.0f ? -1.0f : in;
|
||||
val += NLF_DEADZONE;
|
||||
val /= (1.0f - NLF_DEADZONE);
|
||||
val = -powf(fabsf(val), NLF_POWER);
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
bool between(float min, float val, float max)
|
||||
{
|
||||
return (min < val) && (val < max);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue