mirror of
https://github.com/DrBeef/Doom3Quest.git
synced 2024-11-10 06:41:36 +00:00
Small tidy up
This commit is contained in:
parent
2923bdc996
commit
58253c2d20
2 changed files with 4 additions and 8 deletions
|
@ -1643,7 +1643,7 @@ bool idEntity::StartSoundShader( const idSoundShader *shader, const s_channelTyp
|
|||
directionYaw.Normalize360();
|
||||
|
||||
//Pass sound on in case it can trigger a haptic event (like doors)
|
||||
float intensity = looping ? (100.0f - distance) :
|
||||
float intensity = looping ? ((distance * 100)/ 150.0f) :
|
||||
40 + Min<float>((int)(150.0f - distance), 80);
|
||||
|
||||
common->HapticEvent(shader->GetName(), 4, looping ? 1 : 0, intensity,
|
||||
|
|
|
@ -26,7 +26,6 @@ If you have questions concerning this license or the applicable additional terms
|
|||
===========================================================================
|
||||
*/
|
||||
|
||||
#include <d3es-multithread-master/neo/framework/Game.h>
|
||||
#include "sys/platform.h"
|
||||
#include "framework/FileSystem.h"
|
||||
#include "framework/Session.h"
|
||||
|
@ -1593,8 +1592,6 @@ void idSoundWorldLocal::CalcEars( int numSpeakers, idVec3 spatializedOrigin, idV
|
|||
}
|
||||
}
|
||||
|
||||
extern idGame * game;
|
||||
|
||||
/*
|
||||
===============
|
||||
idSoundWorldLocal::AddChannelContribution
|
||||
|
@ -1762,20 +1759,19 @@ void idSoundWorldLocal::AddChannelContribution( idSoundEmitterLocal *sound, idSo
|
|||
float *alignedInputSamples = (float *) ( ( ( (intptr_t)inputSamples ) + 15 ) & ~15 );
|
||||
|
||||
if (cvarSystem->GetCVarBool("vr_bhaptics") &&
|
||||
looping &&
|
||||
game != NULL)
|
||||
looping)
|
||||
{
|
||||
idVec3 direction = (listenerPos / DOOM_TO_METERS) - sound->origin;
|
||||
|
||||
float distance = direction.Length();
|
||||
|
||||
if (distance <= 100.0F) {
|
||||
if (distance <= 150.0F) {
|
||||
direction.Normalize();
|
||||
idAngles bodyAng = listenerAxis.ToAngles();
|
||||
idAngles directionYaw(0, 180 + (direction.ToYaw() - bodyAng.yaw), 0);
|
||||
directionYaw.Normalize360();
|
||||
|
||||
int intensity = 100 - distance;
|
||||
int intensity = (int)((distance * 100)/ 150.0f);
|
||||
Doom3Quest_HapticUpdateEvent(shader->GetName(), intensity, directionYaw.yaw);
|
||||
} else{
|
||||
Doom3Quest_HapticUpdateEvent(shader->GetName(), 0, 0);
|
||||
|
|
Loading…
Reference in a new issue