Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ModelClass::UpdateObjectTransformations(const std::string ID, XMFLOAT3 pos, XMFLOAT3 rotation, XMFLOAT3 scale)
- {
- for (int i = 0; i < ObjectDatas.size(); i++)
- {
- if (ObjectDatas[i].ID == ID)
- {
- if (ObjectDatas[i].pos.x != pos.x || ObjectDatas[i].pos.y != pos.y || ObjectDatas[i].pos.z != pos.z)
- {
- ObjectDatas[i].pos = pos;
- }
- 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;
- }
- }
- }
- }
- void ModelClass::UpdateObjectResources(const std::string ID, char* ObjectDataLocation, LPCWSTR texturelocation)
- {
- ID3D11ShaderResourceView *m_texture;
- for (int i = 0; i < ObjectDatas.size(); i++)
- {
- if (ObjectDatas[i].ID == ID)
- {
- if (ObjectDatas[i].ObjectDataLocation != ObjectDataLocation)
- {
- ObjectDatas[i].ObjectDataLocation = ObjectDataLocation;
- }
- if (ObjectDatas[i].texturelocation != texturelocation)
- {
- D3DX11CreateShaderResourceViewFromFile(m_graphicsClass->m_D3D->GetDevice(), texturelocation, NULL, NULL, &m_texture, NULL);
- ObjectDatas[ArrayCount].texture = m_texture;
- m_texture = NULL;
- }
- }
- }
- }
- void ModelClass::UpdateObjectSettings(const std::string ID, bool Render, int PixelShaderNumber, int VertexShaderNumber, bool InsideTexturing)
- {
- for (int i = 0; i < ObjectDatas.size(); i++)
- {
- if (ObjectDatas[i].ID == ID)
- {
- 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;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement