Imports the current Win32 source for the pod-racing game 'Red Planet', built on the MUNGA engine and its L4 (Win32/DirectX) platform layer: - MUNGA / MUNGA_L4: cross-platform engine core and Win32 backend - RP / RP_L4: Red Planet game logic and Win32 application - DivLoader, Setup1: asset loader and installer project - lib, MUNGA_L4/openal, MUNGA_L4/sos: third-party audio dependencies Removed stale Subversion metadata and added .gitignore/.gitattributes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
81 lines
1.7 KiB
C++
81 lines
1.7 KiB
C++
#pragma once
|
|
|
|
#include "point3d.h"
|
|
#include "rotation.h"
|
|
|
|
class Motion;
|
|
|
|
class Origin
|
|
{
|
|
#if defined(USE_SIGNATURE)
|
|
friend int Is_Signature_Bad(const volatile Origin *);
|
|
#endif
|
|
|
|
public:
|
|
Point3D linearPosition;
|
|
Quaternion angularPosition;
|
|
|
|
static const Origin Identity;
|
|
|
|
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);
|
|
|
|
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);
|
|
|
|
Logical operator==(const Origin&) const;
|
|
|
|
Origin& AddScaled(const Origin& source, const Motion& delta, Scalar t);
|
|
Origin& Lerp(const Origin& start, const Origin& end, Scalar t);
|
|
|
|
friend std::ostream& operator<<(std::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); }
|