Merge remote-tracking branch 'origin/master' into deffered_rendering
This commit is contained in:
+1
-1
@@ -167,7 +167,7 @@ void Renderer::DrawSkybox()
|
|||||||
|
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
m_ShaderProgramSkybox.Bind();
|
m_ShaderProgramSkybox.Bind();
|
||||||
glm::mat4 cameraMatrix = m_Camera->ProjectionMatrix() * glm::toMat4(m_Camera->Orientation());
|
glm::mat4 cameraMatrix = m_Camera->ProjectionMatrix() * glm::toMat4(glm::inverse(m_Camera->Orientation()));
|
||||||
glUniformMatrix4fv(glGetUniformLocation(m_ShaderProgramSkybox.GetHandle(), "MVP"), 1, GL_FALSE, glm::value_ptr(cameraMatrix));
|
glUniformMatrix4fv(glGetUniformLocation(m_ShaderProgramSkybox.GetHandle(), "MVP"), 1, GL_FALSE, glm::value_ptr(cameraMatrix));
|
||||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||||
m_Skybox->Draw();
|
m_Skybox->Draw();
|
||||||
|
|||||||
+10
-1
@@ -138,7 +138,16 @@ std::shared_ptr<T> World::AddComponent(EntityID entity, std::string componentTyp
|
|||||||
template <class T>
|
template <class T>
|
||||||
T* World::GetComponent(EntityID entity, std::string componentType)
|
T* World::GetComponent(EntityID entity, std::string componentType)
|
||||||
{
|
{
|
||||||
return (T*)m_EntityComponents[entity][componentType].get();
|
auto components = m_EntityComponents[entity];
|
||||||
|
auto it = components.find(componentType);
|
||||||
|
if (it != components.end())
|
||||||
|
{
|
||||||
|
return static_cast<T*>(it->second.get());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // World_h__
|
#endif // World_h__
|
||||||
Reference in New Issue
Block a user