Files
TeslaRel410/CODE/RP/MUNGA/MOTION.CPP
T
CydandClaude Fable 5 fdd9ac9d97 Initial import: Tesla Release 4.10 (Tesla:BattleTech & Tesla:Red Planet)
Archival snapshot of the Virtual World Entertainment Tesla cockpit
software, 1994-1996: MUNGA engine and L4 pod layer source (Borland
C++ 5.0), BT/RP game code, and game content (models, audio, maps,
gauges, Division renderer data). Includes third-party libraries:
Division dVS/DPL graphics, HMI SOS audio, WATTCP networking.

Files are preserved byte-for-byte (.gitattributes disables all
line-ending conversion). README.md documents the layout, target
hardware, and toolchain.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 13:21:58 -05:00

111 lines
3.2 KiB
C++

//===========================================================================//
// 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 <munga.hpp>
#pragma hdrstop
#if !defined(MOTION_HPP)
#include <motion.hpp>
#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();
}