Moved AxisAlignedBox::GetCorner to Cube
Former-commit-id: 59509594e6cda19089b93efd8dc77ab7bd20250c
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user