recp / cglm

📽 Highly Optimized 2D / 3D Graphics Math (glm) for C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Axis/Direction Normalization

gottfriedleibniz opened this issue · comments

In certain places through this library, I've noticed the branching from the internal/implicit normalization can cause a pretty big hit in otherwise pipeline-friendly code. For example:

I was wondering if (A) anybody else has experienced/measured this; and (B) would it be possible to introduce functions (or something else, e.g., a build option) that assume these 'axis' or 'direction' parameters are already normalized.

Edit: Clarity.

would it be possible to introduce functions (or something else, e.g., a build option) that assume these 'axis' or 'direction' parameters are already normalized.

Actually that would be nice, if passed axis and direction are already unit / normalized that would be redundant and extra overhead to normalize them again :(

Any suggestions? Maybe we could provide alternative functions plus build configuration to change existing behavior if it is desired

Any suggestions?

Breaking backwards compatibility :). Otherwise, what you suggest seems fine.