Jump to content

[0.90] Procedural Dynamics - Procedural Wing 0.9.3 Dec 24


DYJ

Recommended Posts

Double post because I noticed another thing. When the camera pans so the root of the wing is outside the camera's FOV, the wing disappears.

I had this problem with a mesh generator I was working on, and I'd like to spare you the trouble of going through what I did to fix it: it's caused by a mismatch between the MeshCollider of an object and the MeshRenderer. The camera is doing a thing called frustum culling, where it removes anything outside its frustum (that's the name for the camera's FOV shape). However, it's using the collider to test whether it should cull. So in the case where the render mesh is inside the camera but the collider is outside, the object stops being rendered, so you see it disappear.

There are two possible fixes:

1. Make sure the collider mesh matches the render mesh. If you do this, you can't just set MeshCollider.mesh = generatedMesh; You need to first set it to null and then assign the new mesh, which will prompt the collider to update its cache. Just assigning the new mesh won't prompt the update and nothing will change. That's unfortunately not in the documentation. Updating the cache can be slow for large meshes, but the wings seem to have fairly simple geometry, so I can't see it being an issue.

2. If you don't need a MeshCollider, don't use one. If there's no collider, I don't think the frustum culling happens, so it'll always render.

That said, I don't know how the mouse picking is working if the collider doesn't match the visuals, but that was the problem when I encountered this bug myself.

That's all. I'll take a look at the code myself and see if I can elaborate on that, but I might not get the time soon. I've worked in Unity but never modded KSP before.

EDIT: I should say I've only noticed this bug in the editor, not in gameplay.

EDIT 2: Nope, it happens in gameplay as well. It's just harder to pan the camera away from the wings during a flight.

Edited by Excrubulent
Link to comment
Share on other sites

The wings always have colliders, otherwise the mouse interactions raycast wouldn't hit anything, and the collider (like you can see by moving the mouse cursor over the wing) matches the shape of the wing somewhat closely, as the collider is a simplified version of the wing geometry that follows the same modification as the wing. I'm not sure if the frustum culling fails because the collider generates too late in the frame or if it's caused by something else entirely. Anyhow it's not a massive problem and something you could easily live with.

Better GUI stuff is something that I'd like to implement but I'll likely wait until tweakables gets some love so that's useable before starting mush more things in there.

Link to comment
Share on other sites

The wings always have colliders, otherwise the mouse interactions raycast wouldn't hit anything, and the collider (like you can see by moving the mouse cursor over the wing) matches the shape of the wing somewhat closely, as the collider is a simplified version of the wing geometry that follows the same modification as the wing. I'm not sure if the frustum culling fails because the collider generates too late in the frame or if it's caused by something else entirely.

The thing is, the mouse picking works, but at the same time, the wings will disappear if you look too far away, and this happens when no wing editing is going on. So it doesn't make sense that it has anything to do with when in the frame various things are done, because it lasts over many frames and doesn't resolve with time.

Anyway, that's a bit of a curly issue. All the best with it when you do get around to it. :)

Link to comment
Share on other sites

So having a problem with Pwings lately. For some reason my Pwings control surfaces no longer are able to be adjusted in size in some angles. I can adjust length (G-key), I can adjust the width on one side (T-key) but not on the other side (R-key) I have not touched the cfg file for pwings. I am also no longer able to adjust the root scale as I was before. Not sure what has happened?

Anyone able to help it would be appreciated.

Link to comment
Share on other sites

Hi!

Since I started using this mod long time ago I wanted to be able to change width and length of the wing root separately. I haven't updated this mod for very long time and I was very glad to see this awesome feature!

Thank you!

Link to comment
Share on other sites

Uhm, how come my wings' thickness and shape don't save? D:

I have FAR, Squad's parts, no NASAmission parts, removed them; and KER and Active Texture Management.

I also deleted the B9 p-wings. I don't like them, but did that cause it?

When I launch or save and load, the wings' shape and thickness stretch. Ples halp. :(

EDIT: It's only the AllmovingPwing and Procedural Control Surface.

Is anyone else having this issue?

