Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Test Builds => Topic started by: Goober5000 on December 29, 2020, 11:16:12 pm
-
TLDR: Submodels can now rotate on any axis. Model code has been optimized; model rendering and collision should now be faster. This feature, plus m!m's action system feature, will be used for the animation system upgrade after the next official release.
This is a rather substantial rewrite/refactor of the submodel rotation code. Submodel rotation is now tracked via an axis-angle representation, which is used to calculate a matrix to represent the submodel orientation in the model instance. The axis can be any vector, not limited to the standard X, Y, and Z vectors.
The submodel orientation is now used for position calculation in almost every place the submodel angles were previously used. In conjunction with the simplification of KeldorKatarn's code, this saves a significant number of calculations for every movable submodel in every frame. Hopefully this should lead to a measurable speedup in both rendering and collision detection.
To change the rotation axis of a submodel, add the $rotation_axis: property as specified in the wiki (https://wiki.hard-light.net/index.php/Subobject_and_subsystem_properties#.24rotation_axis:).
Test builds can be downloaded here (http://staff.hard-light.net/goober5000/temp/fs2_open_20_1_0_x64_AVX2-rotation_axis.7z).
-
This is very exciting. FotG will definitely be taking advantage of this to improve our s-foil rotations.
-
It just occurred to me that this will also make it possible to have turrets on rotating submodels. :pimp:
That is to say, this PR is 99% of the way there. The only thing needed is a proper field-of-view calculation.