Bug fixes and tuning.
This commit is contained in:
parent
ae235821b0
commit
0481123487
|
@ -44,22 +44,23 @@ function Hover {
|
|||
}
|
||||
|
||||
function alignForHover {
|
||||
set cRot to SHIP:FACING:FOREVECTOR.
|
||||
if ReadSensor("PRES") = 0 {
|
||||
// if we're in a vacuum, align with retrograde for smoother horizontal control.
|
||||
lock STEERING to LookDirUp(SHIP:SRFRETROGRADE:FOREVECTOR, SHIP:FACING:TOPVECTOR)..
|
||||
lock STEERING to LookDirUp(SHIP:SRFRETROGRADE:FOREVECTOR, cRot).
|
||||
print "Aligning with retrograde.".
|
||||
wait until done or VAng(SHIP:FACING:FOREVECTOR, SHIP:SRFRETROGRADE:FOREVECTOR) < 0.1.
|
||||
wait until done or VAng(SHIP:FACING:FOREVECTOR, SHIP:SRFRETROGRADE:FOREVECTOR) < 1.
|
||||
if done {
|
||||
restoreControls().
|
||||
restoreControl().
|
||||
return.
|
||||
}
|
||||
} else {
|
||||
// ... otherwise just align vertically.
|
||||
lock STEERING to LookDirUp(SHIP:UP:FOREVECTOR, SHIP:FACING:TOPVECTOR)..
|
||||
lock STEERING to LookDirUp(SHIP:UP:FOREVECTOR, cRot).
|
||||
print "Aligning vertical.".
|
||||
wait until done or VAng(SHIP:FACING:FOREVECTOR, SHIP:UP:FOREVECTOR) < 1.
|
||||
if done {
|
||||
restoreControls().
|
||||
restoreControl().
|
||||
return.
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user