pioneerspacesim/pioneer — pull request #2491 by fluffyfreak (2013-10-13 21:50:35+00:00)
Title: Shields, part deux

# WIP:
This is a work-in-progress Pull Request.
This code is probably not ready for merging yet, it needs review and some parts need discussion and probably rewriting but it's almost there.

# Description:
Mesh shields, 2nd attempt based on the aborted #2139 and feature request #2013.
This is a much simpler version, no textures, a very basic shader and as little hacking as I could manage.

# Problems:
This is subjective of course but there are parts I'm not sure I made the right choices:
* The Scenegraph manipulation - although it might be cleaner keeping specific information out of the scenegraph it did mean that I had to fettle with it from outside to create a new Group for the shield meshes, then de-parent and re-parent the StaticGeometry - it all felt a bit hacky.
* Creating the shields repeatedly - I feel like this could almost be cached, but there is some specific information (colour) for each ship so I'm not so sure, also they need to point that that instance of the mesh rather than a generic one, I think.

Functionally it all seems to be correct and working, I need to add a better way of accessing the colour, and it does still "behave" in the same way as the old shields - charging up to full power and then vanishing, but no-ones said what they'd like to see done about that so I've left it as-is.

Andy