//===========================================================================// // File: motion.cc // // Project: MUNGA Brick: Math Library // // Contents: Implementation details for the position class // //---------------------------------------------------------------------------// // Date Who Modification // // -------- --- ---------------------------------------------------------- // // 01/19/95 JMA Initial coding. // // 01/29/95 JMA Added origin concatenation // //---------------------------------------------------------------------------// // Copyright (C) 1995, Virtual World Entertainment, Inc. // // All Rights reserved worldwide // // This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL // //===========================================================================// #include #pragma hdrstop #if !defined(MOTION_HPP) #include #endif 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; } // //########################################################################### //########################################################################### // ostream& operator<<( ostream& stream, const Motion& p ) { return stream << '{' << p.linearMotion << ',' << p.angularMotion << '}'; } // //########################################################################### //########################################################################### // Logical Motion::TestInstance() const { return angularMotion.TestInstance(); }