private void DynamicSyncFromComponentToDWP(VehicleEntity vehicle, ShipInternState internalState) { var controller = GetController(vehicle); var state = VehicleDynamicPredictionUtility.MoveToState(controller, internalState); SetRudderAnglesFromState(controller, internalState); SetShipInput(controller, internalState); VehicleDynamicPredictionUtility.SetControllerState(controller, state.Position, state.Rotation, state.LinearVelocity, state.AngularVelocity, state.IsSleeping, state.SleepingOutSync); }
private void DynamicSyncFromComponentToController(VehicleEntity vehicle, VehicleAbstractInternState internalState) { var controller = GetController(vehicle); var state = VehicleDynamicPredictionUtility.MoveToState(controller, internalState); SetWheelAngleFromState(controller, internalState); SetWheelEntityInput(controller, internalState); SetControllerState(controller, state.Position, state.Rotation, state.LinearVelocity, state.AngularVelocity, state.Crashed, state.IsSleeping, state.SleepingOutSync); }
private void DynamicPredictState(VehicleEntity vehicle, IVehicleCmd cmd) { var vehicleCmd = (VehicleCmd)cmd; var controller = GetController(vehicle); var state = VehicleDynamicPredictionUtility.MoveToState(controller, vehicleCmd); SetRudderAnglesFromCmd(controller, vehicleCmd); VehicleDynamicPredictionUtility.SetControllerState(controller, state.Position, state.Rotation, state.LinearVelocity, state.AngularVelocity, state.IsSleeping, state.SleepingOutSync); }