OpenKh icon indicating copy to clipboard operation
OpenKh copied to clipboard

Simplification of GetBonesMatrices Method.

Open Soraiko opened this issue 1 year ago • 0 comments

Simplified the GetBonesMatrices method.

NOTE: (Disregarding the old code that was taking it into account too.) In a general mathematic context, computing matrices require a recursive complexity code, the linear complexity code above is possible because a rule shared by most model skeletons says that a relative matrix is always defined before its children matrices.

Simplification does not always rhyme with reliability, but it did here. Previous code has a != comparison with two Singles, and the unnecessary use of Quaternion and Vector3 (Considering they're not reused later for loss reasons, this method is not meaning it either.) I made sure my modification was not just giving an illusion of success by setting random SRT values for bones, witnessing the graphical change with a tool using the method (OpenKh.Tools.Kh2MdlxEditor) and witnessing the correct result again by setting the correct values back.

Soraiko avatar May 08 '24 10:05 Soraiko