interface/urho3d_cereal.h: Vector3
This commit is contained in:
parent
1e3e0ea85e
commit
d3a74d7826
@ -4,6 +4,7 @@
|
|||||||
#include "core/types.h"
|
#include "core/types.h"
|
||||||
#include <cereal/cereal.hpp>
|
#include <cereal/cereal.hpp>
|
||||||
#include <Vector2.h>
|
#include <Vector2.h>
|
||||||
|
#include <Vector3.h>
|
||||||
#include <Ptr.h>
|
#include <Ptr.h>
|
||||||
|
|
||||||
namespace cereal
|
namespace cereal
|
||||||
@ -22,5 +23,21 @@ namespace cereal
|
|||||||
v.x_ = x;
|
v.x_ = x;
|
||||||
v.y_ = y;
|
v.y_ = y;
|
||||||
}
|
}
|
||||||
|
template<class Archive>
|
||||||
|
void save(Archive &archive, const Urho3D::Vector3 &v)
|
||||||
|
{
|
||||||
|
archive((double)v.x_);
|
||||||
|
archive((double)v.y_);
|
||||||
|
archive((double)v.z_);
|
||||||
|
}
|
||||||
|
template<class Archive>
|
||||||
|
void load(Archive &archive, Urho3D::Vector3 &v)
|
||||||
|
{
|
||||||
|
double x, y, z;
|
||||||
|
archive(x, y, z);
|
||||||
|
v.x_ = x;
|
||||||
|
v.y_ = y;
|
||||||
|
v.z_ = z;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// vim: set noet ts=4 sw=4:
|
// vim: set noet ts=4 sw=4:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user