EDIT2: I am also using Toolbar and ModuleManager 2.1.5. Do I need 2.1.4 for it to work? Thanks. :)

Edited by Naten
Link to comment
Share on other sites

Uhm, how come my wings' thickness and shape don't save? D:

I have FAR, Squad's parts, no NASAmission parts, removed them; and KER and Active Texture Management.

I also deleted the B9 p-wings. I don't like them, but did that cause it?

When I launch or save and load, the wings' shape and thickness stretch. Ples halp. :(

EDIT: It's only the AllmovingPwing and Procedural Control Surface.

Is anyone else having this issue?

EDIT2: I am also using Toolbar and ModuleManager 2.1.5. Do I need 2.1.4 for it to work? Thanks. :)

Do you have more than one DYJLibrary.dll file?

If so delete the extra ones. I found that the GAU-19 gun was causing my problems with P-wings and it was because of multiple DYJLibrary.dll files.

Link to comment
Share on other sites

Having issues with changing the root and tip thickness. When using symmetry it doesn't mirror the root and tip thickness properly, and instead does the thickness for both sides the same, pictured below. Any thoughts on this? It seems all other wing parts have proper symmetry, but the control surfaces, as clearly shown do not.

vOLqMFd.jpg

Link to comment
Share on other sites

I'm having some problems with this mod (Pardon me if I say mod instead of Plugin, I play minecraft) The center of lift is off to one side using the procedural wings, and yes i have symmetry on. Can someone help me on this? Otherwise, a very useful mod.

Link to comment
Share on other sites

I'm having some problems with this mod (Pardon me if I say mod instead of Plugin, I play minecraft) The center of lift is off to one side using the procedural wings, and yes i have symmetry on. Can someone help me on this? Otherwise, a very useful mod.

Once you have reshaped your wing or control surfaces, remove and reapply them to the aircraft, this will update both parts to be symmetrical and will fix your issue.

Link to comment
Share on other sites

Once you have reshaped your wing or control surfaces, remove and reapply them to the aircraft, this will update both parts to be symmetrical and will fix your issue.

I've found that I have to reattach from the right-hand side for that to work. If I reattach from the left-hand side, the parts look symmetrical, but lift is shift toward the right.

Link to comment
Share on other sites

Do you have more than one DYJLibrary.dll file?

If so delete the extra ones. I found that the GAU-19 gun was causing my problems with P-wings and it was because of multiple DYJLibrary.dll files.

Edit: FIIIXED! :D

List of DLL's in my GameData folder when I'm trying this again:

Toolbar.dll

Engineer.dll

EngineerToolbar.dll

ModuleManager.2.1.5.dll -- EDIT: Will try without it instead, because it isn't required by any of the mods IIRC.

ActiveTextureManagement.dll

FerramAerospaceResearch.dll

ferramGraph.dll

DYJlibrary.dll

RCSBuildAid.dll

RCSBuildAidToolbar.dll

-----

No part mods excluding P-Wings. Do I need MM for it to work, or can I remove it? I'll update you when my game starts. Thanks. :)

Edited by Naten
Link to comment
Share on other sites

Edit: FIIIXED! :D

List of DLL's in my GameData folder when I'm trying this again:

Toolbar.dll

Engineer.dll

EngineerToolbar.dll

ModuleManager.2.1.5.dll -- EDIT: Will try without it instead, because it isn't required by any of the mods IIRC.

ActiveTextureManagement.dll

FerramAerospaceResearch.dll

ferramGraph.dll

DYJlibrary.dll

RCSBuildAid.dll

RCSBuildAidToolbar.dll

-----

No part mods excluding P-Wings. Do I need MM for it to work, or can I remove it? I'll update you when my game starts. Thanks. :)

Module manager is kind of needed by all the mods. But check in each of your folders and see if you don't have a second DYJlibrary.dll file. I found mine in the DYJ folder with the GAU-19 gun. Once I removed that .dll it fixed everything.

Link to comment
Share on other sites

It it possible, somehow, to control R T and G actions with arrow keys or something instead the mouse movement?

It took me 2 days to accomplish the F117 bellow with wings getting moved accidentaly while adjusting new ones to make the hull.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...