Skip to content
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

[DragCubeGeneration] Incorrect drag cubes generated for stock fairings #162

Closed
gotmachine opened this issue Sep 12, 2023 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@gotmachine
Copy link
Contributor

gotmachine commented Sep 12, 2023

See forum report

Basically, the generated drag cubes don't account for the procedural meshes, only the fairing base, obviously causing large drag values.

This is due to my attempt at optimizing getting the part renderers by relying on the stock modelRenderersCache mechanism.

When the stock fairings are loaded, meshes are generated in SpawnMeshes(), which also update the drag cubes (AssumeClosedDragCube() > RenderProceduralDragCube()), but only after that calls ResetModelRenderersCache(), meaning we can't rely on the cache being up-to-date.

In hindsight, the likeliness of such issues is quite high, aside from this specific issue with the stock fairings code we probably can't assume that mods are correctly keeping that cache up to date. Reverting to a plain GetComponentsInChildren() call is a lot safer and the perf hit will still be much lower than what the stock code does.

@gotmachine gotmachine added the bug Something isn't working label Sep 12, 2023
@gotmachine gotmachine changed the title [DargCubeGeneration] Incorrect drag cubes generated for fairings [DragCubeGeneration] Incorrect drag cubes generated for stock fairings Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant