-
-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separate shield meshes from ship models #5840
Separate shield meshes from ship models #5840
Conversation
When should we do the final bug-fix release? |
Soon. I'm going through the issue list today and tomorrow to see if there are any other quick fixes we need to get in before we cut a release. |
Okay,will do. I can't get to it for at least a couple of weeks unfortunately though. |
- It's the responsibility of the owning tool context to make changes to the model's structure if desired.
- The shield geometry node would contain a missing parent pointer due to violation of the single-parent constraint - Can remove MatrixAccumVisitor due to new MatrixTransform::CalcGlobalTransform method
- StaticGeometry nodes are shared between instances of the same model, which breaks Shield material handling code - The actual mesh and material assignments are still shared via RefCountedPtr, but the list of meshes and the StaticGeometry node has to be duplicated to support individual instances having unique material assignments as used for shield rendering.
Preperatory cleanup for separating shield and ship models
- Used for specifying separate shield model to be loaded when creating the ship. - Exposed to Lua as shipDef.shieldModelName.
- Shorthand for constructing a 4x4 matrix from the render interpolated position+orientation of the body. - Avoids bug potential from reconstructing the interpolated transform in callsites that require the full matrix.
- Move shield component from ModelBody (seriously?) to Ship where it belongs - Temporary fallback to ship-model based shields when no separate shield model can be loaded - Requires savegamebump as shield data is no longer saved in ModelBody JSON object
- Attempt to determine whether we're viewing a ship model or not - If separate shield model is defined and available, load and display it along with the main ship model
- All shield meshes are expected to come from an external shield model; loading shield meshes from ship models is no longer supported. - Shields class is now usable as a BodyComponent - Shield meshes are loaded after component initialization, rather than at creation. - Better support for an initialized Shields component without shield meshes to render - Updated callsites to new Shields API
- Disable unused-include warning for JsonUtils.h
40efeb3
to
0d81678
Compare
Merging this - have given it local testing through development and pushed documentation related to the new shield model workflow to the dev docs repository. |
Per discussion on IRC from quite a while ago, this PR implements the technical changes necessary to support ship shields being loaded from a separate SGM file and rendered as a separate entity. This solves some long-standing technical debt related to the very invasive process needed to prepare shields for rendering under the old architecture and opens the door to a more efficient architecture for the scenegraph system as a whole.
I've also removed the old Lua-based ship loading code, as we have not compiled with that code enabled in at least five years and it has been thoroughly deprecated at this point.
This PR also fixes a bug present in master (and likely present in many past releases) where the player's shields would not be visible when the player's ship is hit by projectiles or collides with objects.
CC @bszlrd as this PR should include or be closely followed by a set of changes separating shield meshes into their own models for all ships currently present in the game. I'm leaving the fallback path in this PR until we're ready to migrate all shields, but I'd like the old method to be completely removed before merge.
As this PR requires a savegame bump, it will not be merged until after we have released the accumulated set of hotfixes from the last few months.