Celestia/Celx 指令碼/CELX Lua 方法/CEL 命令取消
外觀
cancel { }
取消goto和track命令,並將座標系重置為通用,這意味著它也會取消follow、synchronous和其他與座標系相關的命令。此命令類似於在 Celestia 的互動模式下按下 [Esc] 鍵。
該命令沒有引數。
CELX 等效項
CELX 等效項由 3 個步驟組成
- 獲取活動檢視的觀察者例項並停止任何當前正在執行的goto或center命令。
obs = celestia:getobserver() obs:cancelgoto()
- 停止跟蹤物件。
obs:track(nil)
- 建立新幀並將座標系重置為通用。
frame = celestia:newframe("universal")
obs:setframe(frame)
概述
obs = celestia:getobserver()
obs:cancelgoto()
obs:track(nil)
frame = celestia:newframe("universal")
obs:setframe(frame)
示例
此指令碼的第一部分選擇地球,轉到地球,然後執行其他命令,例如更改檢視、加快時間等等。第二部分執行取消命令,選擇火星,然後對火星執行其他命令。
CEL
select { object "Sol/Earth" }
goto { time 3 }
wait ( duration 3 }
# ...
# <other commands doing other things>
# ...
cancel { }
select { object "Sol/Mars" }
goto { time 3 }
wait { duration 3 }
# ...
# <other commands doing other things>
# ...
CELX
earth = celestia:find("Sol/Earth")
obs = celestia:getobserver()
obs:goto(earth, 3.0)
wait(3.0)
-- ...
-- <other methods doing other things>
-- ...
obs:cancelgoto()
obs:track(nil)
frame = celestia:newframe("universal")
obs:setframe(frame)
mars = celestia:find("Sol/Mars")
obs:goto(mars, 3.0)
wait(3.0)
-- ...
-- <other methods doing other things>
-- ...