Linloir 9d95220073
[CORE][FIX] Hit test fix
- Add critical debug logs
- Change transforming ray to local space to transforming vex to world space (because of scaling)
- Fix not updating bounding box causing hit test failure
2022-12-18 18:07:18 +08:00

17 lines
407 B
C++

#pragma once
#include <GLM/glm.hpp>
class Ray {
private:
glm::vec3 _origin = glm::vec3(0.0f);
glm::vec3 _direction = glm::vec3(0.0f, 0.0f, -1.0f);
public:
Ray() {}
Ray(glm::vec3 origin, glm::vec3 direction) : _origin(origin), _direction(direction) {}
public:
inline glm::vec3 origin() const { return _origin; }
inline glm::vec3 direction() const { return _direction; }
};