mirror of
https://github.com/overte-org/overte.git
synced 2025-08-16 15:11:10 +02:00
cleaned up line spacing and tabs, added getVertex()
This commit is contained in:
parent
658c5adfbf
commit
6d8826de43
2 changed files with 6 additions and 9 deletions
|
@ -21,8 +21,8 @@ void AABox::scale(float scale) {
|
|||
}
|
||||
|
||||
|
||||
glm::vec3 AABox::getVertice(BoxVertice vertice) const {
|
||||
switch (vertice) {
|
||||
glm::vec3 AABox::getVertex(BoxVertex vertex) const {
|
||||
switch (vertex) {
|
||||
case BOTTOM_LEFT_NEAR:
|
||||
return _corner + glm::vec3(_size.x, 0, 0);
|
||||
case BOTTOM_RIGHT_NEAR:
|
||||
|
@ -63,19 +63,16 @@ void AABox::setBox(const glm::vec3& corner, const glm::vec3& size) {
|
|||
}
|
||||
|
||||
glm::vec3 AABox::getVertexP(const glm::vec3& normal) const {
|
||||
glm::vec3 res = _corner;
|
||||
glm::vec3 result = _corner;
|
||||
if (normal.x > 0) {
|
||||
result.x += _size.x;
|
||||
}
|
||||
|
||||
if (normal.y > 0) {
|
||||
result.y += _size.y;
|
||||
}{
|
||||
|
||||
}
|
||||
if (normal.z > 0) {
|
||||
result.z += _size.z;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ enum BoxFace {
|
|||
};
|
||||
|
||||
|
||||
enum BoxVertice {
|
||||
enum BoxVertex {
|
||||
BOTTOM_LEFT_NEAR = 0,
|
||||
BOTTOM_RIGHT_NEAR = 1,
|
||||
TOP_RIGHT_NEAR = 2,
|
||||
|
@ -60,7 +60,7 @@ public:
|
|||
const glm::vec3& getSize() const { return _size; };
|
||||
const glm::vec3& getCenter() const { return _center; };
|
||||
|
||||
glm::vec3 getVertice(BoxVertice vertice) const;
|
||||
glm::vec3 getVertex(BoxVertex vertex) const;
|
||||
|
||||
bool contains(const glm::vec3& point) const;
|
||||
bool expandedContains(const glm::vec3& point, float expansion) const;
|
||||
|
|
Loading…
Reference in a new issue