How to convert XMFLOAT3 to const float *pData?

1k Views Asked by At

I have the following code:

XMFLOAT3 normalized_direction = XMVector3Normalize(direction);
pEffect->GetVariableByName("g_CameraDirection")->AsVector()->SetFloatVector(normalized_direction);

I want to pass XMFLOAT3 in const float *pData ?

1

There are 1 best solutions below

3
On BEST ANSWER

You can reference the first entry of your vector:

... ->SetFloatVector(&normalized_direction.x);