I'm using DirectXMath.h and included the name space DirectX inside my lib.
When the camera updates it keeps going into this Access Violation Reading Location At -- on this line:
cameraRotationMatrix = XMMatrixRotationRollPitchYaw(cameraPitch, cameraYaw, 0);
cameraEye = XMVector3TransformCoord(defaultForward, cameraRotationMatrix); //-- ACCESS VIOLATION READING EXCEPTION!
cameraEye = XMVector3Normalize(cameraEye);
For the compile settings I set it to use SSE2 architecture and fp:precise. I read the MSDN and it said use DiretX:XMMATRIX and DirectX:XMVECTOR if you guarenteed it is 16 bit aligned or exceptions will occur at run time.
when the camera class is constructed I have this:
camera::camera() {
defaultRight = XMVectorSet(1.0f, 0.0f, 0.0f, 0.0f);
defaultForward = XMVectorSet(0.0f, 0.0f, 1.0f, 0.0f);
cameraRight = XMVectorSet(1.0f, 0.0f, 0.0f, 0.0f);
cameraForward = XMVectorSet(0.0f, 0.0f, 1.0f, 0.0f);
cameraYaw = 0.0f;
cameraPitch = 0.0f;
moveLeftRight = 0.0f;
moveForwardBack = 0.0f;
}
Sometimes it runs and sometimes it will cause the exception. How should I go about fixing this?