Skip to content

Allow submodels to rotate around an arbitrary axis#3056

Merged
Goober5000 merged 4 commits into
scp-fs2open:masterfrom
Goober5000:model_rotation_arbitrary_axis
Jan 31, 2021
Merged

Allow submodels to rotate around an arbitrary axis#3056
Goober5000 merged 4 commits into
scp-fs2open:masterfrom
Goober5000:model_rotation_arbitrary_axis

Conversation

@Goober5000

@Goober5000 Goober5000 commented Dec 30, 2020

Copy link
Copy Markdown
Contributor

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 unit 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.

@Goober5000 Goober5000 added enhancement A new feature or upgrade of an existing feature to add additional functionality. cleanup A modification or rewrite of code to make it more understandable or easier to maintain. labels Dec 30, 2020
@Goober5000 Goober5000 force-pushed the model_rotation_arbitrary_axis branch from 8f2ad72 to 420dca3 Compare December 30, 2020 06:17
@Goober5000 Goober5000 added the Waiting for Stable Marks a pull request that is to be merged after the next stable release, due to a release cycle label Dec 31, 2020
@Goober5000 Goober5000 force-pushed the model_rotation_arbitrary_axis branch from 420dca3 to ed6d666 Compare January 2, 2021 20:14
@Goober5000 Goober5000 added this to the Release 21.2 milestone Jan 7, 2021
@Goober5000 Goober5000 force-pushed the model_rotation_arbitrary_axis branch from 76b13f9 to 606873a Compare January 13, 2021 16:59
@Goober5000 Goober5000 force-pushed the model_rotation_arbitrary_axis branch from 606873a to 487aad8 Compare January 13, 2021 19:01
@Goober5000 Goober5000 added the models Issues or features having to do with model data (like animations or geometry) label Jan 13, 2021
@Goober5000 Goober5000 mentioned this pull request Jan 14, 2021
@Goober5000 Goober5000 marked this pull request as ready for review January 27, 2021 17:40
@Goober5000 Goober5000 requested a review from asarium as a code owner January 27, 2021 17:40
@Goober5000 Goober5000 removed the Waiting for Stable Marks a pull request that is to be merged after the next stable release, due to a release cycle label Jan 27, 2021

@Baezon Baezon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty involved obviously, but if it tests well, then it looks alright to me. Let's leave it open for a bit longer in case anyone else wants to chip in, but definitely don't want to leave this hanging forever.

@Goober5000 Goober5000 merged commit 8687158 into scp-fs2open:master Jan 31, 2021
@Goober5000 Goober5000 deleted the model_rotation_arbitrary_axis branch January 31, 2021 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup A modification or rewrite of code to make it more understandable or easier to maintain. enhancement A new feature or upgrade of an existing feature to add additional functionality. models Issues or features having to do with model data (like animations or geometry)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants