Merge branch 'master' of https://github.com/DigitalPulseSoftware/NazaraEngine
Former-commit-id: 50e8a2165dcf75262754f098447d6f9be1ed7a0b
This commit is contained in:
commit
ff0efbaf47
|
|
@ -13,6 +13,8 @@
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
struct SerializationContext;
|
||||||
|
|
||||||
class Color
|
class Color
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -62,6 +64,9 @@ namespace Nz
|
||||||
private:
|
private:
|
||||||
static float Hue2RGB(float v1, float v2, float vH);
|
static float Hue2RGB(float v1, float v2, float vH);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inline bool Serialize(SerializationContext& context, const Color& color);
|
||||||
|
inline bool Unserialize(SerializationContext& context, Color* color);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostream& operator<<(std::ostream& out, const Nz::Color& color);
|
std::ostream& operator<<(std::ostream& out, const Nz::Color& color);
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
// This file is part of the "Nazara Engine - Core module"
|
// This file is part of the "Nazara Engine - Core module"
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/Algorithm.hpp>
|
||||||
#include <Nazara/Core/StringStream.hpp>
|
#include <Nazara/Core/StringStream.hpp>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
@ -610,6 +611,54 @@ namespace Nz
|
||||||
|
|
||||||
return v1;
|
return v1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Serializes a Color
|
||||||
|
* \return true if successfully serialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param color Input color
|
||||||
|
*/
|
||||||
|
inline bool Serialize(SerializationContext& context, const Color& color)
|
||||||
|
{
|
||||||
|
if (!Serialize(context, color.r))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, color.g))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, color.b))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, color.a))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Unserializes a Color
|
||||||
|
* \return true if successfully unserialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param color Output color
|
||||||
|
*/
|
||||||
|
inline bool Unserialize(SerializationContext& context, Color* color)
|
||||||
|
{
|
||||||
|
if (!Unserialize(context, &color->r))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &color->g))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &color->b))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &color->a))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
struct SerializationContext;
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class BoundingVolume
|
class BoundingVolume
|
||||||
{
|
{
|
||||||
|
|
@ -66,6 +68,9 @@ namespace Nz
|
||||||
|
|
||||||
typedef BoundingVolume<double> BoundingVolumed;
|
typedef BoundingVolume<double> BoundingVolumed;
|
||||||
typedef BoundingVolume<float> BoundingVolumef;
|
typedef BoundingVolume<float> BoundingVolumef;
|
||||||
|
|
||||||
|
template<typename T> bool Serialize(SerializationContext& context, const BoundingVolume<T>& boundingVolume);
|
||||||
|
template<typename T> bool Unserialize(SerializationContext& context, BoundingVolume<T>* boundingVolume);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
// This file is part of the "Nazara Engine - Mathematics module"
|
// This file is part of the "Nazara Engine - Mathematics module"
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/Algorithm.hpp>
|
||||||
#include <Nazara/Core/StringStream.hpp>
|
#include <Nazara/Core/StringStream.hpp>
|
||||||
#include <Nazara/Core/Error.hpp>
|
#include <Nazara/Core/Error.hpp>
|
||||||
#include <Nazara/Math/Algorithm.hpp>
|
#include <Nazara/Math/Algorithm.hpp>
|
||||||
|
|
@ -545,6 +546,60 @@ namespace Nz
|
||||||
|
|
||||||
return volume;
|
return volume;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Serializes a BoundingVolume
|
||||||
|
* \return true if successfully serialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param boundingVolume Input bounding volume
|
||||||
|
*
|
||||||
|
* \remark Does not save OBB corners
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Serialize(SerializationContext& context, const BoundingVolume<T>& boundingVolume)
|
||||||
|
{
|
||||||
|
if (!Serialize(context, static_cast<UInt8>(boundingVolume.extend)))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, boundingVolume.aabb))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, boundingVolume.obb))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Unserializes a BoundingVolume
|
||||||
|
* \return true if successfully unserialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param boundingVolume Output bounding volume
|
||||||
|
*
|
||||||
|
* \remark The resulting oriented box corners will *not* be updated, a call to Update is required
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Unserialize(SerializationContext& context, BoundingVolume<T>* boundingVolume)
|
||||||
|
{
|
||||||
|
UInt8 extend;
|
||||||
|
if (!Unserialize(context, &extend))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (extend > Extend_Max)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
boundingVolume->extend = extend;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &boundingVolume->aabb))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &boundingVolume->obb))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
struct SerializationContext;
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class Box
|
class Box
|
||||||
{
|
{
|
||||||
|
|
@ -96,6 +98,9 @@ namespace Nz
|
||||||
typedef Box<unsigned int> Boxui;
|
typedef Box<unsigned int> Boxui;
|
||||||
typedef Box<Int32> Boxi32;
|
typedef Box<Int32> Boxi32;
|
||||||
typedef Box<UInt32> Boxui32;
|
typedef Box<UInt32> Boxui32;
|
||||||
|
|
||||||
|
template<typename T> bool Serialize(SerializationContext& context, const Box<T>& box);
|
||||||
|
template<typename T> bool Unserialize(SerializationContext& context, Box<T>* box);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
// This file is part of the "Nazara Engine - Mathematics module"
|
// This file is part of the "Nazara Engine - Mathematics module"
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/Algorithm.hpp>
|
||||||
#include <Nazara/Core/StringStream.hpp>
|
#include <Nazara/Core/StringStream.hpp>
|
||||||
#include <Nazara/Math/Algorithm.hpp>
|
#include <Nazara/Math/Algorithm.hpp>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
@ -920,6 +921,68 @@ namespace Nz
|
||||||
|
|
||||||
return box;
|
return box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Serializes a Box
|
||||||
|
* \return true if successfully serialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param box Input Box
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Serialize(SerializationContext& context, const Box<T>& box)
|
||||||
|
{
|
||||||
|
if (!Serialize(context, box.x))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, box.y))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, box.z))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, box.width))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, box.height))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, box.depth))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Unserializes a Box
|
||||||
|
* \return true if successfully unserialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param box Output Box
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Unserialize(SerializationContext& context, Box<T>* box)
|
||||||
|
{
|
||||||
|
if (!Unserialize(context, &box->x))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &box->y))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &box->z))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &box->width))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &box->height))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &box->depth))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,8 @@
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
struct SerializationContext;
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class EulerAngles
|
class EulerAngles
|
||||||
{
|
{
|
||||||
|
|
@ -61,6 +63,9 @@ namespace Nz
|
||||||
|
|
||||||
typedef EulerAngles<double> EulerAnglesd;
|
typedef EulerAngles<double> EulerAnglesd;
|
||||||
typedef EulerAngles<float> EulerAnglesf;
|
typedef EulerAngles<float> EulerAnglesf;
|
||||||
|
|
||||||
|
template<typename T> bool Serialize(SerializationContext& context, const EulerAngles<T>& eulerAngles);
|
||||||
|
template<typename T> bool Unserialize(SerializationContext& context, EulerAngles<T>* eulerAngles);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::EulerAngles<T>& angles);
|
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::EulerAngles<T>& angles);
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
// This file is part of the "Nazara Engine - Mathematics module"
|
// This file is part of the "Nazara Engine - Mathematics module"
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/Algorithm.hpp>
|
||||||
#include <Nazara/Core/StringStream.hpp>
|
#include <Nazara/Core/StringStream.hpp>
|
||||||
#include <Nazara/Math/Algorithm.hpp>
|
#include <Nazara/Math/Algorithm.hpp>
|
||||||
#include <Nazara/Math/Config.hpp>
|
#include <Nazara/Math/Config.hpp>
|
||||||
|
|
@ -330,6 +331,50 @@ namespace Nz
|
||||||
|
|
||||||
return angles;
|
return angles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Serializes a EulerAngles
|
||||||
|
* \return true if successfully serialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param angles Input euler angles
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Serialize(SerializationContext& context, const EulerAngles<T>& angles)
|
||||||
|
{
|
||||||
|
if (!Serialize(context, angles.pitch))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, angles.yaw))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, angles.roll))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Unserializes a EulerAngles
|
||||||
|
* \return true if successfully unserialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param angles Output euler angles
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Unserialize(SerializationContext& context, EulerAngles<T>* angles)
|
||||||
|
{
|
||||||
|
if (!Unserialize(context, &angles->pitch))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &angles->yaw))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &angles->roll))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
struct SerializationContext;
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class Frustum
|
class Frustum
|
||||||
{
|
{
|
||||||
|
|
@ -60,6 +62,9 @@ namespace Nz
|
||||||
|
|
||||||
typedef Frustum<double> Frustumd;
|
typedef Frustum<double> Frustumd;
|
||||||
typedef Frustum<float> Frustumf;
|
typedef Frustum<float> Frustumf;
|
||||||
|
|
||||||
|
template<typename T> bool Serialize(SerializationContext& context, const Frustum<T>& frustum);
|
||||||
|
template<typename T> bool Unserialize(SerializationContext& context, Frustum<T>* frustum);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
// http://www.crownandcutlass.com/features/technicaldetails/frustum.html
|
// http://www.crownandcutlass.com/features/technicaldetails/frustum.html
|
||||||
// http://www.lighthouse3d.com/tutorials/view-frustum-culling/
|
// http://www.lighthouse3d.com/tutorials/view-frustum-culling/
|
||||||
|
|
||||||
|
#include <Nazara/Core/Algorithm.hpp>
|
||||||
#include <Nazara/Core/StringStream.hpp>
|
#include <Nazara/Core/StringStream.hpp>
|
||||||
#include <Nazara/Math/Algorithm.hpp>
|
#include <Nazara/Math/Algorithm.hpp>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
@ -674,6 +675,56 @@ namespace Nz
|
||||||
<< " Right: " << m_planes[FrustumPlane_Right].ToString() << "\n"
|
<< " Right: " << m_planes[FrustumPlane_Right].ToString() << "\n"
|
||||||
<< " Top: " << m_planes[FrustumPlane_Top].ToString() << ")\n";
|
<< " Top: " << m_planes[FrustumPlane_Top].ToString() << ")\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Serializes a Frustum
|
||||||
|
* \return true if successfully serialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param matrix Input frustum
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Serialize(SerializationContext& context, const Frustum<T>& frustum)
|
||||||
|
{
|
||||||
|
for (unsigned int i = 0; i <= BoxCorner_Max; ++i)
|
||||||
|
{
|
||||||
|
if (!Serialize(context, m_corners[i]))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (unsigned int i = 0; i <= FrustumPlane_Max; ++i)
|
||||||
|
{
|
||||||
|
if (!Serialize(context, m_planes[i]))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Unserializes a Matrix4
|
||||||
|
* \return true if successfully unserialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param matrix Output matrix
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Unserialize(SerializationContext& context, Frustum<T>* frustum)
|
||||||
|
{
|
||||||
|
for (unsigned int i = 0; i <= BoxCorner_Max; ++i)
|
||||||
|
{
|
||||||
|
if (!Unserialize(context, &m_corners[i]))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (unsigned int i = 0; i <= FrustumPlane_Max; ++i)
|
||||||
|
{
|
||||||
|
if (!Unserialize(context, &m_planes[i]))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
struct SerializationContext;
|
||||||
|
|
||||||
template<typename T> class EulerAngles;
|
template<typename T> class EulerAngles;
|
||||||
template<typename T> class Quaternion;
|
template<typename T> class Quaternion;
|
||||||
template<typename T> class Vector2;
|
template<typename T> class Vector2;
|
||||||
|
|
@ -138,6 +140,9 @@ namespace Nz
|
||||||
|
|
||||||
typedef Matrix4<double> Matrix4d;
|
typedef Matrix4<double> Matrix4d;
|
||||||
typedef Matrix4<float> Matrix4f;
|
typedef Matrix4<float> Matrix4f;
|
||||||
|
|
||||||
|
template<typename T> bool Serialize(SerializationContext& context, const Matrix4<T>& matrix);
|
||||||
|
template<typename T> bool Unserialize(SerializationContext& context, Matrix4<T>* matrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Matrix4<T>& matrix);
|
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Matrix4<T>& matrix);
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
// This file is part of the "Nazara Engine - Mathematics module"
|
// This file is part of the "Nazara Engine - Mathematics module"
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/Algorithm.hpp>
|
||||||
#include <Nazara/Core/StringStream.hpp>
|
#include <Nazara/Core/StringStream.hpp>
|
||||||
#include <Nazara/Core/Error.hpp>
|
#include <Nazara/Core/Error.hpp>
|
||||||
#include <Nazara/Math/Algorithm.hpp>
|
#include <Nazara/Math/Algorithm.hpp>
|
||||||
|
|
@ -1761,6 +1762,44 @@ namespace Nz
|
||||||
|
|
||||||
return matrix;
|
return matrix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Serializes a Matrix4
|
||||||
|
* \return true if successfully serialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param matrix Input matrix
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Serialize(SerializationContext& context, const Matrix4<T>& matrix)
|
||||||
|
{
|
||||||
|
for (unsigned int i = 0; i < 16; ++i)
|
||||||
|
{
|
||||||
|
if (!Serialize(context, matrix[i]))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Unserializes a Matrix4
|
||||||
|
* \return true if successfully unserialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param matrix Output matrix
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Unserialize(SerializationContext& context, Matrix4<T>* matrix)
|
||||||
|
{
|
||||||
|
for (unsigned int i = 0; i < 16; ++i)
|
||||||
|
{
|
||||||
|
if (!Unserialize(context, &matrix[i]))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
struct SerializationContext;
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class OrientedBox
|
class OrientedBox
|
||||||
{
|
{
|
||||||
|
|
@ -67,6 +69,9 @@ namespace Nz
|
||||||
|
|
||||||
typedef OrientedBox<double> OrientedBoxd;
|
typedef OrientedBox<double> OrientedBoxd;
|
||||||
typedef OrientedBox<float> OrientedBoxf;
|
typedef OrientedBox<float> OrientedBoxf;
|
||||||
|
|
||||||
|
template<typename T> bool Serialize(SerializationContext& context, const OrientedBox<T>& obb);
|
||||||
|
template<typename T> bool Unserialize(SerializationContext& context, OrientedBox<T>* obb);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
// This file is part of the "Nazara Engine - Mathematics module"
|
// This file is part of the "Nazara Engine - Mathematics module"
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/Algorithm.hpp>
|
||||||
#include <Nazara/Core/StringStream.hpp>
|
#include <Nazara/Core/StringStream.hpp>
|
||||||
#include <Nazara/Math/Algorithm.hpp>
|
#include <Nazara/Math/Algorithm.hpp>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
@ -430,6 +431,42 @@ namespace Nz
|
||||||
|
|
||||||
return orientedBox;
|
return orientedBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Serializes a OrientedBox
|
||||||
|
* \return true if successfully serialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param obb Input oriented box
|
||||||
|
*
|
||||||
|
* \remark Does not save OBB corners
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Serialize(SerializationContext& context, const OrientedBox<T>& obb)
|
||||||
|
{
|
||||||
|
if (!Serialize(context, obb.localBox))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Unserializes a Matrix4
|
||||||
|
* \return true if successfully unserialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param obb Output oriented box
|
||||||
|
*
|
||||||
|
* \remark The resulting oriented box corners will *not* be updated, a call to Update is required
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Unserialize(SerializationContext& context, OrientedBox<T>* obb)
|
||||||
|
{
|
||||||
|
if (!Unserialize(context, &obb->localBox))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,8 @@
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
struct SerializationContext;
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class Plane
|
class Plane
|
||||||
{
|
{
|
||||||
|
|
@ -57,6 +59,9 @@ namespace Nz
|
||||||
|
|
||||||
typedef Plane<double> Planed;
|
typedef Plane<double> Planed;
|
||||||
typedef Plane<float> Planef;
|
typedef Plane<float> Planef;
|
||||||
|
|
||||||
|
template<typename T> bool Serialize(SerializationContext& context, const Plane<T>& plane);
|
||||||
|
template<typename T> bool Unserialize(SerializationContext& context, Plane<T>* plane);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
// This file is part of the "Nazara Engine - Mathematics module"
|
// This file is part of the "Nazara Engine - Mathematics module"
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/Algorithm.hpp>
|
||||||
#include <Nazara/Core/StringStream.hpp>
|
#include <Nazara/Core/StringStream.hpp>
|
||||||
#include <Nazara/Math/Algorithm.hpp>
|
#include <Nazara/Math/Algorithm.hpp>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
@ -424,6 +425,44 @@ namespace Nz
|
||||||
|
|
||||||
return plane;
|
return plane;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Serializes a Vector2
|
||||||
|
* \return true if successfully serialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param plane Input Vector2
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Serialize(SerializationContext& context, const Plane<T>& plane)
|
||||||
|
{
|
||||||
|
if (!Serialize(context, plane.normal))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, plane.distance))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Unserializes a Plane
|
||||||
|
* \return true if successfully unserialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param plane Output Plane
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Unserialize(SerializationContext& context, Plane<T>* plane)
|
||||||
|
{
|
||||||
|
if (!Unserialize(context, &plane->normal))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &plane->distance))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
struct SerializationContext;
|
||||||
|
|
||||||
template<typename T> class EulerAngles;
|
template<typename T> class EulerAngles;
|
||||||
template<typename T> class Vector3;
|
template<typename T> class Vector3;
|
||||||
|
|
||||||
|
|
@ -88,6 +90,9 @@ namespace Nz
|
||||||
|
|
||||||
typedef Quaternion<double> Quaterniond;
|
typedef Quaternion<double> Quaterniond;
|
||||||
typedef Quaternion<float> Quaternionf;
|
typedef Quaternion<float> Quaternionf;
|
||||||
|
|
||||||
|
template<typename T> bool Serialize(SerializationContext& context, const Quaternion<T>& quat);
|
||||||
|
template<typename T> bool Unserialize(SerializationContext& context, Quaternion<T>* quat);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Quaternion<T>& quat);
|
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Quaternion<T>& quat);
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
// This file is part of the "Nazara Engine - Mathematics module"
|
// This file is part of the "Nazara Engine - Mathematics module"
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/Algorithm.hpp>
|
||||||
#include <Nazara/Core/StringStream.hpp>
|
#include <Nazara/Core/StringStream.hpp>
|
||||||
#include <Nazara/Math/Algorithm.hpp>
|
#include <Nazara/Math/Algorithm.hpp>
|
||||||
#include <Nazara/Math/Config.hpp>
|
#include <Nazara/Math/Config.hpp>
|
||||||
|
|
@ -831,6 +832,57 @@ namespace Nz
|
||||||
|
|
||||||
return quaternion;
|
return quaternion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Serializes a Quaternion
|
||||||
|
* \return true if successfully serialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param quat Input Quaternion
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Serialize(SerializationContext& context, const Quaternion<T>& quat)
|
||||||
|
{
|
||||||
|
if (!Serialize(context, quat.x))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, quat.y))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, quat.z))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, quat.w))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Unserializes a Quaternion
|
||||||
|
* \return true if successfully unserialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param quat Output Quaternion
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Unserialize(SerializationContext& context, Quaternion<T>* quat)
|
||||||
|
{
|
||||||
|
if (!Unserialize(context, &quat->x))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &quat->y))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &quat->z))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &quat->w))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
struct SerializationContext;
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class Ray
|
class Ray
|
||||||
{
|
{
|
||||||
|
|
@ -73,6 +75,9 @@ namespace Nz
|
||||||
|
|
||||||
typedef Ray<double> Rayd;
|
typedef Ray<double> Rayd;
|
||||||
typedef Ray<float> Rayf;
|
typedef Ray<float> Rayf;
|
||||||
|
|
||||||
|
template<typename T> bool Serialize(SerializationContext& context, const Ray<T>& ray);
|
||||||
|
template<typename T> bool Unserialize(SerializationContext& context, Ray<T>* ray);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Ray<T>& vec);
|
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Ray<T>& vec);
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
// This file is part of the "Nazara Engine - Mathematics module"
|
// This file is part of the "Nazara Engine - Mathematics module"
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/Algorithm.hpp>
|
||||||
#include <Nazara/Core/StringStream.hpp>
|
#include <Nazara/Core/StringStream.hpp>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <Nazara/Core/Debug.hpp>
|
#include <Nazara/Core/Debug.hpp>
|
||||||
|
|
@ -762,6 +763,44 @@ namespace Nz
|
||||||
{
|
{
|
||||||
return Ray<T>(Nz::Vector3<T>::Lerp(from.origin, to.origin, interpolation), Nz::Vector3<T>::Lerp(from.direction, to.direction, interpolation));
|
return Ray<T>(Nz::Vector3<T>::Lerp(from.origin, to.origin, interpolation), Nz::Vector3<T>::Lerp(from.direction, to.direction, interpolation));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Serializes a Ray
|
||||||
|
* \return true if successfully serialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param ray Input Ray
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Serialize(SerializationContext& context, const Ray<T>& ray)
|
||||||
|
{
|
||||||
|
if (!Serialize(context, ray.origin))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, ray.direction))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Unserializes a Ray
|
||||||
|
* \return true if successfully unserialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param ray Output Ray
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Unserialize(SerializationContext& context, Ray<T>* ray)
|
||||||
|
{
|
||||||
|
if (!Unserialize(context, &ray->origin))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &ray->direction))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,8 @@
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
struct SerializationContext;
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class Rect
|
class Rect
|
||||||
{
|
{
|
||||||
|
|
@ -90,6 +92,9 @@ namespace Nz
|
||||||
typedef Rect<unsigned int> Rectui;
|
typedef Rect<unsigned int> Rectui;
|
||||||
typedef Rect<Int32> Recti32;
|
typedef Rect<Int32> Recti32;
|
||||||
typedef Rect<UInt32> Rectui32;
|
typedef Rect<UInt32> Rectui32;
|
||||||
|
|
||||||
|
template<typename T> bool Serialize(SerializationContext& context, const Rect<T>& rect);
|
||||||
|
template<typename T> bool Unserialize(SerializationContext& context, Rect<T>* rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
// This file is part of the "Nazara Engine - Mathematics module"
|
// This file is part of the "Nazara Engine - Mathematics module"
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/Algorithm.hpp>
|
||||||
#include <Nazara/Core/StringStream.hpp>
|
#include <Nazara/Core/StringStream.hpp>
|
||||||
#include <Nazara/Math/Algorithm.hpp>
|
#include <Nazara/Math/Algorithm.hpp>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
@ -816,6 +817,56 @@ namespace Nz
|
||||||
|
|
||||||
return rect;
|
return rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Serializes a Rect
|
||||||
|
* \return true if successfully serialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param rect Input Rect
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Serialize(SerializationContext& context, const Rect<T>& rect)
|
||||||
|
{
|
||||||
|
if (!Serialize(context, rect.x))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, rect.y))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, rect.width))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, rect.height))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Unserializes a Rect
|
||||||
|
* \return true if successfully unserialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param rect Output Rect
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Unserialize(SerializationContext& context, Rect<T>* rect)
|
||||||
|
{
|
||||||
|
if (!Unserialize(context, &rect->x))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &rect->y))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &rect->width))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &rect->height))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,8 @@
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
struct SerializationContext;
|
||||||
|
|
||||||
template<typename T> class Box;
|
template<typename T> class Box;
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
@ -80,6 +82,9 @@ namespace Nz
|
||||||
|
|
||||||
typedef Sphere<double> Sphered;
|
typedef Sphere<double> Sphered;
|
||||||
typedef Sphere<float> Spheref;
|
typedef Sphere<float> Spheref;
|
||||||
|
|
||||||
|
template<typename T> bool Serialize(SerializationContext& context, const Sphere<T>& sphere);
|
||||||
|
template<typename T> bool Unserialize(SerializationContext& context, Sphere<T>* sphere);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
// This file is part of the "Nazara Engine - Mathematics module"
|
// This file is part of the "Nazara Engine - Mathematics module"
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/Algorithm.hpp>
|
||||||
#include <Nazara/Core/StringStream.hpp>
|
#include <Nazara/Core/StringStream.hpp>
|
||||||
#include <Nazara/Math/Algorithm.hpp>
|
#include <Nazara/Math/Algorithm.hpp>
|
||||||
#include <Nazara/Math/Box.hpp>
|
#include <Nazara/Math/Box.hpp>
|
||||||
|
|
@ -674,6 +675,56 @@ namespace Nz
|
||||||
|
|
||||||
return sphere;
|
return sphere;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Serializes a Sphere
|
||||||
|
* \return true if successfully serialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param sphere Input Sphere
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Serialize(SerializationContext& context, const Sphere<T>& sphere)
|
||||||
|
{
|
||||||
|
if (!Serialize(context, sphere.x))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, sphere.y))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, sphere.z))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, sphere.radius))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Unserializes a Sphere
|
||||||
|
* \return true if successfully unserialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param sphere Output Sphere
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Unserialize(SerializationContext& context, Sphere<T>* sphere)
|
||||||
|
{
|
||||||
|
if (!Unserialize(context, &sphere->x))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &sphere->y))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &sphere->z))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &sphere->radius))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
struct SerializationContext;
|
||||||
|
|
||||||
template<typename T> class Vector3;
|
template<typename T> class Vector3;
|
||||||
template<typename T> class Vector4;
|
template<typename T> class Vector4;
|
||||||
|
|
||||||
|
|
@ -106,6 +108,9 @@ namespace Nz
|
||||||
typedef Vector2<unsigned int> Vector2ui;
|
typedef Vector2<unsigned int> Vector2ui;
|
||||||
typedef Vector2<Int32> Vector2i32;
|
typedef Vector2<Int32> Vector2i32;
|
||||||
typedef Vector2<UInt32> Vector2ui32;
|
typedef Vector2<UInt32> Vector2ui32;
|
||||||
|
|
||||||
|
template<typename T> bool Serialize(SerializationContext& context, const Vector2<T>& vector);
|
||||||
|
template<typename T> bool Unserialize(SerializationContext& context, Vector2<T>* vector);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Vector2<T>& vec);
|
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Vector2<T>& vec);
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
// This file is part of the "Nazara Engine - Mathematics module"
|
// This file is part of the "Nazara Engine - Mathematics module"
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/Algorithm.hpp>
|
||||||
#include <Nazara/Core/StringStream.hpp>
|
#include <Nazara/Core/StringStream.hpp>
|
||||||
#include <Nazara/Math/Algorithm.hpp>
|
#include <Nazara/Math/Algorithm.hpp>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
@ -940,7 +941,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see MakeUnitY
|
* \see MakeUnitY
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector2<T> Vector2<T>::UnitY()
|
Vector2<T> Vector2<T>::UnitY()
|
||||||
{
|
{
|
||||||
|
|
@ -956,7 +956,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see MakeZero
|
* \see MakeZero
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector2<T> Vector2<T>::Zero()
|
Vector2<T> Vector2<T>::Zero()
|
||||||
{
|
{
|
||||||
|
|
@ -965,6 +964,44 @@ namespace Nz
|
||||||
|
|
||||||
return vector;
|
return vector;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Serializes a Vector2
|
||||||
|
* \return true if successfully serialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param vector Input Vector2
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Serialize(SerializationContext& context, const Vector2<T>& vector)
|
||||||
|
{
|
||||||
|
if (!Serialize(context, vector.x))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, vector.y))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Unserializes a Vector2
|
||||||
|
* \return true if successfully unserialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param vector Output Vector2
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Unserialize(SerializationContext& context, Vector2<T>* vector)
|
||||||
|
{
|
||||||
|
if (!Unserialize(context, &vector->x))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &vector->y))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
struct SerializationContext;
|
||||||
|
|
||||||
template<typename T> class Vector2;
|
template<typename T> class Vector2;
|
||||||
template<typename T> class Vector4;
|
template<typename T> class Vector4;
|
||||||
|
|
||||||
|
|
@ -125,6 +127,9 @@ namespace Nz
|
||||||
typedef Vector3<unsigned int> Vector3ui;
|
typedef Vector3<unsigned int> Vector3ui;
|
||||||
typedef Vector3<Int32> Vector3i32;
|
typedef Vector3<Int32> Vector3i32;
|
||||||
typedef Vector3<UInt32> Vector3ui32;
|
typedef Vector3<UInt32> Vector3ui32;
|
||||||
|
|
||||||
|
template<typename T> bool Serialize(SerializationContext& context, const Vector3<T>& vector);
|
||||||
|
template<typename T> bool Unserialize(SerializationContext& context, Vector3<T>* vector);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Vector3<T>& vec);
|
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Vector3<T>& vec);
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
// This file is part of the "Nazara Engine - Mathematics module"
|
// This file is part of the "Nazara Engine - Mathematics module"
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/Algorithm.hpp>
|
||||||
#include <Nazara/Core/StringStream.hpp>
|
#include <Nazara/Core/StringStream.hpp>
|
||||||
#include <Nazara/Math/Algorithm.hpp>
|
#include <Nazara/Math/Algorithm.hpp>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
@ -28,7 +29,6 @@ namespace Nz
|
||||||
* \param Y Y component
|
* \param Y Y component
|
||||||
* \param Z Z component
|
* \param Z Z component
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>::Vector3(T X, T Y, T Z)
|
Vector3<T>::Vector3(T X, T Y, T Z)
|
||||||
{
|
{
|
||||||
|
|
@ -41,7 +41,6 @@ namespace Nz
|
||||||
* \param X X component
|
* \param X X component
|
||||||
* \param vec vec.X = Y component and vec.y = Z component
|
* \param vec vec.X = Y component and vec.y = Z component
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>::Vector3(T X, const Vector2<T>& vec)
|
Vector3<T>::Vector3(T X, const Vector2<T>& vec)
|
||||||
{
|
{
|
||||||
|
|
@ -53,7 +52,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \param scale X component = Y component = Z component
|
* \param scale X component = Y component = Z component
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>::Vector3(T scale)
|
Vector3<T>::Vector3(T scale)
|
||||||
{
|
{
|
||||||
|
|
@ -65,7 +63,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \param vec[3] vec[0] is X component, vec[1] is Y component and vec[2] is Z component
|
* \param vec[3] vec[0] is X component, vec[1] is Y component and vec[2] is Z component
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>::Vector3(const T vec[3])
|
Vector3<T>::Vector3(const T vec[3])
|
||||||
{
|
{
|
||||||
|
|
@ -78,7 +75,6 @@ namespace Nz
|
||||||
* \param vec vec.X = X component and vec.y = Y component
|
* \param vec vec.X = X component and vec.y = Y component
|
||||||
* \param Z Z component
|
* \param Z Z component
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>::Vector3(const Vector2<T>& vec, T Z)
|
Vector3<T>::Vector3(const Vector2<T>& vec, T Z)
|
||||||
{
|
{
|
||||||
|
|
@ -90,7 +86,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \param vec Vector of type U to convert to type T
|
* \param vec Vector of type U to convert to type T
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
template<typename U>
|
template<typename U>
|
||||||
Vector3<T>::Vector3(const Vector3<U>& vec)
|
Vector3<T>::Vector3(const Vector3<U>& vec)
|
||||||
|
|
@ -103,7 +98,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \param vec Vector4 where only the first three components are taken
|
* \param vec Vector4 where only the first three components are taken
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>::Vector3(const Vector4<T>& vec)
|
Vector3<T>::Vector3(const Vector4<T>& vec)
|
||||||
{
|
{
|
||||||
|
|
@ -118,7 +112,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see DotProduct
|
* \see DotProduct
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T Vector3<T>::AbsDotProduct(const Vector3& vec) const
|
T Vector3<T>::AbsDotProduct(const Vector3& vec) const
|
||||||
{
|
{
|
||||||
|
|
@ -137,7 +130,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see NormalizeAngle
|
* \see NormalizeAngle
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T Vector3<T>::AngleBetween(const Vector3& vec) const
|
T Vector3<T>::AngleBetween(const Vector3& vec) const
|
||||||
{
|
{
|
||||||
|
|
@ -166,7 +158,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see CrossProduct
|
* \see CrossProduct
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T> Vector3<T>::CrossProduct(const Vector3& vec) const
|
Vector3<T> Vector3<T>::CrossProduct(const Vector3& vec) const
|
||||||
{
|
{
|
||||||
|
|
@ -181,7 +172,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see SquaredDistance
|
* \see SquaredDistance
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T Vector3<T>::Distance(const Vector3& vec) const
|
T Vector3<T>::Distance(const Vector3& vec) const
|
||||||
{
|
{
|
||||||
|
|
@ -194,7 +184,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \param vec The other vector to measure the distance with
|
* \param vec The other vector to measure the distance with
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
float Vector3<T>::Distancef(const Vector3& vec) const
|
float Vector3<T>::Distancef(const Vector3& vec) const
|
||||||
{
|
{
|
||||||
|
|
@ -209,7 +198,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see AbsDotProduct, DotProduct
|
* \see AbsDotProduct, DotProduct
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T Vector3<T>::DotProduct(const Vector3& vec) const
|
T Vector3<T>::DotProduct(const Vector3& vec) const
|
||||||
{
|
{
|
||||||
|
|
@ -222,7 +210,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see GetSquaredLength
|
* \see GetSquaredLength
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T Vector3<T>::GetLength() const
|
T Vector3<T>::GetLength() const
|
||||||
{
|
{
|
||||||
|
|
@ -233,7 +220,6 @@ namespace Nz
|
||||||
* \brief Calculates the length (magnitude) of the vector
|
* \brief Calculates the length (magnitude) of the vector
|
||||||
* \return The length in float of the vector
|
* \return The length in float of the vector
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
float Vector3<T>::GetLengthf() const
|
float Vector3<T>::GetLengthf() const
|
||||||
{
|
{
|
||||||
|
|
@ -250,7 +236,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see Normalize
|
* \see Normalize
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T> Vector3<T>::GetNormal(T* length) const
|
Vector3<T> Vector3<T>::GetNormal(T* length) const
|
||||||
{
|
{
|
||||||
|
|
@ -266,7 +251,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see GetLength
|
* \see GetLength
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T Vector3<T>::GetSquaredLength() const
|
T Vector3<T>::GetSquaredLength() const
|
||||||
{
|
{
|
||||||
|
|
@ -279,7 +263,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see Backward
|
* \see Backward
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::MakeBackward()
|
Vector3<T>& Vector3<T>::MakeBackward()
|
||||||
{
|
{
|
||||||
|
|
@ -292,7 +275,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see Down
|
* \see Down
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::MakeDown()
|
Vector3<T>& Vector3<T>::MakeDown()
|
||||||
{
|
{
|
||||||
|
|
@ -305,7 +287,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see Forward
|
* \see Forward
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::MakeForward()
|
Vector3<T>& Vector3<T>::MakeForward()
|
||||||
{
|
{
|
||||||
|
|
@ -318,7 +299,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see Left
|
* \see Left
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::MakeLeft()
|
Vector3<T>& Vector3<T>::MakeLeft()
|
||||||
{
|
{
|
||||||
|
|
@ -331,7 +311,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see Right
|
* \see Right
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::MakeRight()
|
Vector3<T>& Vector3<T>::MakeRight()
|
||||||
{
|
{
|
||||||
|
|
@ -344,7 +323,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see Unit
|
* \see Unit
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::MakeUnit()
|
Vector3<T>& Vector3<T>::MakeUnit()
|
||||||
{
|
{
|
||||||
|
|
@ -357,7 +335,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see UnitX
|
* \see UnitX
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::MakeUnitX()
|
Vector3<T>& Vector3<T>::MakeUnitX()
|
||||||
{
|
{
|
||||||
|
|
@ -370,7 +347,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see UnitY
|
* \see UnitY
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::MakeUnitY()
|
Vector3<T>& Vector3<T>::MakeUnitY()
|
||||||
{
|
{
|
||||||
|
|
@ -383,7 +359,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see UnitZ
|
* \see UnitZ
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::MakeUnitZ()
|
Vector3<T>& Vector3<T>::MakeUnitZ()
|
||||||
{
|
{
|
||||||
|
|
@ -396,7 +371,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see Up
|
* \see Up
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::MakeUp()
|
Vector3<T>& Vector3<T>::MakeUp()
|
||||||
{
|
{
|
||||||
|
|
@ -409,7 +383,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see Zero
|
* \see Zero
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::MakeZero()
|
Vector3<T>& Vector3<T>::MakeZero()
|
||||||
{
|
{
|
||||||
|
|
@ -424,7 +397,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see Minimize
|
* \see Minimize
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::Maximize(const Vector3& vec)
|
Vector3<T>& Vector3<T>::Maximize(const Vector3& vec)
|
||||||
{
|
{
|
||||||
|
|
@ -448,7 +420,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see Maximize
|
* \see Maximize
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::Minimize(const Vector3& vec)
|
Vector3<T>& Vector3<T>::Minimize(const Vector3& vec)
|
||||||
{
|
{
|
||||||
|
|
@ -474,7 +445,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see GetNormal
|
* \see GetNormal
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::Normalize(T* length)
|
Vector3<T>& Vector3<T>::Normalize(T* length)
|
||||||
{
|
{
|
||||||
|
|
@ -501,7 +471,6 @@ namespace Nz
|
||||||
* \param Y Y component
|
* \param Y Y component
|
||||||
* \param Z Z component
|
* \param Z Z component
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::Set(T X, T Y, T Z)
|
Vector3<T>& Vector3<T>::Set(T X, T Y, T Z)
|
||||||
{
|
{
|
||||||
|
|
@ -518,7 +487,6 @@ namespace Nz
|
||||||
* \param X X component
|
* \param X X component
|
||||||
* \param vec vec.X = Y component and vec.y = Z component
|
* \param vec vec.X = Y component and vec.y = Z component
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::Set(T X, const Vector2<T>& vec)
|
Vector3<T>& Vector3<T>::Set(T X, const Vector2<T>& vec)
|
||||||
{
|
{
|
||||||
|
|
@ -535,7 +503,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \param scale X component = Y component = Z component
|
* \param scale X component = Y component = Z component
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::Set(T scale)
|
Vector3<T>& Vector3<T>::Set(T scale)
|
||||||
{
|
{
|
||||||
|
|
@ -552,7 +519,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \param vec[3] vec[0] is X component, vec[1] is Y component and vec[2] is Z component
|
* \param vec[3] vec[0] is X component, vec[1] is Y component and vec[2] is Z component
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::Set(const T vec[3])
|
Vector3<T>& Vector3<T>::Set(const T vec[3])
|
||||||
{
|
{
|
||||||
|
|
@ -567,7 +533,6 @@ namespace Nz
|
||||||
* \param vec vec.X = X component and vec.y = Y component
|
* \param vec vec.X = X component and vec.y = Y component
|
||||||
* \param Z Z component
|
* \param Z Z component
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::Set(const Vector2<T>& vec, T Z)
|
Vector3<T>& Vector3<T>::Set(const Vector2<T>& vec, T Z)
|
||||||
{
|
{
|
||||||
|
|
@ -584,7 +549,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \param vec The other vector
|
* \param vec The other vector
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::Set(const Vector3& vec)
|
Vector3<T>& Vector3<T>::Set(const Vector3& vec)
|
||||||
{
|
{
|
||||||
|
|
@ -599,7 +563,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \param vec Vector of type U to convert its components
|
* \param vec Vector of type U to convert its components
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
template<typename U>
|
template<typename U>
|
||||||
Vector3<T>& Vector3<T>::Set(const Vector3<U>& vec)
|
Vector3<T>& Vector3<T>::Set(const Vector3<U>& vec)
|
||||||
|
|
@ -617,7 +580,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \param vec Vector4 where only the first three components are taken
|
* \param vec Vector4 where only the first three components are taken
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::Set(const Vector4<T>& vec)
|
Vector3<T>& Vector3<T>::Set(const Vector4<T>& vec)
|
||||||
{
|
{
|
||||||
|
|
@ -636,7 +598,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see Distance
|
* \see Distance
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T Vector3<T>::SquaredDistance(const Vector3& vec) const
|
T Vector3<T>::SquaredDistance(const Vector3& vec) const
|
||||||
{
|
{
|
||||||
|
|
@ -647,7 +608,6 @@ namespace Nz
|
||||||
* \brief Gives a string representation
|
* \brief Gives a string representation
|
||||||
* \return A string representation of the object: "Vector3(x, y, z)"
|
* \return A string representation of the object: "Vector3(x, y, z)"
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
String Vector3<T>::ToString() const
|
String Vector3<T>::ToString() const
|
||||||
{
|
{
|
||||||
|
|
@ -662,7 +622,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \remark Access to index greather than 2 is undefined behavior
|
* \remark Access to index greather than 2 is undefined behavior
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>::operator T* ()
|
Vector3<T>::operator T* ()
|
||||||
{
|
{
|
||||||
|
|
@ -675,7 +634,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \remark Access to index greather than 2 is undefined behavior
|
* \remark Access to index greather than 2 is undefined behavior
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>::operator const T* () const
|
Vector3<T>::operator const T* () const
|
||||||
{
|
{
|
||||||
|
|
@ -686,7 +644,6 @@ namespace Nz
|
||||||
* \brief Helps to represent the sign of the vector
|
* \brief Helps to represent the sign of the vector
|
||||||
* \return A constant reference to this vector
|
* \return A constant reference to this vector
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
const Vector3<T>& Vector3<T>::operator+() const
|
const Vector3<T>& Vector3<T>::operator+() const
|
||||||
{
|
{
|
||||||
|
|
@ -697,7 +654,6 @@ namespace Nz
|
||||||
* \brief Negates the components of the vector
|
* \brief Negates the components of the vector
|
||||||
* \return A constant reference to this vector with negate components
|
* \return A constant reference to this vector with negate components
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T> Vector3<T>::operator-() const
|
Vector3<T> Vector3<T>::operator-() const
|
||||||
{
|
{
|
||||||
|
|
@ -710,7 +666,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \param vec The other vector to add components with
|
* \param vec The other vector to add components with
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T> Vector3<T>::operator+(const Vector3& vec) const
|
Vector3<T> Vector3<T>::operator+(const Vector3& vec) const
|
||||||
{
|
{
|
||||||
|
|
@ -723,7 +678,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \param vec The other vector to substract components with
|
* \param vec The other vector to substract components with
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T> Vector3<T>::operator-(const Vector3& vec) const
|
Vector3<T> Vector3<T>::operator-(const Vector3& vec) const
|
||||||
{
|
{
|
||||||
|
|
@ -736,7 +690,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \param vec The other vector to multiply components with
|
* \param vec The other vector to multiply components with
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T> Vector3<T>::operator*(const Vector3& vec) const
|
Vector3<T> Vector3<T>::operator*(const Vector3& vec) const
|
||||||
{
|
{
|
||||||
|
|
@ -749,7 +702,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \param scale The scalar to multiply components with
|
* \param scale The scalar to multiply components with
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T> Vector3<T>::operator*(T scale) const
|
Vector3<T> Vector3<T>::operator*(T scale) const
|
||||||
{
|
{
|
||||||
|
|
@ -765,7 +717,6 @@ namespace Nz
|
||||||
* \remark Produce a NazaraError if one of the vec components is null with NAZARA_MATH_SAFE defined
|
* \remark Produce a NazaraError if one of the vec components is null with NAZARA_MATH_SAFE defined
|
||||||
* \throw std::domain_error if NAZARA_MATH_SAFE is defined and one of the vec components is null
|
* \throw std::domain_error if NAZARA_MATH_SAFE is defined and one of the vec components is null
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T> Vector3<T>::operator/(const Vector3& vec) const
|
Vector3<T> Vector3<T>::operator/(const Vector3& vec) const
|
||||||
{
|
{
|
||||||
|
|
@ -791,7 +742,6 @@ namespace Nz
|
||||||
* \remark Produce a NazaraError if scale is null with NAZARA_MATH_SAFE defined
|
* \remark Produce a NazaraError if scale is null with NAZARA_MATH_SAFE defined
|
||||||
* \throw std::domain_error if NAZARA_MATH_SAFE is defined and scale is null
|
* \throw std::domain_error if NAZARA_MATH_SAFE is defined and scale is null
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T> Vector3<T>::operator/(T scale) const
|
Vector3<T> Vector3<T>::operator/(T scale) const
|
||||||
{
|
{
|
||||||
|
|
@ -814,7 +764,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \param vec The other vector to add components with
|
* \param vec The other vector to add components with
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::operator+=(const Vector3& vec)
|
Vector3<T>& Vector3<T>::operator+=(const Vector3& vec)
|
||||||
{
|
{
|
||||||
|
|
@ -831,7 +780,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \param vec The other vector to substract components with
|
* \param vec The other vector to substract components with
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::operator-=(const Vector3& vec)
|
Vector3<T>& Vector3<T>::operator-=(const Vector3& vec)
|
||||||
{
|
{
|
||||||
|
|
@ -848,7 +796,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \param vec The other vector to multiply components with
|
* \param vec The other vector to multiply components with
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::operator*=(const Vector3& vec)
|
Vector3<T>& Vector3<T>::operator*=(const Vector3& vec)
|
||||||
{
|
{
|
||||||
|
|
@ -865,7 +812,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \param vec The other vector to multiply components with
|
* \param vec The other vector to multiply components with
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::operator*=(T scale)
|
Vector3<T>& Vector3<T>::operator*=(T scale)
|
||||||
{
|
{
|
||||||
|
|
@ -885,7 +831,6 @@ namespace Nz
|
||||||
* \remark Produce a NazaraError if one of the vec components is null with NAZARA_MATH_SAFE defined
|
* \remark Produce a NazaraError if one of the vec components is null with NAZARA_MATH_SAFE defined
|
||||||
* \throw std::domain_error if NAZARA_MATH_SAFE is defined and one of the vec components is null
|
* \throw std::domain_error if NAZARA_MATH_SAFE is defined and one of the vec components is null
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::operator/=(const Vector3& vec)
|
Vector3<T>& Vector3<T>::operator/=(const Vector3& vec)
|
||||||
{
|
{
|
||||||
|
|
@ -913,7 +858,6 @@ namespace Nz
|
||||||
* \remark Produce a NazaraError if scale is null with NAZARA_MATH_SAFE defined
|
* \remark Produce a NazaraError if scale is null with NAZARA_MATH_SAFE defined
|
||||||
* \throw std::domain_error if NAZARA_MATH_SAFE is defined and scale is null
|
* \throw std::domain_error if NAZARA_MATH_SAFE is defined and scale is null
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T>& Vector3<T>::operator/=(T scale)
|
Vector3<T>& Vector3<T>::operator/=(T scale)
|
||||||
{
|
{
|
||||||
|
|
@ -938,7 +882,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \param vec Other vector to compare with
|
* \param vec Other vector to compare with
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Vector3<T>::operator==(const Vector3& vec) const
|
bool Vector3<T>::operator==(const Vector3& vec) const
|
||||||
{
|
{
|
||||||
|
|
@ -953,7 +896,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \param vec Other vector to compare with
|
* \param vec Other vector to compare with
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Vector3<T>::operator!=(const Vector3& vec) const
|
bool Vector3<T>::operator!=(const Vector3& vec) const
|
||||||
{
|
{
|
||||||
|
|
@ -966,7 +908,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \param vec Other vector to compare with
|
* \param vec Other vector to compare with
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Vector3<T>::operator<(const Vector3& vec) const
|
bool Vector3<T>::operator<(const Vector3& vec) const
|
||||||
{
|
{
|
||||||
|
|
@ -987,7 +928,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \param vec Other vector to compare with
|
* \param vec Other vector to compare with
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Vector3<T>::operator<=(const Vector3& vec) const
|
bool Vector3<T>::operator<=(const Vector3& vec) const
|
||||||
{
|
{
|
||||||
|
|
@ -1008,7 +948,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \param vec Other vector to compare with
|
* \param vec Other vector to compare with
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Vector3<T>::operator>(const Vector3& vec) const
|
bool Vector3<T>::operator>(const Vector3& vec) const
|
||||||
{
|
{
|
||||||
|
|
@ -1021,7 +960,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \param vec Other vector to compare with
|
* \param vec Other vector to compare with
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool Vector3<T>::operator>=(const Vector3& vec) const
|
bool Vector3<T>::operator>=(const Vector3& vec) const
|
||||||
{
|
{
|
||||||
|
|
@ -1037,7 +975,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see CrossProduct
|
* \see CrossProduct
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T> Vector3<T>::CrossProduct(const Vector3& vec1, const Vector3& vec2)
|
Vector3<T> Vector3<T>::CrossProduct(const Vector3& vec1, const Vector3& vec2)
|
||||||
{
|
{
|
||||||
|
|
@ -1053,7 +990,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see AbsDotProduct, DotProduct
|
* \see AbsDotProduct, DotProduct
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T Vector3<T>::DotProduct(const Vector3& vec1, const Vector3& vec2)
|
T Vector3<T>::DotProduct(const Vector3& vec1, const Vector3& vec2)
|
||||||
{
|
{
|
||||||
|
|
@ -1066,7 +1002,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see MakeBackward
|
* \see MakeBackward
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T> Vector3<T>::Backward()
|
Vector3<T> Vector3<T>::Backward()
|
||||||
{
|
{
|
||||||
|
|
@ -1082,7 +1017,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see MakeDown
|
* \see MakeDown
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T> Vector3<T>::Down()
|
Vector3<T> Vector3<T>::Down()
|
||||||
{
|
{
|
||||||
|
|
@ -1098,7 +1032,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see Forward
|
* \see Forward
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T> Vector3<T>::Forward()
|
Vector3<T> Vector3<T>::Forward()
|
||||||
{
|
{
|
||||||
|
|
@ -1114,7 +1047,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see MakeLeft
|
* \see MakeLeft
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T> Vector3<T>::Left()
|
Vector3<T> Vector3<T>::Left()
|
||||||
{
|
{
|
||||||
|
|
@ -1136,7 +1068,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see Lerp
|
* \see Lerp
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T> Vector3<T>::Lerp(const Vector3& from, const Vector3& to, T interpolation)
|
Vector3<T> Vector3<T>::Lerp(const Vector3& from, const Vector3& to, T interpolation)
|
||||||
{
|
{
|
||||||
|
|
@ -1158,7 +1089,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see GetNormal
|
* \see GetNormal
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T> Vector3<T>::Normalize(const Vector3& vec)
|
Vector3<T> Vector3<T>::Normalize(const Vector3& vec)
|
||||||
{
|
{
|
||||||
|
|
@ -1171,7 +1101,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see MakeRight
|
* \see MakeRight
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T> Vector3<T>::Right()
|
Vector3<T> Vector3<T>::Right()
|
||||||
{
|
{
|
||||||
|
|
@ -1187,7 +1116,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see MakeUnit
|
* \see MakeUnit
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T> Vector3<T>::Unit()
|
Vector3<T> Vector3<T>::Unit()
|
||||||
{
|
{
|
||||||
|
|
@ -1203,7 +1131,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see MakeUnitX
|
* \see MakeUnitX
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T> Vector3<T>::UnitX()
|
Vector3<T> Vector3<T>::UnitX()
|
||||||
{
|
{
|
||||||
|
|
@ -1219,7 +1146,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see MakeUnitY
|
* \see MakeUnitY
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T> Vector3<T>::UnitY()
|
Vector3<T> Vector3<T>::UnitY()
|
||||||
{
|
{
|
||||||
|
|
@ -1235,7 +1161,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see MakeUnitZ
|
* \see MakeUnitZ
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T> Vector3<T>::UnitZ()
|
Vector3<T> Vector3<T>::UnitZ()
|
||||||
{
|
{
|
||||||
|
|
@ -1251,7 +1176,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see MakeUp
|
* \see MakeUp
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T> Vector3<T>::Up()
|
Vector3<T> Vector3<T>::Up()
|
||||||
{
|
{
|
||||||
|
|
@ -1267,7 +1191,6 @@ namespace Nz
|
||||||
*
|
*
|
||||||
* \see MakeZero
|
* \see MakeZero
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Vector3<T> Vector3<T>::Zero()
|
Vector3<T> Vector3<T>::Zero()
|
||||||
{
|
{
|
||||||
|
|
@ -1276,6 +1199,50 @@ namespace Nz
|
||||||
|
|
||||||
return vector;
|
return vector;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Serializes a Vector3
|
||||||
|
* \return true if successfully serialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param vector Input Vector3
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Serialize(SerializationContext& context, const Vector3<T>& vector)
|
||||||
|
{
|
||||||
|
if (!Serialize(context, vector.x))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, vector.y))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, vector.z))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Unserializes a Vector3
|
||||||
|
* \return true if successfully unserialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param vector Output Vector3
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Unserialize(SerializationContext& context, Vector3<T>* vector)
|
||||||
|
{
|
||||||
|
if (!Unserialize(context, &vector->x))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &vector->y))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &vector->z))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
|
struct SerializationContext;
|
||||||
|
|
||||||
template<typename T> class Vector2;
|
template<typename T> class Vector2;
|
||||||
template<typename T> class Vector3;
|
template<typename T> class Vector3;
|
||||||
|
|
||||||
|
|
@ -104,6 +106,9 @@ namespace Nz
|
||||||
typedef Vector4<unsigned int> Vector4ui;
|
typedef Vector4<unsigned int> Vector4ui;
|
||||||
typedef Vector4<Int32> Vector4i32;
|
typedef Vector4<Int32> Vector4i32;
|
||||||
typedef Vector4<UInt32> Vector4ui32;
|
typedef Vector4<UInt32> Vector4ui32;
|
||||||
|
|
||||||
|
template<typename T> bool Serialize(SerializationContext& context, const Vector4<T>& vector);
|
||||||
|
template<typename T> bool Unserialize(SerializationContext& context, Vector4<T>* vector);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Vector4<T>& vec);
|
template<typename T> std::ostream& operator<<(std::ostream& out, const Nz::Vector4<T>& vec);
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
// This file is part of the "Nazara Engine - Mathematics module"
|
// This file is part of the "Nazara Engine - Mathematics module"
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
|
#include <Nazara/Core/Algorithm.hpp>
|
||||||
#include <Nazara/Core/StringStream.hpp>
|
#include <Nazara/Core/StringStream.hpp>
|
||||||
#include <Nazara/Math/Algorithm.hpp>
|
#include <Nazara/Math/Algorithm.hpp>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
@ -1013,6 +1014,56 @@ namespace Nz
|
||||||
|
|
||||||
return vector;
|
return vector;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Serializes a Vector4
|
||||||
|
* \return true if successfully serialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param vector Input Vector3
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Serialize(SerializationContext& context, const Vector4<T>& vector)
|
||||||
|
{
|
||||||
|
if (!Serialize(context, vector.x))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, vector.y))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, vector.z))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Serialize(context, vector.w))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Unserializes a Vector4
|
||||||
|
* \return true if successfully unserialized
|
||||||
|
*
|
||||||
|
* \param context Serialization context
|
||||||
|
* \param vector Output Vector3
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
bool Unserialize(SerializationContext& context, Vector4<T>* vector)
|
||||||
|
{
|
||||||
|
if (!Unserialize(context, &vector->x))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &vector->y))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &vector->z))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!Unserialize(context, &vector->w))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue