Point anglesensor: Difference between revisions
Jump to navigation
Jump to search
m (Robot: fixing template case.) |
(Cleanup) |
||
Line 1: | Line 1: | ||
{{ | {{base point|point_anglesensor}} It detects whether another entity points in a given direction for a period of time. | ||
== | {{in code|class=class_c_point_angle_sensor.html CPointAngleSensor|file=pointanglesensor_8cpp-source.html pointanglesensor.cpp}} | ||
{{ | == Keyvalues == | ||
{{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|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 Targetname}} | |||
{{KV Parentname}} | |||
{{KV EnableDisable}} | |||
== | == Flags == | ||
* | * 1 : Use target entity's angles (NOT position) | ||
==Inputs== | == Inputs == | ||
{{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.}} | |||
{{I Targetname}} | |||
{{I Parentname}} | |||
{{I EnableDisable}} | |||
==Outputs== | == Outputs == | ||
{{IO|TargetDir|Fired when the forward direction of the Target Entity changes. Passes the new forward direction as a parameter.|param=vector}} | |||
{{IO|OnFacingLookat|Fired when the Target Entity points at the Look At Entity for more than the specified Duration, or in response to a <code>Test</code> input.}} | |||
{{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}} | |||
{{O Targetname}} | |||
Revision as of 03:29, 28 July 2011
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.
- Name (targetname) <string>[ Edit ]
- The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentname
ortarget
).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
Parentname:
- Parent (parentname) <targetname>
- Specifies a movement parent. An entity will maintain its initial offset from its parent. An attachment point can be added to the end of the name, separated by a comma.
- Start Disabled (StartDisabled) <boolean>
- Stay dormant until activated (with the
Enable
input).
Flags
- 1 : Use target entity's angles (NOT position)
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.
Parentname:
- SetParent <string >
- Move with this entity. See Entity Hierarchy (parenting).
- SetParentAttachment <string >
- Change this entity to attach to a specific attachment point on its parent. The entity will teleport so that the position of its root bone matches that of the attachment. Entities must be parented before being sent this input.
- SetParentAttachmentMaintainOffset <string >
- As above, but without teleporting. The entity retains its position relative to the attachment at the time of the input being received.
- ClearParent
- Removes this entity from the the movement hierarchy, leaving it free to move independently.
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.