Fixed returning address to temporary in functions. AABB also constructible from glm::vec4s.
This commit is contained in:
@@ -9,6 +9,7 @@ public:
|
|||||||
AABB() = default;
|
AABB() = default;
|
||||||
//No checks are made. Values in minPos must be less than values in maxPos, i.e. min.x < max.x, etc.
|
//No checks are made. Values in minPos must be less than values in maxPos, i.e. min.x < max.x, etc.
|
||||||
AABB(const glm::vec3& minPos, const glm::vec3& maxPos);
|
AABB(const glm::vec3& minPos, const glm::vec3& maxPos);
|
||||||
|
AABB(const glm::vec4& minPos, const glm::vec4& maxPos);
|
||||||
//No checks are made. Size must consist of non-negative numbers.
|
//No checks are made. Size must consist of non-negative numbers.
|
||||||
virtual void CreateFromCenter(const glm::vec3& center, const glm::vec3& size);
|
virtual void CreateFromCenter(const glm::vec3& center, const glm::vec3& size);
|
||||||
virtual ~AABB();
|
virtual ~AABB();
|
||||||
@@ -16,7 +17,7 @@ public:
|
|||||||
const glm::vec3& MinCorner() const { return m_MinCorner; }
|
const glm::vec3& MinCorner() const { return m_MinCorner; }
|
||||||
const glm::vec3& MaxCorner() const { return m_MaxCorner; }
|
const glm::vec3& MaxCorner() const { return m_MaxCorner; }
|
||||||
const glm::vec3& Center() const { return m_Center; }
|
const glm::vec3& Center() const { return m_Center; }
|
||||||
const glm::vec3& Size() const { return 2.0f * m_HalfSize; }
|
const glm::vec3 Size() const { return 2.0f * m_HalfSize; }
|
||||||
const glm::vec3& HalfSize() const { return m_HalfSize; }
|
const glm::vec3& HalfSize() const { return m_HalfSize; }
|
||||||
private:
|
private:
|
||||||
glm::vec3 m_MinCorner;
|
glm::vec3 m_MinCorner;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public:
|
|||||||
~ComponentPoolForwardIterator() = default;
|
~ComponentPoolForwardIterator() = default;
|
||||||
ComponentPoolForwardIterator& operator=(const ComponentPoolForwardIterator& other) = default;
|
ComponentPoolForwardIterator& operator=(const ComponentPoolForwardIterator& other) = default;
|
||||||
ComponentPoolForwardIterator& operator++();
|
ComponentPoolForwardIterator& operator++();
|
||||||
ComponentPoolForwardIterator& operator++(int);
|
ComponentPoolForwardIterator operator++(int);
|
||||||
bool operator!=(const ComponentPoolForwardIterator& other) const;
|
bool operator!=(const ComponentPoolForwardIterator& other) const;
|
||||||
bool operator==(const ComponentPoolForwardIterator& other) const;
|
bool operator==(const ComponentPoolForwardIterator& other) const;
|
||||||
ComponentWrapper operator*() const;
|
ComponentWrapper operator*() const;
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Postfix increment i.e. iter++. Prefer pre-increment (++iter) for efficiency.
|
//Postfix increment i.e. iter++. Prefer pre-increment (++iter) for efficiency.
|
||||||
MemoryPoolForwardIterator& operator++(int)
|
MemoryPoolForwardIterator operator++(int)
|
||||||
{
|
{
|
||||||
MemoryPoolForwardIterator<T> copyIter(*this);
|
MemoryPoolForwardIterator<T> copyIter(*this);
|
||||||
operator++();
|
operator++();
|
||||||
|
|||||||
@@ -7,6 +7,10 @@ AABB::AABB(const glm::vec3& minPos, const glm::vec3& maxPos)
|
|||||||
, m_HalfSize(0.5f * (maxPos - minPos))
|
, m_HalfSize(0.5f * (maxPos - minPos))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
AABB::AABB(const glm::vec4& minPos, const glm::vec4& maxPos)
|
||||||
|
: AABB(glm::vec3(minPos), glm::vec3(maxPos))
|
||||||
|
{}
|
||||||
|
|
||||||
void AABB::CreateFromCenter(const glm::vec3& center, const glm::vec3& size)
|
void AABB::CreateFromCenter(const glm::vec3& center, const glm::vec3& size)
|
||||||
{
|
{
|
||||||
m_Center = center;
|
m_Center = center;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ bool ComponentPoolForwardIterator::operator!=(const ComponentPoolForwardIterator
|
|||||||
return m_MemoryPoolIterator != other.m_MemoryPoolIterator;
|
return m_MemoryPoolIterator != other.m_MemoryPoolIterator;
|
||||||
}
|
}
|
||||||
|
|
||||||
ComponentPoolForwardIterator& ComponentPoolForwardIterator::operator++(int)
|
ComponentPoolForwardIterator ComponentPoolForwardIterator::operator++(int)
|
||||||
{
|
{
|
||||||
ComponentPoolForwardIterator copyIter(*this);
|
ComponentPoolForwardIterator copyIter(*this);
|
||||||
operator++();
|
operator++();
|
||||||
|
|||||||
Reference in New Issue
Block a user