The class is designed as a general-purpose rotation/orientation class to make it easy to work with rotations and swap between math types as easily as possible.

This commit is contained in:
Areloch 2016-05-12 00:45:16 -05:00
parent a2e0b1a163
commit 383d27f2ec
7 changed files with 853 additions and 5 deletions

View file

@ -149,6 +149,20 @@ inline bool mathRead(Stream& stream, EaseF* e)
return success;
}
inline bool mathRead(Stream& stream, RotationF* e)
{
bool success = stream.read(&e->x);
success &= stream.read(&e->y);
success &= stream.read(&e->z);
success &= stream.read(&e->w);
U32 rotType;
success &= stream.read(&rotType);
e->mRotationType = (RotationF::RotationTypes)rotType;
return success;
}
//------------------------------------------------------------------------------
//-------------------------------------- WRITING
//
@ -263,5 +277,15 @@ inline bool mathWrite(Stream& stream, const EaseF& e)
return success;
}
inline bool mathWrite(Stream& stream, const RotationF& e)
{
bool success = stream.write(e.x);
success &= stream.write(e.y);
success &= stream.write(e.z);
success &= stream.write(e.w);
success &= stream.write(e.mRotationType);
return success;;
}
#endif //_MATHIO_H_