Point anglesensor: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
{{wrongtitle|title=point_anglesensor}}
{{wrongtitle|title=point_anglesensor}}
{{base_point}}


==Entity Description==
==Entity Description==
An entity that detects whether another entity points in a given direction for a period of time.  
An entity that detects whether another entity points in a given direction for a period of time.  


==Availability==
{{in game|point}} {{game-base}}
{{in code|class=class_c_point_angle_sensor.html CPointAngleSensor|file=pointanglesensor_8cpp-source.html pointanglesensor.cpp}}
{{in code|class=class_c_point_angle_sensor.html CPointAngleSensor|file=pointanglesensor_8cpp-source.html pointanglesensor.cpp}}


Line 42: Line 41:
*'''{{ep2 add|FacingPercentage <float>}}'''
*'''{{ep2 add|FacingPercentage <float>}}'''
:Normalized value (0..1) where 1 is facing directly at target and 0 is at or beyond the angle of tolerance.
:Normalized value (0..1) where 1 is facing directly at target and 0 is at or beyond the angle of tolerance.
[[Category:Entities]]

Revision as of 15:39, 12 April 2008

Template:Wrongtitle Template:Base point

Entity Description

An entity that detects whether another entity points in a given direction for a period of time.

Template:In code

Keyvalues

<target_destination> Name of the entity whose angles will be sensed.
  • lookatname
<target_destination> The entity we want to check to see if the Target Entity is looking at.
  • duration
<float> The amount of time the Target Entity must look at the 'Look at Entity' to trigger this entity, in seconds.
  • tolerance
<integer> The tolerance, in degrees, in the checking to determine when the Target Entity is looking at the Look At Entity.

Inputs

Toggle the sensor between enabled and disabled.
  • Test
Check to see if the Target Entity is facing the Look At Entity within the specified tolerance, firing either the OnFacingLookat or OnNotFacingLookat output based on the result.
  • SetTargetEntity <target_destination>
Entity I should sense

Outputs

Fired when the forward direction of the Target Entity changes. Passes the new forward direction as a parameter.
  • OnFacingLookat
Fired when the Target Entity points at the Look At Entity for more than the specified Duration, or in response to a Test input.
  • OnNotFacingLookat
Fires in response to a Test input when the Target Entity is not pointing at the Look At Entity.
Normalized value (0..1) where 1 is facing directly at target and 0 is at or beyond the angle of tolerance.