435 {
436 vector ref_pos;
437 vector ref_dir;
438 vector player_dir;
439 float dot;
440 bool has_memory_point = MemoryPointExists( selection );
441
442 if ( has_memory_point )
443 {
444 ref_pos = ModelToWorld( GetMemoryPointPos( selection ) );
446 }
447 else
448 {
450 ref_dir = ref_pos - player.GetPosition();
451 }
452
454 ref_dir[1] = 0;
455
456 player_dir = player.GetDirection();
458 player_dir[1] = 0;
459
460 if ( ref_dir.
Length() != 0 )
461 {
462 dot = vector.Dot( player_dir, ref_dir );
463 }
464
465 if ( has_memory_point )
466 {
468 {
469 return true;
470 }
471 }
472 else
473 {
475 {
476 return true;
477 }
478 }
479
480 return false;
481 }
const float MIN_ACTION_DETECTION_ANGLE_RAD
proto native float Length()
Returns length of vector (magnitude)
proto float Normalize()
Normalizes vector. Returns length.
vector GetPosition()
Get the world position of the Effect.