mardi 24 mars 2015

Access Violation using XMMatrix and std::vector

I'm currently having a problem in my project where I'm trying to get a Dx11 running.


My error is: Unhandled exception at 0x00FC266D in 3DTestProject.exe: 0xC0000005: Access violation reading location 0x00000000.


The Crash Occurs in my Model.cpp IN Model::Render() at this line:

cb.mWorld = DirectX::XMMatrixTranspose(aOrientation);


Because of the implementation I have to send it as a const reference in Render()



const DirectX::XMMATRIX& aOrientation


Called from Instance

m_pModel->Update();


My header for Instance looks like this:



class Instance
{
public:
Instance();
Instance(Model* aModel);
~Instance();

void Update();
void Render(Camera* aCamera);

private:

DirectX::XMMATRIX m_Orientation;
};


My guess is it is because I store my instances in Scene.h as a std::vector and I don't know how to solve it.



std::vector<Instance> m_vecInstances;

Aucun commentaire:

Enregistrer un commentaire