We need to use the matrix provided by the higher level export code, not
the worldspace matrix. In some engine versions (MOUL), this will be
subworld space instead of worldspace.
A few observed problems:
- In PotS, any physical parented to another object fell through the
floor on link in.
- In MOUL, physicals in a subworld were exported in the wrong coordinate
system. They were exported in local-to-world space, but MOUL expects
them in local-to-subworld space.
- In PotS, any scaled physical parented to another object wiped out the
visual (but not physical) scaling due to an improper flag setting.
Translation of the rules posted by Sirius @ https://forum.guildofwriters.org/viewtopic.php?p=73757#p73757
PotS is in worldspace when the mass is non-zero. Plasma likely detects
nonzero mass as "this object can move" and expects localspace. MOUL on
the other hand uses localspace if the object has a CI, otherwise
worldspace.
This isn't the best fix in the world. We don't really know what the user
did to cause the failure because of how abstract this code is. A proper
fix would be to ensure region modifiers can't get attached to non-mesh
objects. That won't fix already "broken" stuff in blend files without
being naughty/destructive, however.
This commit includes some bonus improvements for animated parenting
situations that I discovered through sciencing the various MOUL and PotS
PRPs. Hopefully it all works as advertised.
This moves convex hull generation from the file serialization stage to
the object export stage. No longer are we dependent on spotty library
support for proper convex hulls.
To ensure that there are really, really, REALLY no race conditions related
to coordinate interfaces, we now run through all modifiers before we
export and ask them if they need to make Coordinate Interfaces. I was
hearing some comments about clickables warping around. This sounds like
physical coordinate issues to me...
- Applying scale to *all* objects in the scene is now a pre-export step.
- Make sure we always export the physical's coordinates--this matches
Plasma's behavior.
This includes changes to the light baking code to ensure that we don't
bake runtime lights. This code has several places it could be optimized in
the future when we have larger ages to test against.