Clean, self-contained extraction of the BattleTech-specific work from the
reverse-engineering workspace -- engine + game + content + build, with nothing
from Red Planet or the raw archive dumps. Builds green (Win32) and runs the
single-player drive->animate->target->fire->damage->destroy loop out of the box.
Layout:
engine/ MUNGA + MUNGA_L4 shared 2007 engine, carrying our BT render/loader
work (bgfload/L4D3D/L4VIDEO: BSL bit-slice decode, LOD/ground/shadow
models) + image codec; the minimal rp/ headers the audio HAL needs
game/ reconstructed BT logic + surviving-original BT source + fwd shims
+ WinMain launcher
content/ full runtime tree (BTL4.RES, VIDEO/, GAUGE/, AUDIO/, eggs, BTDPL.INI)
docs/ format specs + reconstruction ledgers
reference/ raw Ghidra pseudocode (recon source-of-truth) + decomp exporter
tools/ MP console emulator + map/resource scanners
One top-level CMake builds munga_engine lib + bt410_l4 game lib + btl4.exe.
All paths relativized (186 fwd shims + ~437 CMake abs paths -> repo-relative);
DXSDK is the one external, overridable via -DDXSDK. Verified: builds to a
byte-identical 2.27MB exe and runs combat (TARGET DESTROYED, 0 crashes) against
the bundled content.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
126 lines
2.3 KiB
C++
126 lines
2.3 KiB
C++
#pragma once
|
|
|
|
#include "vector3d.h"
|
|
|
|
class Origin;
|
|
class Vector4D;
|
|
class AffineMatrix;
|
|
|
|
class Point3D : public Vector3D
|
|
{
|
|
public:
|
|
static const Point3D Identity;
|
|
|
|
Point3D() {}
|
|
Point3D(Scalar x, Scalar y, Scalar z) : Vector3D(x, y, z) {}
|
|
|
|
Point3D& operator=(const Vector3D& v)
|
|
{
|
|
Vector3D::operator =(v);
|
|
return *this;
|
|
}
|
|
Point3D& operator=(const Vector4D& v);
|
|
Point3D& operator=(const Origin &p);
|
|
Point3D& operator=(const AffineMatrix &matrix);
|
|
|
|
Point3D& Negate(const Vector3D &v)
|
|
{
|
|
Vector3D::Negate(v);
|
|
return *this;
|
|
}
|
|
|
|
Point3D& Add(const Vector3D& v1, const Vector3D& v2)
|
|
{
|
|
Vector3D::Add(v1, v2);
|
|
return *this;
|
|
}
|
|
Point3D& operator+=(const Vector3D& v)
|
|
{
|
|
return Add(*this, v);
|
|
}
|
|
|
|
Point3D& Subtract(const Point3D& p, const Vector3D& v)
|
|
{
|
|
Vector3D::Subtract(p, v);
|
|
return *this;
|
|
}
|
|
Point3D& operator-=(const Vector3D& v)
|
|
{
|
|
return Subtract(*this, v);
|
|
}
|
|
|
|
Scalar operator*(const Vector3D& v) const
|
|
{
|
|
return Vector3D::operator*(v);
|
|
}
|
|
|
|
Point3D& Multiply(const Point3D& p, Scalar scale)
|
|
{
|
|
Vector3D::Multiply(p, scale);
|
|
return *this;
|
|
}
|
|
Point3D& operator *=(Scalar value)
|
|
{
|
|
return Multiply(*this, value);
|
|
}
|
|
|
|
Point3D& Multiply(const Point3D& p, const Vector3D& v)
|
|
{
|
|
Vector3D::Multiply(p, v);
|
|
return *this;
|
|
}
|
|
Point3D& operator*=(const Vector3D &v)
|
|
{
|
|
return Multiply(*this, v);
|
|
}
|
|
|
|
Point3D& Divide(const Vector3D& v, Scalar scale)
|
|
{
|
|
Vector3D::Divide(v, scale);
|
|
return *this;
|
|
}
|
|
|
|
Point3D& Divide(const Vector3D& v1, const Vector3D& v2)
|
|
{
|
|
Vector3D::Divide(v1, v2);
|
|
return *this;
|
|
}
|
|
Point3D& operator/=(const Vector3D &v)
|
|
{
|
|
return Divide(*this, v);
|
|
}
|
|
|
|
Point3D& Multiply(const Vector3D &v, const AffineMatrix &m)
|
|
{
|
|
Vector3D::Multiply(v, m);
|
|
return *this;
|
|
}
|
|
Point3D& Multiply(const Point3D &p, const AffineMatrix &m);
|
|
Point3D& operator*=(const AffineMatrix &m)
|
|
{
|
|
Point3D src(*this);
|
|
return Multiply(src, m);
|
|
}
|
|
Point3D& MultiplyByInverse(const Vector3D &v, const LinearMatrix &m)
|
|
{
|
|
Vector3D::MultiplyByInverse(v, m);
|
|
return *this;
|
|
}
|
|
Point3D& MultiplyByInverse(const Point3D &p, const LinearMatrix &m);
|
|
|
|
Point3D& Combine(const Vector3D& v1, Scalar t1, const Vector3D& v2, Scalar t2)
|
|
{
|
|
Vector3D::Combine(v1, t1, v2, t2);
|
|
return *this;
|
|
}
|
|
|
|
Point3D& Lerp(const Vector3D& v1, const Vector3D& v2, Scalar t)
|
|
{
|
|
Vector3D::Lerp(v1, v2, t);
|
|
return *this;
|
|
}
|
|
|
|
static Logical TestClass();
|
|
};
|
|
|
|
#include "affnmtrx.h" |