16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 20:39:18 +02:00

serializacja e3d

This commit is contained in:
VB
2017-02-26 18:40:00 +01:00
parent 62e9766962
commit fcf74abfa2
8 changed files with 284 additions and 225 deletions

View File

@@ -184,11 +184,12 @@ struct float8
class float4x4
{ // macierz transformacji pojedynczej precyzji
public:
float e[16];
public:
void deserialize_float32(std::istream &s);
void deserialize_float64(std::istream &s);
void deserialize_float32(std::istream&);
void deserialize_float64(std::istream&);
void serialize_float32(std::ostream&);
float4x4(void){};
float4x4(float f[16])
{
@@ -282,6 +283,16 @@ inline float4x4 &float4x4::Rotation(double angle, float3 axis)
return *this;
};
inline bool operator==(const float4x4& v1, const float4x4& v2)
{
for (size_t i = 0; i < 16; i++)
{
if (v1.e[i] != v2.e[i])
return false;
}
return true;
}
inline float4x4 operator*(const float4x4 &m1, const float4x4 &m2)
{ // iloczyn macierzy
float4x4 retVal;