nicklockwood / Euclid

A Swift library for creating and manipulating 3D geometry
MIT License
644 stars 53 forks source link

Add normalized vectors representing each axis of the rotation transform #43

Closed zilmarinen closed 3 years ago

zilmarinen commented 3 years ago

This PR adds three computed vars to Transform to return normalized vectors representing each axis of the transform.

Perhaps this should be provided with local/world space vars or moved into the Rotation struct instead and accessed via the transform indirectly?

codecov-commenter commented 3 years ago

Codecov Report

Merging #43 (684cae9) into develop (7dfcf4a) will decrease coverage by 0.03%. The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #43      +/-   ##
===========================================
- Coverage    76.70%   76.66%   -0.04%     
===========================================
  Files           35       35              
  Lines         5825     5828       +3     
===========================================
  Hits          4468     4468              
- Misses        1357     1360       +3     
Impacted Files Coverage Δ
Sources/Transforms.swift 32.64% <0.00%> (-0.41%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7dfcf4a...684cae9. Read the comment docs.

nicklockwood commented 3 years ago

Seems reasonable, but yes, these should probably be defined on the Rotation type directly.

zilmarinen commented 3 years ago

Updated to expose these properties from Rotation Instead and added a simple identity test case.