Tracking Solar Panels -- Add 'lock' and manual set of rotation capability.
shadowmage45 opened this issue ยท 1 comments
To allow for deployable/tracking solar panels to be used in places where the tracking would be prohibitive, and/or for replica-style use of some panels.
Needs to persist the 'user selected rotation'/offset for each of main and secondary transforms (2 fields).
Does it need to persist actual/live rotation values? -- much easier to say that when 'lock' is enabled, it forces the lerp-target to the user-specified value, ignoring existing rotation.
Needed to implement:
- Add a boolean toggle to enable user-locked rotation or standard sun-tracking.
- Add a single persistent float value to module to track 'user rotation'.
- Add a persistent string to track per-panel persistent rotations; restore these rotations upon game reload. This will be a CSV/semi-colon delimited storage of each panels' local-orientation quaternions.
- Save current rotation state during OnSave() calls.
- Restore previous animation state (if any) during OnLoad() / OnStart() / initialize() calls.
- Remove 'secondary pivot' code.
- Rework all solar-panel module configs to use only main pivot name entry.
- Rework code to allow for use in 'non-tracking' setups. Deprecate/replace the static solar panel module.
- Rework code to use sub-node based definitions. Track 'lock offset' and 'invert manual rotation' on a per-pivot basis.
- Rework configs to use sub-node based pivot/suncatcher defs.
- Add capability to specify suncatchers to use the orientation of the closest pivot (in hierarchy), with the position of the suncatcher (solves issues of NF-solar arbitrarily rotated suncatcher transforms).
Needs Testing:
- Restoration of rotations on vessel reload.
- Updating of rotation on free/tracking panels
- Updating of rotation on locked panels