Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ModelClass::UpdateObject(bool Render,bool InsideTexturing, ID3D11Device *device, std::string ID, XMFLOAT3 position, XMFLOAT3 rotation, XMFLOAT3 scale, char* ObjectDataLocation, LPCWSTR texture, int PixelShaderNumber, int VertexShaderNumber)
- {
- XMFLOAT3 test, test1;
- ID3D11ShaderResourceView *m_texture;
- for (int i = 0; i < ObjectDatas.size(); i++)
- {
- if (ObjectDatas[i].ID == ID)
- {
- if (ObjectDatas[i].pos.x != position.x && ObjectDatas[i].pos.y != position.y && ObjectDatas[i].pos.z != position.z)
- {
- ObjectDatas[i].pos = position;
- }
- if (ObjectDatas[i].rotation.x != rotation.x && ObjectDatas[i].rotation.y != rotation.y && ObjectDatas[i].rotation.z != rotation.z)
- {
- ObjectDatas[i].rotation = rotation;
- }
- if (ObjectDatas[i].scale.x != scale.x && ObjectDatas[i].scale.y != scale.y && ObjectDatas[i].scale.z != scale.z)
- {
- ObjectDatas[i].scale = scale;
- }
- if (ObjectDatas[i].ObjectDataLocation != ObjectDataLocation)
- {
- ObjectDatas[i].ObjectDataLocation = ObjectDataLocation;
- }
- if (ObjectDatas[i].Render != Render)
- {
- ObjectDatas[i].Render = Render;
- }
- if (ObjectDatas[i].InsideTexturing != InsideTexturing)
- {
- ObjectDatas[i].InsideTexturing = InsideTexturing;
- }
- if (ObjectDatas[i].PixelShaderNumber != PixelShaderNumber)
- {
- ObjectDatas[i].PixelShaderNumber = PixelShaderNumber;
- }
- if (ObjectDatas[i].VertexShaderNumber != VertexShaderNumber)
- {
- ObjectDatas[i].VertexShaderNumber = VertexShaderNumber;
- }
- if (ObjectDatas[i].texturelocation != texture)
- {
- D3DX11CreateShaderResourceViewFromFile(device, texture, NULL, NULL, &m_texture, NULL);
- ObjectDatas[ArrayCount].texture = m_texture;
- m_texture = NULL;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement