|
发表于 2004-11-20 10:34:31
|
显示全部楼层
<P>再cockpit.lua中</P><P>-- Copyright (C) 2004, Eagle Dynamics.
-- Cockpit view scripts (F1, Ctrl-F1, Alt-F1)
-- Uses SnapViews.lua and Serialize.lua</P><P>CockpitMouse = false
CockpitMouseSpeedSlow = 1.0
CockpitMouseSpeedNormal = 10.0
CockpitMouseSpeedFast = 20.0
CockpitKeyboardAccelerationSlow = 5.0
CockpitKeyboardAccelerationNormal = 30.0
CockpitKeyboardAccelerationFast = 80.0
CockpitViewAngleMin = 20.0
CockpitViewAngleMax = 120.0
-- If CockpitViewAngleDefault is not set here then option value is used
-- Remove comment "--" in the next line and set your custom value:
--CockpitViewAngleDefault = 60.0
CockpitKeyboardZoomAcceleration = 300.0
DisableSnapViewsSaving = true
UseDefaultSnapViews = false
CockpitPanStepHor = 45.0
CockpitPanStepVert = 30.0
CockpitNyMove = true
CockpitHAngleOrigin = 0.0
CockpitVAngleOrigin = -9.5
CockpitHAngleAccelerateTimeMax = 0.15
CockpitVAngleAccelerateTimeMax = 0.15
CockpitZoomAccelerateTimeMax = 0.2
HAngleMaxDefault = 180.0
VAngleMinDefault = -65.0
VAngleMaxDefault = 115.0
HAngleMaxSu25 = 180.0
VAngleMinSu25 = -65.0
VAngleMaxSu25 = 115.0
HAngleMaxF15 = 180.0
VAngleMinF15 = -65.0
VAngleMaxF15 = 115.0</P><P>
CockpitLocalPoint = {}
CockpitLocalPoint[PlaneIndex.iSu_27] = {8.05, 1.35, 0.0}
CockpitLocalPoint[PlaneIndex.iSu_33] = {8.35, 1.35, 0.0}
CockpitLocalPoint[PlaneIndex.iSu_25] = {3.0, 0.276, 0.0}
CockpitLocalPoint[PlaneIndex.iSu_39] = {3.0, 0.276, 0.0}
CockpitLocalPoint[PlaneIndex.iMiG_29] = {4.76, 1.284, 0.0}
CockpitLocalPoint[PlaneIndex.iMiG_29K] = {4.9, 1.254, 0.0}
CockpitLocalPoint[PlaneIndex.iA_10] = {3.991, 1.507, 0.0}
CockpitLocalPoint[PlaneIndex.iF_15] = {6.4, 1.218, 0.0}</P><P>function GetCockpitLocalPoint(iType)
local p = CockpitLocalPoint[iType]
return p[1], p[2], p[3]
end</P><P>function NaturalHeadMoving(tang, roll, omz)
local r = roll
if r > 90.0 then
r = 180.0 - r
elseif roll < -90.0 then
r = -180.0 - r
end
local hAngle = -0.25 * r
local vAngle = math.min(math.max(0.0, 0.4 * tang + 45.0 * omz), 90.0)
return hAngle, vAngle
end</P><P>function GetSnapAngles(iPlane, iKey)
local s = Snap[iPlane][iKey]
return s.hAngle, s.vAngle, s.viewAngle
end</P><P>function SetSnapAngles(iPlane, iKey, hAngle, vAngle, viewAngle)
local s = Snap[iPlane][iKey]
s.hAngle = hAngle
s.vAngle = vAngle
s.viewAngle = viewAngle
end</P><P>function WriteSnapViews(fileName)
local file = io.open(fileName, "w")
if file then
io.output(file)
local t = {}
Serialize("Snap", Snap, t)
io.close(file)
end
end</P><P>function ReadSnapViews(fileName)
dofile(fileName)
end
</P> |
|