16 Vehicle vehicle = Vehicle.Cast(
GetOwner());
20 RplComponent rpl = vehicle.GetRplComponent();
21 if (rpl && rpl.IsProxy())
25 SetEventMask(vehicle, EntityEvent.CONTACT);
27 ClearEventMask(vehicle, EntityEvent.CONTACT);
33 super.OnDamageStateChanged(state);
43 super.RegisterVehicleHitZone(hitZone);
46 SCR_RotorHitZone rotorHitZone = SCR_RotorHitZone.Cast(hitZone);
47 if (rotorHitZone && rotorHitZone.GetPointInfo() && !
m_aRotorHitZones.Contains(rotorHitZone))
55 super.UnregisterVehicleHitZone(hitZone);
58 SCR_RotorHitZone rotorHitZone = SCR_RotorHitZone.Cast(hitZone);
59 if (rotorHitZone && rotorHitZone.GetPointInfo())
68 super.UpdateVehicleState();
70 HelicopterControllerComponent controller = HelicopterControllerComponent.Cast(
m_Controller);
71 VehicleHelicopterSimulation simulation = VehicleHelicopterSimulation.Cast(
m_Simulation);
73 if (!controller || !simulation || !simulation.IsValid())
77 SCR_RotorHitZone rotorHitZone;
78 int rotorCount = simulation.RotorCount();
79 array<float> rotorEfficiencies = {};
82 for (
int i; i < rotorCount; i++)
89 rotorHitZone = SCR_RotorHitZone.Cast(hitZone);
92 rotorID = rotorHitZone.GetRotorIndex();
93 if (rotorEfficiencies.IsIndexValid(rotorID))
94 rotorEfficiencies[rotorID] = rotorEfficiencies[rotorID] * rotorHitZone.GetEfficiency();
100 foreach (
int i,
float rotorEfficiency : rotorEfficiencies)
102 simulation.RotorSetForceScaleState(i, rotorEfficiency);
103 simulation.RotorSetTorqueScaleState(i, rotorEfficiency);
120 float movementDamage;
127 if (!
float.AlmostEqual(movementDamage, GetMovementDamage()))
128 SetMovementDamage(movementDamage);
130 VehicleControllerComponent controller = VehicleControllerComponent.Cast(
m_Controller);
132 controller.SetCanMove(movementDamage < 1);