mirror of
https://github.com/bailwillharr/engine.git
synced 2024-09-21 04:51:18 +00:00
Do things
This commit is contained in:
parent
f32a42b393
commit
5890f94fe5
@ -23,8 +23,6 @@ set(SRC_FILES
|
|||||||
"src/resources/mesh.cpp"
|
"src/resources/mesh.cpp"
|
||||||
"src/resources/texture.cpp"
|
"src/resources/texture.cpp"
|
||||||
|
|
||||||
"src/event_system.cpp"
|
|
||||||
|
|
||||||
"src/scene.cpp"
|
"src/scene.cpp"
|
||||||
|
|
||||||
"src/gfx_device_vulkan.cpp"
|
"src/gfx_device_vulkan.cpp"
|
||||||
|
@ -71,10 +71,10 @@ namespace engine {
|
|||||||
class EventSystem {
|
class EventSystem {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
EventSystem();
|
EventSystem() {}
|
||||||
EventSystem(const EventSystem&) = delete;
|
EventSystem(const EventSystem&) = delete;
|
||||||
EventSystem& operator=(const EventSystem&) = delete;
|
EventSystem& operator=(const EventSystem&) = delete;
|
||||||
~EventSystem();
|
~EventSystem() {}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void registerEventType()
|
void registerEventType()
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
#include "event_system.hpp"
|
|
||||||
|
|
||||||
namespace engine {
|
|
||||||
|
|
||||||
EventSystem::EventSystem()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
EventSystem::~EventSystem()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -150,7 +150,6 @@ namespace engine {
|
|||||||
AABB object = possibleCollision.staticAABB;
|
AABB object = possibleCollision.staticAABB;
|
||||||
info.point = object.pos2;
|
info.point = object.pos2;
|
||||||
|
|
||||||
|
|
||||||
m_collisionInfos.emplace_back(possibleCollision.dynamicEntity, info);
|
m_collisionInfos.emplace_back(possibleCollision.dynamicEntity, info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,16 +41,16 @@ void CameraControllerSystem::onUpdate(float ts)
|
|||||||
const float dt = ts;
|
const float dt = ts;
|
||||||
|
|
||||||
constexpr float G = 9.8f;
|
constexpr float G = 9.8f;
|
||||||
// constexpr float MAX_SLOPE_ANGLE = glm::radians(20.0f);
|
const float MAX_SLOPE_ANGLE = glm::cos(glm::radians(20.0f));
|
||||||
constexpr float MAX_SLOPE_ANGLE = glm::radians(1000.0f); // treat every collider as a floor, (TODO: get wall collisions working so this can be removed)
|
// constexpr float MAX_SLOPE_ANGLE = glm::radians(1000.0f); // treat every collider as a floor, (TODO: get wall collisions working so this can be removed)
|
||||||
constexpr float FLOOR_SINK_LEVEL = 0.05f; // how far into the floor to ground the player
|
constexpr float FLOOR_SINK_LEVEL = 0.05f; // how far into the floor to ground the player
|
||||||
|
|
||||||
glm::vec3 norm = c->lastCollisionNormal;
|
glm::vec3 norm = c->lastCollisionNormal;
|
||||||
|
|
||||||
norm.y = 0.0f;
|
|
||||||
|
|
||||||
glm::vec3 dir = glm::normalize(glm::rotateY(glm::vec3{ 1.0f, 0.0f, 0.0f }, c->m_yaw) + glm::rotateY(glm::vec3{ 0.0f, 0.0f, 1.0f }, c->m_yaw));
|
glm::vec3 dir = glm::normalize(glm::rotateY(glm::vec3{ 1.0f, 0.0f, 0.0f }, c->m_yaw) + glm::rotateY(glm::vec3{ 0.0f, 0.0f, 1.0f }, c->m_yaw));
|
||||||
const float slope = glm::length(glm::half_pi<float>() - glm::acos(glm::dot(dir, norm)));
|
const float slope = glm::dot(dir, norm);
|
||||||
|
|
||||||
|
INFO("slope: {}", slope);
|
||||||
|
|
||||||
bool isSliding = false;
|
bool isSliding = false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user