Skip to content

Lab Weapon Viewer #6704

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

MjnMixael
Copy link
Contributor

@MjnMixael MjnMixael commented May 1, 2025

Activates the F3 Lab's weapon viewer mode. Outside of the lab-specific code there's a few changes worth mentioning here as I expect them to come up during review:

OBJ_RAW_POF is a new object type specifically designed for rendering a model file as an Object. The reasoning is because the only other way to do it would be to hack in a placeholder Ship_info, Weapon_info, or Asteroid_info class with dummy values just so the associated model rendering method would be able to pass all the usual checks for those object types. With this we do a straight render call of the POF without any of the other junk and no hacks to make it work. These objects have no collisions and no ai. There is potential to expand this to other useful applications in the future.

Weapon life is reset every frame unless a specific toggle is activated so that weapons don't destroy themselves. This required a slight little hack to make work for Targeting Beams.

There are a couple places in beam.cpp where I added checks for a floating and targeting beam. Normal_fire beams is one of them. I'm not 100% sure if those checks are valid. They seem to be but if not I can change them to a direct game state check instead just to get those beams working for the Lab specifically.

Rendering Flags have been added to Weapons and the new Raw Pof objects so that the render options menu in the Lab works correctly for all object types. There is some duplication of flags here now across Ship, Weapons, and Raw. The bloat isn't ideal and I did look into merging them all into an Object->render_flags Flagset member but that would take a significant number of changes for Ships specifically. It's doable, and preferable even, but given the scope of the change should be its own separate PR. So for now I've opted for Weapons and Raw to follow the styling of Ships.

@wookieejedi wookieejedi added enhancement A new feature or upgrade of an existing feature to add additional functionality. Lab A feature or bug related to the F3 lab labels May 1, 2025
@MjnMixael MjnMixael added this to the Release 25.0 milestone May 2, 2025
@MjnMixael MjnMixael mentioned this pull request May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A new feature or upgrade of an existing feature to add additional functionality. Lab A feature or bug related to the F3 lab
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants