Closed Barsonax closed 6 years ago
Simplified tests and Transform implementation a bit, made some minor code style adjustments, handled serialization and cloning for the new field and used it to optimize some more Transform methods and properties.
Still need to test some more real-world cases before merging.
There is still room for optimization in UpdateAbs. It currently calls MathF.GetTransformDotVec here which builds up a rotationmatrix and it also calls UpdateRotationDirAbs here which updates the rotationDir. This is a duplicate sin/cos operation I believe.
EDIT: It builds a rotationmatrix using the parents angle! Thats still a duplicate sin/cos operation though.
There is still room for optimization in UpdateAbs. It currently calls MathF.GetTransformDotVec here which builds up a rotationmatrix and it also calls UpdateRotationDirAbs here which updates the rotationDir. This is a duplicate sin/cos operation I believe.
Nice find 👍 Will take care of it, still have the code open for testing anyway.
Will take a look at this later, but might take a bit longer than usually for a PR of this size. This is a
master
commit on theTransform
component after all, so we need to make sure there's absolutely no added bug potential in there.