mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-04 11:35:06 +03:00
Added some serialization and added shader functionallity
This commit is contained in:
@@ -42,7 +42,8 @@ public:
|
||||
ImGuiHelper::DrawVec3("Rotation", &eulerDegrees);
|
||||
Vector3 eulerAnglesDelta = Vector3(glm::radians(eulerDegrees.x), glm::radians(eulerDegrees.y), glm::radians(eulerDegrees.z));
|
||||
|
||||
if (eulerAngles != eulerAnglesDelta)
|
||||
float delta = glm::length(eulerAngles - eulerAnglesDelta);
|
||||
if (delta > 0.f)
|
||||
{
|
||||
Quat rotation = QuatFromEuler(eulerAnglesDelta.x, eulerAnglesDelta.y, eulerAnglesDelta.z);
|
||||
//component.SetLocalRotation(rotation);
|
||||
|
||||
@@ -63,7 +63,6 @@ namespace Nuake
|
||||
m_World = new Physics::DynamicWorld();
|
||||
m_World->SetGravity(glm::vec3(0, -3, 0));
|
||||
|
||||
|
||||
m_IsRunning = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,6 +261,14 @@ namespace Nuake
|
||||
glUniform1iv(addr, size, value);
|
||||
}
|
||||
|
||||
void Shader::SetUniform1fv(const std::string& name, int size, float* value)
|
||||
{
|
||||
int addr = FindUniformLocation(name);
|
||||
//ASSERT(addr != -1);
|
||||
if (addr != -1)
|
||||
glUniform1fv(addr, size, value);
|
||||
}
|
||||
|
||||
void Shader::SetUniformMat3f(const std::string& name, Matrix3 mat)
|
||||
{
|
||||
int addr = FindUniformLocation(name);
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace Nuake
|
||||
void SetUniform1i(const std::string& name, int v0);
|
||||
|
||||
void SetUniform1iv(const std::string& name, int size, int* value);
|
||||
void SetUniform1fv(const std::string& name, int size, float* value);
|
||||
void SetUniformMat3f(const std::string& name, Matrix3 mat);
|
||||
void SetUniformMat4f(const std::string& name, Matrix4 mat);
|
||||
|
||||
|
||||
@@ -51,6 +51,8 @@ namespace Nuake
|
||||
SERIALIZE_OBJECT_REF_LBL("ModelComponent", GetComponent<ModelComponent>());
|
||||
if (HasComponent<BSPBrushComponent>())
|
||||
SERIALIZE_OBJECT_REF_LBL("BSPBrushComponent", GetComponent<BSPBrushComponent>());
|
||||
if (HasComponent<QuakeMapComponent>())
|
||||
SERIALIZE_OBJECT_REF_LBL("QuakeMapComponent", GetComponent<QuakeMapComponent>());
|
||||
END_SERIALIZE();
|
||||
}
|
||||
|
||||
|
||||
@@ -346,7 +346,7 @@ namespace Nuake {
|
||||
CopyComponent<ModelComponent>(sceneCopy->m_Registry, this->m_Registry);
|
||||
CopyComponent<CameraComponent>(sceneCopy->m_Registry, this->m_Registry);
|
||||
CopyComponent<WrenScriptComponent>(sceneCopy->m_Registry, this->m_Registry);
|
||||
|
||||
CopyComponent<QuakeMapComponent>(sceneCopy->m_Registry, this->m_Registry);
|
||||
return sceneCopy;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user