#include "munga.h" #pragma hdrstop #include "motion.h" const Motion Motion::Identity(Vector3D::Identity, Vector3D::Identity); #if defined(USE_SIGNATURE) int Is_Signature_Bad(const volatile Motion *) { return False; } #endif Motion::Motion(const Motion& motion) { Check_Pointer(this); Check(&motion); angularMotion = motion.angularMotion; linearMotion = motion.linearMotion; } // //########################################################################### //########################################################################### // Motion& Motion::operator=(const Motion &motion) { Check_Pointer(this); Check(&motion); angularMotion = motion.angularMotion; linearMotion = motion.linearMotion; return *this; } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Logical Motion::operator==(const Motion &motion) const { Check(this); return (memcmp(this, &motion, sizeof(Motion)) == 0); } // //########################################################################### //########################################################################### // Motion& Motion::AddScaled(const Motion& source, const Motion& delta, Scalar t) { Check_Pointer(this); Check(&source); Check(&delta); Verify(t >= 0.0f); linearMotion.AddScaled(source.linearMotion, delta.linearMotion, t); angularMotion.AddScaled(source.angularMotion, delta.angularMotion, t); return *this; } // //########################################################################### //########################################################################### // std::ostream& operator<<(std::ostream& stream, const Motion& p) { return stream << '{' << p.linearMotion << ',' << p.angularMotion << '}'; } // //########################################################################### //########################################################################### // Logical Motion::TestInstance() const { return angularMotion.TestInstance(); }