本文整理汇总了C#中FlightCtrlState.CopyFrom方法的典型用法代码示例。如果您正苦于以下问题:C# FlightCtrlState.CopyFrom方法的具体用法?C# FlightCtrlState.CopyFrom怎么用?C# FlightCtrlState.CopyFrom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FlightCtrlState
的用法示例。
在下文中一共展示了FlightCtrlState.CopyFrom方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: pop
//retrieve the flight control state entered at a given time
public void pop(FlightCtrlState controls, double time)
{
if (states.Count == 0 || states.Peek().ActTime > time)
{
setNeutral(controls);
return; //returns neutral if no controls are entered or the entered controls are not within the signal delay
}
TimedCtrlState popState = states.Peek();
while (states.Peek().ActTime < time)
{
popState = states.Dequeue();
}
controls.CopyFrom(popState.flightCtrlState);
if (controls.killRot) // this overrides the delay in attitute control if SAS is activated. Thereby allowing SAS to make control changes without delay
{
controls.pitch = pitch;
controls.roll = roll;
controls.yaw = yaw;
}
}
示例2: PopFlightCtrl
private void PopFlightCtrl(FlightCtrlState fcs, ISatellite sat)
{
FlightCtrlState delayed = new FlightCtrlState();
// Keep the throttle on no connection
if(this.KeepThrottleNoConnect == true)
{
delayed.mainThrottle = fcs.mainThrottle;
}
while (mFlightCtrlQueue.Count > 0 && mFlightCtrlQueue.Peek().TimeStamp <= RTUtil.GameTime)
{
delayed = mFlightCtrlQueue.Dequeue().State;
}
fcs.CopyFrom(delayed);
}
示例3: PopFlightCtrl
private void PopFlightCtrl(FlightCtrlState fcs, ISatellite sat)
{
FlightCtrlState delayed = new FlightCtrlState();
while (mFlightCtrlQueue.Count > 0 && mFlightCtrlQueue.Peek().TimeStamp <= RTUtil.GameTime)
{
delayed = mFlightCtrlQueue.Dequeue().State;
}
fcs.CopyFrom(delayed);
}
示例4: PopFlightCtrl
/// <summary>Remove a <see cref="FlightCtrlState"/> from the flight control queue.</summary>
/// <param name="fcs">The <see cref="FlightCtrlState"/> to be removed from the queue.</param>
/// <param name="sat">The satellite from which the <see cref="FlightCtrlState"/> should be removed.</param>
private void PopFlightCtrl(FlightCtrlState fcs, ISatellite sat)
{
//TODO: `sat` parameter is never used. Check if is needed somewhere: if it's not, remove it.
var delayed = new FlightCtrlState();
// Keep the throttle on no connection
if(KeepThrottleNoConnect)
{
delayed.mainThrottle = fcs.mainThrottle;
}
while (_flightCtrlQueue.Count > 0 && _flightCtrlQueue.Peek().TimeStamp <= RTUtil.GameTime)
{
delayed = _flightCtrlQueue.Dequeue().State;
}
fcs.CopyFrom(delayed);
}
示例5: OnFlyByWire
public void OnFlyByWire(FlightCtrlState state)
{
// State may arrive with SAS or WASD controls pre-applied. Save it and reset pitch/yaw/roll so that it doesn't mess with input.
FlightCtrlState preState = new FlightCtrlState();
preState.CopyFrom(state);
if (AdvancedFlyByWire.Instance.m_IgnoreFlightCtrlState)
{
state.pitch = 0; state.yaw = 0; state.roll = 0;
}
// skill vessel input if we're in time-warp
m_DisableVesselControls = TimeWarp.fetch != null && TimeWarp.fetch.current_rate_index != 0 && TimeWarp.fetch.Mode == TimeWarp.Modes.HIGH;
m_Throttle.SetMinMaxValues(-state.mainThrottle, 1.0f - state.mainThrottle);
m_WheelThrottle.SetMinMaxValues(-1.0f, 1.0f);
foreach (ControllerConfiguration config in m_Configuration.controllers)
{
if (config.isEnabled)
{
config.iface.Update(state);
UpdateAxes(config, state);
if (FlightGlobals.ActiveVessel.isEVA)
{
EVAController.Instance.UpdateEVAFlightProperties(config, state);
}
CameraController.Instance.UpdateCameraProperties
(
m_CameraPitch.Update(), m_CameraHeading.Update(),
m_CameraZoom.Update(), config.cameraSensitivity
);
}
}
UpdateFlightProperties(state);
ZeroOutFlightProperties();
// Apply pre-state if not neutral and no AFBW input (including trim).
if (!preState.isNeutral && AdvancedFlyByWire.Instance.m_IgnoreFlightCtrlState)
{
float t = controlDetectionThreshold;
bool hasInput = Math.Abs(state.pitch) > t || Math.Abs(state.yaw) > t || Math.Abs(state.roll) > t;
// hasInput will always be true if trim is active on any axis
if (!hasInput)
{
state.pitch = preState.pitch;
state.yaw = preState.yaw;
state.roll = preState.roll;
}
}
}