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>
134 lines
3.4 KiB
C++
134 lines
3.4 KiB
C++
//===========================================================================//
|
|
// File: origin.hh //
|
|
// Project: MUNGA Brick: Math Library //
|
|
// Contents: Implementation details for the position class //
|
|
//---------------------------------------------------------------------------//
|
|
// Date Who Modification //
|
|
// -------- --- ---------------------------------------------------------- //
|
|
// 11/19/94 JMA Initial coding. //
|
|
// 11/29/94 JMA Added origin concatenation //
|
|
//---------------------------------------------------------------------------//
|
|
// Copyright (C) 1994-1995, Virtual World Entertainment, Inc. //
|
|
// All Rights reserved worldwide //
|
|
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
|
|
//===========================================================================//
|
|
|
|
#if !defined(ORIGIN_HPP)
|
|
# define ORIGIN_HPP
|
|
|
|
# if !defined(POINT3D_HPP)
|
|
# include <point3d.hpp>
|
|
# endif
|
|
|
|
# if !defined(ROTATION_HPP)
|
|
# include <rotation.hpp>
|
|
# endif
|
|
|
|
class Motion;
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Origin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
class Origin
|
|
{
|
|
#if defined(USE_SIGNATURE)
|
|
friend int
|
|
Is_Signature_Bad(const volatile Origin *);
|
|
#endif
|
|
|
|
public:
|
|
Point3D
|
|
linearPosition;
|
|
Quaternion
|
|
angularPosition;
|
|
|
|
static const Origin
|
|
Identity;
|
|
|
|
//
|
|
// Constructors
|
|
//
|
|
Origin()
|
|
{}
|
|
Origin(
|
|
const Point3D &t,
|
|
const EulerAngles& q
|
|
)
|
|
{Check(&t); Check(&q); linearPosition = t; angularPosition = q;}
|
|
Origin(
|
|
const Point3D &t,
|
|
const Quaternion& q
|
|
)
|
|
{Check(&t); Check(&q); linearPosition = t; angularPosition = q;}
|
|
Origin(const LinearMatrix &matrix);
|
|
|
|
//
|
|
// Assignment operators
|
|
//
|
|
Origin&
|
|
operator=(const Origin& p);
|
|
Origin&
|
|
operator=(const Point3D& p)
|
|
{Check_Pointer(this); Check(&p); linearPosition = p; return *this;}
|
|
Origin&
|
|
operator=(const EulerAngles& q)
|
|
{Check_Pointer(this); Check(&q); angularPosition = q; return *this;}
|
|
Origin&
|
|
operator=(const YawPitchRoll& q)
|
|
{Check_Pointer(this); Check(&q); angularPosition = q; return *this;}
|
|
Origin&
|
|
operator=(const Quaternion& q)
|
|
{Check_Pointer(this); Check(&q); angularPosition = q; return *this;}
|
|
Origin&
|
|
operator=(const LinearMatrix &m);
|
|
|
|
//
|
|
// Equality operator
|
|
//
|
|
Logical
|
|
operator==(const Origin&) const;
|
|
|
|
//
|
|
// Origin motion
|
|
//
|
|
Origin&
|
|
AddScaled(
|
|
const Origin& source,
|
|
const Motion& delta,
|
|
Scalar t
|
|
);
|
|
Origin&
|
|
Lerp(
|
|
const Origin& start,
|
|
const Origin& end,
|
|
Scalar t
|
|
);
|
|
|
|
//
|
|
// Support functions
|
|
//
|
|
friend ostream&
|
|
operator<<(
|
|
ostream& stream,
|
|
const Origin& p
|
|
);
|
|
Logical
|
|
TestInstance() const;
|
|
static Logical
|
|
TestClass();
|
|
};
|
|
|
|
inline Point3D&
|
|
Point3D::operator=(const Origin& p)
|
|
{return operator=(p.linearPosition);}
|
|
|
|
inline EulerAngles&
|
|
EulerAngles::operator=(const Origin& p)
|
|
{return operator=(p.angularPosition);}
|
|
|
|
inline Quaternion&
|
|
Quaternion::operator=(const Origin& p)
|
|
{return operator=(p.angularPosition);}
|
|
|
|
#endif
|
|
|