Author Topic: Submodel rotation upgrade test builds  (Read 3765 times)

0 Members and 1 Guest are viewing this topic.

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Submodel rotation upgrade test builds
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.

Test builds can be downloaded here.

 

Offline wookieejedi

  • 29
  • Intensify Forward Firepower
Re: Submodel rotation upgrade test builds
This is very exciting. FotG will definitely be taking advantage of this to improve our s-foil rotations.

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: Submodel rotation upgrade test builds
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.