Moved AxisAlignedBox::GetCorner to Cube

Former-commit-id: 59509594e6cda19089b93efd8dc77ab7bd20250c
This commit is contained in:
Lynix
2013-02-17 00:51:16 +01:00
parent f14a68fc04
commit 60d41f3c4b
5 changed files with 75 additions and 37 deletions

View File

@@ -96,6 +96,40 @@ NzCube<T>& NzCube<T>::ExtendTo(const NzCube& cube)
return *this;
}
template<typename T>
NzVector3<T> NzCube<T>::GetCorner(nzCorner corner) const
{
switch (corner)
{
case nzCorner_FarLeftBottom:
return NzVector3f(x, y, z);
case nzCorner_FarLeftTop:
return NzVector3f(x, y + height, z);
case nzCorner_FarRightBottom:
return NzVector3f(x + width, y, z);
case nzCorner_FarRightTop:
return NzVector3f(x + width, y + height, z);
case nzCorner_NearLeftBottom:
return NzVector3f(x, y, z + depth);
case nzCorner_NearLeftTop:
return NzVector3f(x, y + height, z + depth);
case nzCorner_NearRightBottom:
return NzVector3f(x + width, y, z + depth);
case nzCorner_NearRightTop:
return NzVector3f(x + width, y + height, z + depth);
}
NazaraError("Corner not handled (0x" + NzString::Number(corner, 16) + ')');
return NzVector3f();
}
template<typename T>
NzVector3<T> NzCube<T>::GetCenter() const
{