refactor: Put AABB in render namespace

This commit is contained in:
Vsevolod Kremianskii 2021-02-23 18:54:23 +07:00
parent 9425a8f11d
commit 6086aa433d
5 changed files with 13 additions and 3 deletions

View file

@ -25,6 +25,8 @@
namespace reone {
namespace render {
AABB::AABB(const glm::vec3 &min, const glm::vec3 &max) : _empty(false), _min(min), _max(max) {
updateTransform();
}
@ -164,4 +166,6 @@ float AABB::getDistanceFromClosestPoint(const glm::vec3 &point) const {
return glm::distance(closest, point);
}
} // namespace render
} // namespace reone

View file

@ -22,6 +22,8 @@
namespace reone {
namespace render {
class AABB {
public:
AABB() = default;
@ -60,4 +62,6 @@ private:
void updateTransform();
};
} // namespace render
} // namespace reone

View file

@ -19,6 +19,8 @@
#include "glm/ext.hpp"
using namespace reone::render;
namespace reone {
namespace scene {

View file

@ -32,7 +32,7 @@ public:
CameraSceneNode(SceneGraph *sceneGraph, const glm::mat4 &projection, float farPlane);
bool isInFrustum(const glm::vec3 &point) const;
bool isInFrustum(const AABB &aabb) const;
bool isInFrustum(const render::AABB &aabb) const;
const glm::mat4 &projection() const { return _projection; }
const glm::mat4 &view() const { return _view; }

View file

@ -66,7 +66,7 @@ public:
const glm::mat4 &localTransform() const { return _localTransform; }
const glm::mat4 &absoluteTransform() const { return _absoluteTransform; }
const glm::mat4 &absoluteTransformInverse() const { return _absoluteTransformInv; }
const AABB &aabb() const { return _aabb; }
const render::AABB &aabb() const { return _aabb; }
const std::vector<std::shared_ptr<SceneNode>> &children() const { return _children; }
void setParent(const SceneNode *parent);
@ -84,7 +84,7 @@ protected:
glm::mat4 _localTransform { 1.0f };
glm::mat4 _absoluteTransform { 1.0f };
glm::mat4 _absoluteTransformInv { 1.0f };
AABB _aabb;
render::AABB _aabb;
bool _visible { true };
bool _transparent { false };