pioneerspacesim/pioneer — pull request #2080 by Luomu (2013-02-17 04:00:22+00:00)
Title: Navigation lights for ships & stations

This task has been kicking my ass, I still have not figured out what a good design is. But here's one version.

Doing too much light logic in SceneGraph::Loader is not good, so now it only creates empty nodes and someone else (NavLights) is responsible for creating lights from those points.

Recognized light names are navlight_red, navlight_green, navlight_padN and navlight_whatever (for default). Ships and stations have preset patterns, it would be possible to do slightly more complicated sequences but it's not very nice trying to detect everything from node names.

Ships: red and green lights blink alternatingly, white (or blueish) lights don't blink. I thought it was visually more interesting than aircraft style lights. Lights appear only when landing gear is down.

Stations: lights are grouped by pad number and they blink. Green when free, red when occupied and yellow when reserved.

The light sprites are scaled so they are visible from longer distances. I think it looks better, if not entirely satisfying.

I want to allow configuring the light patterns either in .model files or .ship/.station definitions (can't decide which is more appropriate), with something like this:

lightgroup index color period
light node_name1 group pattern
light node_name2 group pattern...

Which would allow more flexibility. I am also heavily wondering if it would be less trouble to not render the lights using the model system. Less headache with instancing and not having to do everything with magic node names. The models would be only used for supplying the positions. Kinda same feelings for thrusters and co.