Last active
August 3, 2021 13:45
-
-
Save RevoluPowered/eabcbb9d2e832f5b11afbe04fc406661 to your computer and use it in GitHub Desktop.
something.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this is the old code | |
const float *v = (const float *)&r[j * total_elem_size + offsets[i]]; | |
w[j] = Vector3(v[0], v[1], v[2]); | |
// this is the replacement (has correct alignment) | |
float x = (float)r[j*total_elem_size*offsets[i]]; | |
float y = (float)r[j*total_elem_size*offsets[i]+1]; | |
float z = (float)r[j*total_elem_size*offsets[i]+2]; | |
w[j] = Vector3(x,y,z); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment