mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-10 22:24:33 +00:00
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:
parent
a2e0b1a163
commit
383d27f2ec
7 changed files with 853 additions and 5 deletions
|
|
@ -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_
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue