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
@@ -35,6 +35,12 @@ NzBoundingVolume<T>::NzBoundingVolume(const NzBox<T>& box)
Set(box);
}
template<typename T>
NzBoundingVolume<T>::NzBoundingVolume(const NzOrientedBox<T>& orientedBox)
{
Set(orientedBox);
}
template<typename T>
NzBoundingVolume<T>::NzBoundingVolume(const NzVector3<T>& vec1, const NzVector3<T>& vec2)
{
@@ -103,6 +109,7 @@ template<typename T>
NzBoundingVolume<T>& NzBoundingVolume<T>::Set(const NzBoundingVolume<T>& volume)
{
obb.Set(volume.obb); // Seul l'OBB est importante pour la suite
extend = volume.extend;
return *this;
}
@@ -116,6 +123,15 @@ NzBoundingVolume<T>& NzBoundingVolume<T>::Set(const NzBox<T>& box)
return *this;
}
template<typename T>
NzBoundingVolume<T>& NzBoundingVolume<T>::Set(const NzOrientedBox<T>& orientedBox)
{
obb.Set(orientedBox);
extend = nzExtend_Finite;
return *this;
}
template<typename T>
NzBoundingVolume<T>& NzBoundingVolume<T>::Set(const NzVector3<T>& vec1, const NzVector3<T>& vec2)
{
@@ -209,17 +225,17 @@ template<typename T>
NzBoundingVolume<T> NzBoundingVolume<T>::Lerp(const NzBoundingVolume& from, const NzBoundingVolume& to, T interpolation)
{
#ifdef NAZARA_DEBUG
if (interpolation < 0.f || interpolation > 1.f)
if (interpolation < F(0.0) || interpolation > F(1.0))
{
NazaraError("Interpolation must be in range [0..1] (Got " + NzString::Number(interpolation) + ')');
return Null();
}
#endif
if (NzNumberEquals(interpolation, 0.f))
if (NzNumberEquals(interpolation, F(0.0)))
return from;
if (NzNumberEquals(interpolation, 1.f))
if (NzNumberEquals(interpolation, F(1.0)))
return to;
switch (to.extend)