mirror of
https://github.com/DrBeef/JKXR.git
synced 2024-11-10 06:42:17 +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;
|
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;
|
touched[i] = qtrue;
|
||||||
memset( &trace, 0, sizeof(trace) );
|
memset( &trace, 0, sizeof(trace) );
|
||||||
if ( hit->e_TouchFunc != touchF_NULL ) {
|
if ( hit->e_TouchFunc != touchF_NULL ) {
|
||||||
|
|
|
@ -856,6 +856,14 @@ void G_TouchTriggersWithHand( gentity_t *ent, vec3_t src, vec3_t vf ) {
|
||||||
continue;
|
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;
|
touched[i] = qtrue;
|
||||||
memset( &trace, 0, sizeof(trace) );
|
memset( &trace, 0, sizeof(trace) );
|
||||||
if ( hit->e_TouchFunc != touchF_NULL ) {
|
if ( hit->e_TouchFunc != touchF_NULL ) {
|
||||||
|
|
Loading…
Reference in a new issue