Point anglesensor: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (Used KV/I/O BaseEntity templates. Template:in code -> Template:code class.) |
||
Line 1: | Line 1: | ||
{{base point|point_anglesensor}} It detects whether another entity points in a given direction for a period of time. | {{base point|point_anglesensor}} | ||
It detects whether another entity points in a given direction for a period of time. | |||
{{ | {{code class|CPointAngleSensor|pointanglesensor.cpp}} | ||
== | == KeyValues == | ||
{{KV|Target Entity Name|target_destination|Name of the entity whose angles will be sensed.}} | {{KV|Target Entity Name|target_destination|Name of the entity whose angles will be sensed.}} | ||
{{KV|Look At Entity|target_destination|The entity we want to check to see if the Target Entity is looking at.}} | {{KV|Look At Entity|target_destination|The entity we want to check to see if the Target Entity is looking at.}} | ||
{{KV|Duration|float|The amount of time the Target Entity must look at the 'Look at Entity' to trigger this entity, in seconds.}} | {{KV|Duration|float|The amount of time the Target Entity must look at the 'Look at Entity' to trigger this entity, in seconds.}} | ||
{{KV|Tolerance|integer|The tolerance, in degrees, in the checking to determine when the Target Entity is looking at the Look At Entity.}} | {{KV|Tolerance|integer|The tolerance, in degrees, in the checking to determine when the Target Entity is looking at the Look At Entity.}} | ||
{{KV EnableDisable}} | {{KV EnableDisable}} | ||
{{KV BaseEntity}} | |||
== Flags == | == Flags == | ||
{{fl|1|Use target entity's angles (NOT position)}} | |||
== Inputs == | == Inputs == | ||
{{IO|Toggle|Toggle the sensor between enabled and disabled.}} | {{IO|Toggle|Toggle the sensor between enabled and disabled.}} | ||
{{IO|Test|Check to see if the Target Entity is facing the Look At Entity within the specified tolerance, firing either the <code>OnFacingLookat</code> or <code>OnNotFacingLookat</code> output based on the result.}} | {{IO|Test|Check to see if the Target Entity is facing the Look At Entity within the specified tolerance, firing either the <code>OnFacingLookat</code> or <code>OnNotFacingLookat</code> output based on the result.}} | ||
{{I EnableDisable}} | {{I EnableDisable}} | ||
{{I BaseEntity}} | |||
== Outputs == | == Outputs == | ||
Line 27: | Line 26: | ||
{{IO|OnNotFacingLookat|Fires in response to a <code>Test</code> input when the Target Entity is not pointing at the Look At Entity.}} | {{IO|OnNotFacingLookat|Fires in response to a <code>Test</code> input when the Target Entity is not pointing at the Look At Entity.}} | ||
{{IO|FacingPercentage|Normalized value (0..1) where 1 is facing directly at target and 0 is at or beyond the angle of tolerance.|param=float}} | {{IO|FacingPercentage|Normalized value (0..1) where 1 is facing directly at target and 0 is at or beyond the angle of tolerance.|param=float}} | ||
{{O | {{O BaseEntity|l4d=1}} | ||
==See Also == | == See Also == | ||
[https://www.youtube.com/watch?v=vNhKk1gosCI?t=139: | [https://www.youtube.com/watch?v=vNhKk1gosCI?t=139: Youtube video about the Point_AngleSensor] |
Revision as of 12:05, 15 May 2022
Template:Base point It detects whether another entity points in a given direction for a period of time.
KeyValues
- Target Entity Name ([todo internal name (i)]) <targetname>
- Name of the entity whose angles will be sensed.
- Look At Entity ([todo internal name (i)]) <targetname>
- The entity we want to check to see if the Target Entity is looking at.
- Duration ([todo internal name (i)]) <float>
- The amount of time the Target Entity must look at the 'Look at Entity' to trigger this entity, in seconds.
- Tolerance ([todo internal name (i)]) <integer>
- The tolerance, in degrees, in the checking to determine when the Target Entity is looking at the Look At Entity.
- Start Disabled (StartDisabled) <boolean>
- Stay dormant until activated (with the
Enable
input).
Flags
- Use target entity's angles (NOT position) : [1]
Inputs
- Toggle
- 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
orOnNotFacingLookat
output based on the result.
EnableDisable:
- Enable / Disable
- Enable/disable this entity from performing its task. It might also disappear from view.
Outputs
- TargetDir <vector >
- 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.
- FacingPercentage <float >
- Normalized value (0..1) where 1 is facing directly at target and 0 is at or beyond the angle of tolerance.