Removed unused code

This commit is contained in:
Antoine Pilote
2023-07-19 00:31:39 -04:00
parent 4e4d203666
commit c3f740883d
4 changed files with 9 additions and 137 deletions

View File

@@ -121,7 +121,6 @@ namespace Nuake
{
auto window = Window::Get()->GetHandle();
auto state = glfwGetMouseButton(window, button);
return state == GLFW_RELEASE && m_MouseButtons[button] == true;
}

View File

@@ -29,38 +29,6 @@ namespace Nuake
{
PhysicsManager::Get().GetWorld()->MoveAndSlideCharacterController(Owner, velocity);
}
void CharacterController::ParseGhostContacts()
{
}
void CharacterController::UpdatePosition()
{
}
void CharacterController::UpdateVelocity()
{
// Decelerate
//m_manualVelocity -= m_manualVelocity * m_deceleration * m_pPhysicsWorld->GetScene()->m_frameTimer.GetTimeMultiplier();
if (m_hittingWall)
{
for (size_t i = 0, size = m_surfaceHitNormals.size(); i < size; i++)
{
// Cancel velocity across normal
glm::vec3 velInNormalDir(glm::reflect(m_manualVelocity, m_surfaceHitNormals[i]));
// Apply correction
m_manualVelocity -= velInNormalDir * 1.05f;
}
// Do not adjust rigid body velocity manually (so bodies can still be pushed by character)
return;
}
}
}
}

View File

@@ -42,11 +42,6 @@ namespace Nuake
{
return IsOnGround;
}
private:
void ParseGhostContacts();
void UpdatePosition();
void UpdateVelocity();
};
}
}

View File

@@ -7,25 +7,13 @@
#include "src/Core/Core.h"
#include <src/Scene/Entities/ImGuiHelper.h>
namespace Nuake {
LightComponent::LightComponent()
namespace Nuake
{
LightComponent::LightComponent() :
Color(1, 1, 1),
Strength(10.0f),
Direction(0, 1, 0)
{
Color = glm::vec3(1, 1, 1);
Strength = 10.0f;
Direction = glm::vec3(0, -1, 0);
//m_Framebuffers = std::vector<Ref<FrameBuffer>>();
//mViewProjections = std::vector<glm::mat4>();
//mCascadeSplitDepth = std::vector<float>();
//mCascadeSplits = std::vector<float>();
// Framebuffer used for shadow mapping.
//for (int i = 0; i < 4; i++)
//{
// m_Framebuffers[i] = CreateRef<FrameBuffer>(false, glm::vec2(4096, 4096));
// m_Framebuffers[i]->SetTexture(CreateRef<Texture>(glm::vec2(4096, 4096), GL_DEPTH_COMPONENT), GL_DEPTH_ATTACHMENT);
//}
}
void LightComponent::SetCastShadows(bool toggle)
@@ -42,7 +30,8 @@ namespace Nuake {
}
}
else {
else
{
for (int i = 0; i < CSM_AMOUNT; i++)
{
m_Framebuffers[i] = nullptr;
@@ -55,87 +44,8 @@ namespace Nuake {
return glm::ortho(-25.0f, 25.0f, -25.0f, 25.0f, -25.0f, 25.0f);
}
void LightComponent::SetDirection(glm::vec3 dir)
Vector3 LightComponent::GetDirection()
{
}
glm::vec3 LightComponent::GetDirection()
{
//glm::mat4 start = glm::mat4(1.0f);
//glm::vec3 defaultDirection(0, 0, 1); // forward
//
//start = glm::rotate(start, glm::radians(Direction.x), glm::vec3(1, 0, 0));
//start = glm::rotate(start, glm::radians(Direction.y), glm::vec3(0, 1, 0));
//start = glm::rotate(start, glm::radians(Direction.z), glm::vec3(0, 0, 1));
//return glm::vec3(start * glm::vec4(defaultDirection, 1.0f));
return glm::normalize(Direction);
}
void LightComponent::BeginDrawShadow()
{
Renderer::m_ShadowmapShader->Bind();
//m_Framebuffer->Bind();
// Render scene...
}
void LightComponent::EndDrawShadow()
{
//m_Framebuffer->Unbind();
}
void LightComponent::DrawShadow()
{
if (Type != Directional)
return;
Renderer::m_ShadowmapShader->Bind();
}
void LightComponent::DrawEditor() {
ImGui::TextColored(ImGui::GetStyleColorVec4(1), "Light properties");
ImGui::ColorEdit3("Light Color", &Color.r);
ImGui::SliderFloat("Strength", &Strength, 0.0f, 50.0f);
bool before = CastShadows;
ImGui::Checkbox("Cast shadows", &CastShadows);
if (CastShadows && before == false)
SetCastShadows(true);
const char* types[] = { "Directional", "Point", "Spot" };
static const char* current_item = types[Type];
if (ImGui::BeginCombo("Type", current_item)) // The second parameter is the label previewed before opening the combo.
{
for (int n = 0; n < IM_ARRAYSIZE(types); n++)
{
bool is_selected = (current_item == types[n]); // You can store your selection however you want, outside or inside your objects
if (ImGui::Selectable(types[n], is_selected)) {
current_item = types[n];
Type = (LightType)n;
}
if (is_selected)
ImGui::SetItemDefaultFocus(); // You may set the initial focus when opening the combo (scrolling + for keyboard navigation support)
}
ImGui::EndCombo();
}
if (Type == Directional) {
ImGui::Checkbox("Sync with sky", &SyncDirectionWithSky);
ImGui::Checkbox("Volumetric?", &IsVolumetric);
ImGuiHelper::DrawVec3("Direction", &Direction);
}
//if (Type == 1) {
// ImGui::SliderFloat("Attenuation", &Attenuation, 0.0f, 1.0f);
// ImGui::SliderFloat("Linear attenuation", &LinearAttenuation, 0.0f, 1.0f);
// ImGui::SliderFloat("Quadratic attenuation", &QuadraticAttenuation, 0.0f, 1.0f);
//}
//Direction = glm::normalize(Direction);
}
}