430 {
431 vector ref_pos;
432 vector ref_dir;
433 vector player_dir;
434 float dot;
435 bool has_memory_point = MemoryPointExists( selection );
436
437 if ( has_memory_point )
438 {
439 ref_pos = ModelToWorld( GetMemoryPointPos( selection ) );
441 }
442 else
443 {
445 ref_dir = ref_pos - player.GetPosition();
446 }
447
449 ref_dir[1] = 0;
450
451 player_dir = player.GetDirection();
453 player_dir[1] = 0;
454
455 if ( ref_dir.
Length() != 0 )
456 {
457 dot = vector.Dot( player_dir, ref_dir );
458 }
459
460 if ( has_memory_point )
461 {
463 {
464 return true;
465 }
466 }
467 else
468 {
470 {
471 return true;
472 }
473 }
474
475 return false;
476 }
const float MIN_ACTION_DETECTION_ANGLE_RAD
proto native float Length()
Returns length of vector (magnitude)
proto float Normalize()
Normalizes vector. Returns length.
class JsonUndergroundAreaTriggerData GetPosition