Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AIDecoVectorDistance.c
Go to the documentation of this file.
1 class SCR_AIDecoVectorDistance : DecoratorScripted
2 {
3  protected static const string PORT_VECTOR_0 = "Vector0";
4  protected static const string PORT_VECTOR_1 = "Vector1";
5  protected static const string PORT_DISTANCE_THRESHOLD = "Threshold";
6 
7  protected static ref TStringArray s_aVarsIn = {
8  PORT_VECTOR_0,
9  PORT_VECTOR_1,
10  PORT_DISTANCE_THRESHOLD
11  };
12  override TStringArray GetVariablesIn() { return s_aVarsIn; }
13 
14  [Attribute("0", UIWidgets.EditBox)]
15  protected float m_fDistanceThreshold;
16 
17  override string GetOnHoverDescription() { return "Returns true when distance between two vectors is below distance threshold."; }
18 
19  override bool TestFunction(AIAgent owner)
20  {
21  vector v0;
22  vector v1;
23  float t;
24 
25  if (!GetVariableIn(PORT_VECTOR_0, v0) ||
26  !GetVariableIn(PORT_VECTOR_1, v1))
27  return false;
28 
29  if (!GetVariableIn(PORT_DISTANCE_THRESHOLD, t))
30  t = m_fDistanceThreshold;
31 
32  return vector.Distance(v0, v1) < t;
33  }
34 }
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_AIDecoVectorDistance
Definition: SCR_AIDecoVectorDistance.c:1