Faisal
Faisal

Reputation: 623

How to convert XMFLOAT3 to const float *pData?

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 ?

Upvotes: 1

Views: 1109

Answers (1)

Nico Schertler
Nico Schertler

Reputation: 32627

You can reference the first entry of your vector:

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

Upvotes: 1

Related Questions