3 protected static const string RANGE_PORT =
"AngularRangeDeg";
4 protected static const string LOOK_AXIS_PORT =
"LookAxis";
5 protected static const string IS_FREE_LOOK =
"IsFreeLook";
6 protected static const float FREE_LOOK_ANGLE = 30.0;
8 [
Attribute(
"20", UIWidgets.EditBox,
"Distance for looking" )]
9 protected float m_fDistance;
13 protected static ref TStringArray s_aVarsOut = { LOOK_AXIS_PORT, RANGE_PORT, IS_FREE_LOOK };
14 override TStringArray GetVariablesOut() {
return s_aVarsOut; }
17 override ENodeResult EOnTaskSimulate(AIAgent owner,
float dt)
19 SCR_ChimeraCharacter character = SCR_ChimeraCharacter.Cast(owner.GetControlledEntity());
21 return ENodeResult.FAIL;
22 if (!character.IsInVehicle())
23 return ENodeResult.FAIL;
24 CompartmentAccessComponent compAcc = character.GetCompartmentAccessComponent();
26 return ENodeResult.FAIL;
27 BaseCompartmentSlot comp = compAcc.GetCompartment();
29 return ENodeResult.FAIL;
30 vector aimingLimitHoriz, aimingLimitVert, forwardVec;
31 IEntity vehicle = comp.GetVehicle();
32 forwardVec = vehicle.GetTransformAxis(2).Normalized();
34 bool isFreeLook =
true;
40 if (!turretController)
41 return ENodeResult.FAIL;
42 TurretComponent turretComponent = turretController.GetTurretComponent();
44 return ENodeResult.FAIL;
45 turretComponent.GetAimingLimits(aimingLimitHoriz,aimingLimitVert);
46 angleBound = aimingLimitHoriz[1];
51 angleBound = FREE_LOOK_ANGLE;
54 SetVariableOut(LOOK_AXIS_PORT, comp.GetPosition() + forwardVec *
m_fDistance);
55 SetVariableOut(RANGE_PORT, angleBound);
56 SetVariableOut(IS_FREE_LOOK, isFreeLook);
58 return ENodeResult.SUCCESS;
62 override bool VisibleInPalette() {
return true; }
65 override string GetOnHoverDescription()
67 return "GetAllowedLookRange: Gets the range of look for character in vehicle";