mirror of
https://github.com/DrBeef/JKXR.git
synced 2024-11-21 19:51:33 +00:00
Add angle check for triggers touched by hand
This commit is contained in:
parent
78f7d9bcfc
commit
926c64c691
2 changed files with 16 additions and 0 deletions
|
@ -1385,6 +1385,14 @@ void G_TouchTriggersWithHand( gentity_t *ent, vec3_t src, vec3_t vf ) {
|
|||
continue;
|
||||
}
|
||||
|
||||
// In case touching button-like entity via use gesture, check activation angle here.
|
||||
// Existing check in g_trigger.cpp Touch_Multi is problematic because we do not have
|
||||
// there information by which hand was entity triggered.
|
||||
if ( DotProduct( hit->movedir, vf ) < 0.5 ) {
|
||||
//Not Within 45 degrees
|
||||
continue;
|
||||
}
|
||||
|
||||
touched[i] = qtrue;
|
||||
memset( &trace, 0, sizeof(trace) );
|
||||
if ( hit->e_TouchFunc != touchF_NULL ) {
|
||||
|
|
|
@ -856,6 +856,14 @@ void G_TouchTriggersWithHand( gentity_t *ent, vec3_t src, vec3_t vf ) {
|
|||
continue;
|
||||
}
|
||||
|
||||
// In case touching button-like entity via use gesture, check activation angle here.
|
||||
// Existing check in g_trigger.cpp Touch_Multi is problematic because we do not have
|
||||
// there information by which hand was entity triggered.
|
||||
if ( DotProduct( hit->movedir, vf ) < 0.5 ) {
|
||||
//Not Within 45 degrees
|
||||
continue;
|
||||
}
|
||||
|
||||
touched[i] = qtrue;
|
||||
memset( &trace, 0, sizeof(trace) );
|
||||
if ( hit->e_TouchFunc != touchF_NULL ) {
|
||||
|
|
Loading…
Reference in a new issue