Struct TargetIndicator
The contextual data that defines a tracked target in screen space.
Inherited Members
Namespace: TargetIndicators
Assembly: TargetIndicators.dll
Syntax
public readonly struct TargetIndicator
Constructors
TargetIndicator(TargetIndicatorId, Transform, Pose, bool, float, float)
Constructs a TargetIndicator.
Declaration
public TargetIndicator(TargetIndicatorId id, Transform target, Pose screenPose, bool isOutsideBoundary, float distance, float lookAtDot)
Parameters
| Type | Name | Description |
|---|---|---|
| TargetIndicatorId | id | The ID that defines the indicator. |
| Transform | target | The target that is being tracked by the target indicator. |
| Pose | screenPose | The screen space coordinates and rotation of the target. |
| bool | isOutsideBoundary | The current state of the target's screen pose if it's outside the boundary. |
| float | distance | The world space distance to the target. |
| float | lookAtDot | The dot product of the reference forward vector and the direction to the target. |
TargetIndicator(TargetIndicatorId, Transform, Vector3, Quaternion, bool, float, float)
Constructs a TargetIndicator.
Declaration
public TargetIndicator(TargetIndicatorId id, Transform target, Vector3 screenPoint, Quaternion rotation, bool isOutsideBoundary, float distance, float lookAtDot)
Parameters
| Type | Name | Description |
|---|---|---|
| TargetIndicatorId | id | The ID that defines the indicator. |
| Transform | target | The target that is being tracked by the target indicator. |
| Vector3 | screenPoint | The screen space coordinates of the target. |
| Quaternion | rotation | The screen space rotation of the target. |
| bool | isOutsideBoundary | The current state of the target's screen pose if it's outside the boundary. |
| float | distance | The world space distance to the target. |
| float | lookAtDot | The dot product of the reference forward vector and the direction to the target. |
Properties
Default
Gets a default-initialized TargetIndicator. This may be different from the zero-initialized version
(for example, the pose is Pose.identity instead of zero initialized).
Declaration
public static TargetIndicator Default { get; }
Property Value
| Type | Description |
|---|---|
| TargetIndicator |
Distance
The distance in world space from the reference point (Camera or Compass Override) to the target.
Declaration
public float Distance { get; }
Property Value
| Type | Description |
|---|---|
| float |
Id
The ID that defines the target indicator.
Declaration
public TargetIndicatorId Id { get; }
Property Value
| Type | Description |
|---|---|
| TargetIndicatorId |
IsOutsideBoundary
True if the target's screen pose is outside the TargetIndicatorManager configured boundary.
Otherwise, false.
Declaration
public bool IsOutsideBoundary { get; }
Property Value
| Type | Description |
|---|---|
| bool |
LookAtDot
The dot product of the reference forward vector and the direction to the target. Ranges from 1 (looking directly at) to -1 (looking directly away).
Declaration
public float LookAtDot { get; }
Property Value
| Type | Description |
|---|---|
| float |
ScreenPose
The screen space coordinates and rotation of the target.
ScreenPose.position.x corresponds to the horizontal
axis coordinate in pixels where 0 is the left end of the axis and UnityEngine.Screen.width is the right end of the axis.
ScreenPose.position.y corresponds to the vertical axis coordinate in pixels where 0 is the bottom end of the axis and
UnityEngine.Screen.height is the top end of the axis.
ScreenPose.position.z corresponds to the depth from the camera in world space in meters.
ScreenPose.rotation corresponds to the rotation in screen space relative to the right vector to rotate
the indicator to point at the target.
Declaration
public Pose ScreenPose { get; }
Property Value
| Type | Description |
|---|---|
| Pose |
Target
The target that is being tracked by the target indicator.
Declaration
public Transform Target { get; }
Property Value
| Type | Description |
|---|---|
| Transform |