Celestia/Celx Scripting/CELX Lua Methods/CEL command chase

< Celestia < Celx Scripting < CELX Lua Methods

chase

chase { }

Tells Celestia to set the active Coordinate System to chase, which chases the currently selected object through space.

The command has no arguments.


CELX equivalent-1:

Based on the observer:setframe() method.

objectname = celestia:find( <string> )
frame = celestia:newframe("chase", objectname)
obs = celestia:getobserver()
obs:setframe(frame)

Summarized:

objectname = celestia:find( <string> )
frame = celestia:newframe("chase", objectname)
obs = celestia:getobserver()
obs:setframe(frame)


CELX equivalent-2:

Based on the observer:chase() method.

objectname = celestia:find( <string> )
obs = celestia:getobserver()
obs:chase(objectname)

Summarized:

objectname = celestia:find( <string> )
obs = celestia:getobserver()
obs:chase(objectname)

Example:

The following example selects the Moon, sets the Coordinate System to chase, and then goes to the Moon:

CEL:

select { object "Sol/Earth/Moon" }
chase  { }
goto   { time 2 }
wait   { duration 2 }

CELX-1 with observer:setframe() method:

moon = celestia:find("Sol/Earth/Moon")
celestia:select(moon)
frame = celestia:newframe("chase", moon)
obs = celestia:getobserver()
obs:setframe(frame)
obs:goto(moon, 2.0)
wait(2.0)

CELX-2 with observer:chase() method:

moon = celestia:find("Sol/Earth/Moon")
celestia:select(moon)
obs = celestia:getobserver()
obs:chase(moon)
obs:goto(moon, 2.0)
wait(2.0)

Back to CEL command index

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.