public virtual void SetFrom(VehicleEntity vehicle) { var comp = (CarDynamicDataComponent)vehicle.GetDynamicData(); Flag = comp.Flag; IsHornOn = comp.IsHornOn; HandbrakeInput = comp.HandbrakeInput; IsAccelerated = comp.IsAccelerated; SteerInput = comp.SteerInput; ThrottleInput = comp.ThrottleInput; Position = comp.Position; Rotation = comp.Rotation; LinearVelocity = comp.LinearVelocity; AngularVelocity = comp.AngularVelocity; IsSleeping = comp.IsSleeping; var indexArray = VehicleIndexHelper.GetWheelIndexArray(); for (int i = 0; i < indexArray.Length; ++i) { var index = indexArray[i]; if (WheelEntityUtility.HasWheel(vehicle, index)) { GetWheelState(WheelEntityUtility.GetWheel(vehicle, index), Wheels[i]); } } }
protected override void SetWheel(VehicleEntity vehicle, VehiclePartIndex index, WheelAbstractState state) { base.SetWheel(vehicle, index, state); var fromState = (WheelState)state; var comp = WheelEntityUtility.GetWheel(vehicle, index); comp.SteerAngle = fromState.SteerAngle; }
protected virtual void SetWheel(VehicleEntity vehicle, VehiclePartIndex index, WheelAbstractState state) { var comp = WheelEntityUtility.GetWheel(vehicle, index); comp.ColliderSteerAngle = state.ColliderSteerAngle; }