Difference between revisions of "Viewcone"

From Valve Developer Community
Jump to: navigation, search
m
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{stub}}
+
A '''viewcone''' is a representation of the spatial geometry of an [[NPC]]'s current visual field. A target has to be within this cone for the NPC to recognize/react to its presence. (Even if it's being shot at, it cannot chase or flee from something it cannot see.)
{{todo|see [[Talk:NPC_Sensing]]}}
 
  
{{note|A Player's "viewcone" is called the '''[http://en.wikipedia.org/wiki/Frustrum Frustum]'''. Its geometry is that of a ''truncated pyramid'' rather than a cone, because the player's screen is rectangular rather than circular.}}
+
*The angle or scope of the cone represents the NPC's ''Angular [[FOV|Field of View (FOV)]]'' (as determined by its [[m_flFieldOfView]] value).
 +
*The edges or boundaries of the cone represents the NPC's periphery of vision.
 +
*The length or depth of the cone's long axis represents the NPC's maximum sight range. (It appears to be the same for all NPCs: 2048 units, or seemingly unlimited if their ''Long Visibility'' flag is set. The ''Think Outside PVS'' flag does not effect this range.)
 +
*The direction of the cone is determined by the NPCs current orientation, or [[Angles]].
 +
 
 +
 
 +
{{note|An NPC may still hear things outside its viewcone, as this is instead determined by its [[PAS|Potentially Audible Set (PAS)]].}}
 +
 
 +
 
 +
{{note|The viewcone is only used by NPCs. For the player field of view, see [[FOV]].}}
 +
 
 +
{{TODO|see [[Talk:NPC_Sensing]]}}
 +
 
 +
 
 +
==See also==
 +
 
 +
*[[npc_viewcone]] - A partial representation of viewcones.
 +
 
 +
[[Category:AI]]

Latest revision as of 21:38, 1 February 2011

A viewcone is a representation of the spatial geometry of an NPC's current visual field. A target has to be within this cone for the NPC to recognize/react to its presence. (Even if it's being shot at, it cannot chase or flee from something it cannot see.)

  • The angle or scope of the cone represents the NPC's Angular Field of View (FOV) (as determined by its m_flFieldOfView value).
  • The edges or boundaries of the cone represents the NPC's periphery of vision.
  • The length or depth of the cone's long axis represents the NPC's maximum sight range. (It appears to be the same for all NPCs: 2048 units, or seemingly unlimited if their Long Visibility flag is set. The Think Outside PVS flag does not effect this range.)
  • The direction of the cone is determined by the NPCs current orientation, or Angles.


Note:An NPC may still hear things outside its viewcone, as this is instead determined by its Potentially Audible Set (PAS).


Note:The viewcone is only used by NPCs. For the player field of view, see FOV.

To do: see Talk:NPC_Sensing


See also