Correction of mathematical functions.

BoundingVolume: Add of constructor and setter OrientedBox. Extend is now
up to date.
Box: Use of <T>. Return this
Frustrum: Use of <T>
Matrix: Use of <T>
OrientedBox: m_corners is up to date
Rect: Add of operators /= and /. Return this
Sphere: Add of Intersect and Contains with box. Little corrections.
Vector2: Return

TaskSchedulerImpl: Add of include header cstdlib to compile because of
std::div
HardwareInfo/main: use of accentAigu

Former-commit-id: a5a7f8e8c45448e5683eb13bff453d6f67478d03
This commit is contained in:
Gawaboumga
2014-06-14 22:10:37 +02:00
parent b4c6dac441
commit 676ed6c9d8
13 changed files with 141 additions and 44 deletions

View File

@@ -1,4 +1,4 @@
// Copyright (C) 2014 Jérôme Leclercq
// Copyright (C) 2014 Jérôme Leclercq
// This file is part of the "Nazara Engine - Mathematics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
@@ -106,7 +106,7 @@ NzRect<T>& NzRect<T>::ExtendTo(const NzRect& rect)
template<typename T>
NzVector2<T> NzRect<T>::GetCenter() const
{
return GetPosition() + F(0.5)*GetLengths();
return GetPosition() + GetLengths() / F(2.0);
}
template<typename T>
@@ -336,11 +336,24 @@ NzRect<T> NzRect<T>::operator*(const NzVector2<T>& vec) const
return NzRect(x, y, width*vec.x, height*vec.y);
}
template<typename T>
NzRect<T> NzRect<T>::operator/(T scalar) const
{
return NzRect(x, y, width/scalar, height/scalar);
}
template<typename T>
NzRect<T> NzRect<T>::operator/(const NzVector2<T>& vec) const
{
return NzRect(x, y, width/vec.x, height/vec.y);
}
template<typename T>
NzRect<T>& NzRect<T>::operator*=(T scalar)
{
width *= scalar;
height *= scalar;
return *this;
}
template<typename T>
@@ -348,6 +361,25 @@ NzRect<T>& NzRect<T>::operator*=(const NzVector2<T>& vec)
{
width *= vec.x;
height *= vec.y;
return *this;
}
template<typename T>
NzRect<T>& NzRect<T>::operator/=(T scalar)
{
width /= scalar;
height /= scalar;
return *this;
}
template<typename T>
NzRect<T>& NzRect<T>::operator/=(const NzVector2<T>& vec)
{
width /= vec.x;
height /= vec.y;
return *this;
}
template<typename T>