Added [Box|Rect]::Get[Maximum|Minimum]()
Former-commit-id: 5226f2dfd2beaec2bc9075543f555cc48a457e3a
This commit is contained in:
parent
c940abdb75
commit
bb31a1666f
|
|
@ -41,6 +41,8 @@ class NzBox
|
|||
NzVector3<T> GetCorner(nzCorner corner) const;
|
||||
NzVector3<T> GetCenter() const;
|
||||
NzVector3<T> GetLengths() const;
|
||||
NzVector3<T> GetMaximum() const;
|
||||
NzVector3<T> GetMinimum() const;
|
||||
NzVector3<T> GetNegativeVertex(const NzVector3<T>& normal) const;
|
||||
NzVector3<T> GetPosition() const;
|
||||
NzVector3<T> GetPositiveVertex(const NzVector3<T>& normal) const;
|
||||
|
|
|
|||
|
|
@ -168,6 +168,19 @@ NzVector3<T> NzBox<T>::GetLengths() const
|
|||
return NzVector3<T>(width, height, depth);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
NzVector3<T> NzBox<T>::GetMaximum() const
|
||||
{
|
||||
return GetPosition() + GetLengths();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
NzVector3<T> NzBox<T>::GetMinimum() const
|
||||
{
|
||||
///DOC: Alias de GetPosition()
|
||||
return GetPosition();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
NzVector3<T> NzBox<T>::GetNegativeVertex(const NzVector3<T>& normal) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ class NzRect
|
|||
|
||||
NzVector2<T> GetCenter() const;
|
||||
NzVector2<T> GetLengths() const;
|
||||
NzVector2<T> GetMaximum() const;
|
||||
NzVector2<T> GetMinimum() const;
|
||||
NzVector2<T> GetNegativeVertex(const NzVector2<T>& normal) const;
|
||||
NzVector2<T> GetPosition() const;
|
||||
NzVector2<T> GetPositiveVertex(const NzVector2<T>& normal) const;
|
||||
|
|
|
|||
|
|
@ -115,6 +115,19 @@ NzVector2<T> NzRect<T>::GetLengths() const
|
|||
return NzVector2<T>(width, height);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
NzVector2<T> NzRect<T>::GetMaximum() const
|
||||
{
|
||||
return GetPosition() + GetLengths();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
NzVector2<T> NzRect<T>::GetMinimum() const
|
||||
{
|
||||
///DOC: Alias de GetPosition()
|
||||
return GetPosition();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
NzVector2<T> NzRect<T>::GetNegativeVertex(const NzVector2<T>& normal) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -63,8 +63,8 @@ void NzDebugDrawer::Draw(const NzBoxf& box)
|
|||
NzVertexStruct_XYZ* vertex = reinterpret_cast<NzVertexStruct_XYZ*>(mapper.GetPointer());
|
||||
|
||||
NzVector3f max, min;
|
||||
max = box.GetPosition() + box.GetLengths();
|
||||
min = box.GetPosition();
|
||||
max = box.GetMaximum();
|
||||
min = box.GetMinimum();
|
||||
|
||||
vertex->position.Set(min.x, min.y, min.z);
|
||||
vertex++;
|
||||
|
|
|
|||
Loading…
Reference in New Issue