Template function fixes and left-handedness consistency#46
Conversation
…romWXYZ() instead
… in box::distance() but not defined in vector.h
…ded coordinate system
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
| template <typename T, int n> | ||
| T distance(vector<T, n> const & a, vector<T, n> const & b) | ||
| { return length(a-b); } | ||
|
|
There was a problem hiding this comment.
this is redundant with the length functions - please remove
There was a problem hiding this comment.
should I update box3::distance to use float3::length instead?
There was a problem hiding this comment.
yes please - good catch
i don't think these functions have been used in a long time (or the donut samples) has this change been tested and is working in both Vk and D3D ? |
I've tested my application and the FeatureDemo with both Vk and D3D and they work as expected! |
…nstead of float3::distance
|
right - but neither use this code path because they do not toggle between orbit / fps modes i take it that your app is left-handed only ? (D3D ?) donut needs to be both IIRC |
I believe the feature demo does toggle between the two.
|
|
i stand corrected : feature demo does use it with the 'T' button switch if your change works for both Vk & D3D when toggling, then all good (for some reason feature demo crashes on launch for me, so i can't test on my end right now) |
|
Seems to work on both backends for me. I had to change the path of the glTF sample assets in order for it to run I think. And I am specifically using |
|
If it makes it easier to merge the other changes, I can undo the changes to |
rotationQuatinquat.hused an undefined constructor, template was edited to use thefromWXYZfunction insteaddistanceanddistanceSquareddefined invector.h.dm::box3::distancecallsdm::float3::distancebut template is not defined for vector.dm::box3::distancenow callsdm::float3::lengthinsteaddm::box3::operator*=has a const qualifier even though *= is modifying the internals, and is now removedFirstPersonCamera::LookToin application would flicker camera when updating position or direction of camera with keyboard/mouse because the wrong basis vectors are updated with translation and roll/pitch/yaw