Question

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 ?

Was it helpful?

Solution

You can reference the first entry of your vector:

... ->SetFloatVector(&normalized_direction.x);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top