I am using sse math vector3.
Typically, I set the fourth digit of my vector to 1.0f, as this does most of my math work, but sometimes I need to set it to 0.0f.
So I want to change something like: (32,4f, 21,2f, -4,0f, 1,0f) to (32,4f, 21,2f, -4,0f, 0,0f)
I was wondering what is the best way to do this:
- Convert to 4 floats, set the 4th float, send back to SSE
- xor register with itself, then do 2 shufps
- Do all the SSE math with 1.0f, and then set the variables to what they should be when you're done.
- Other?
Note: the vector is already in the SSE register when I need to change it.
Pubby source
share