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>
151 lines
4.1 KiB
C++
151 lines
4.1 KiB
C++
//===========================================================================//
|
|
// File: mtrxstk.hh //
|
|
// Project: MUNGA Brick: Math Library //
|
|
// Contents: Interface specification for the matrix class //
|
|
//---------------------------------------------------------------------------//
|
|
// Date Who Modification //
|
|
// -------- --- ---------------------------------------------------------- //
|
|
// 11/21/94 JMA Initial coding. //
|
|
// 12/01/94 JMA Changed Matrix to Matrix4x4, based both matrix classes on //
|
|
// Matrix44Base //
|
|
//---------------------------------------------------------------------------//
|
|
// Copyright (C) 1994-1995, Virtual World Entertainment, Inc. //
|
|
// All Rights reserved worldwide //
|
|
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
|
|
//===========================================================================//
|
|
|
|
#if !defined(MTRXSTK_HPP)
|
|
# define MTRXSTK_HPP
|
|
|
|
# if !defined(MEMBLOCK_HPP)
|
|
# include <memblock.hpp>
|
|
# endif
|
|
|
|
# if !defined(MATRIX_HPP)
|
|
# include <matrix.hpp>
|
|
# endif
|
|
|
|
# if !defined(LINMTRX_HPP)
|
|
# include <linmtrx.hpp>
|
|
# endif
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~ AffineMatrixStack ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
class AffineMatrixStack:
|
|
public MemoryStack
|
|
{
|
|
public:
|
|
AffineMatrixStack(
|
|
size_t start,
|
|
size_t delta
|
|
):
|
|
MemoryStack(sizeof(AffineMatrix),start,delta)
|
|
{}
|
|
|
|
AffineMatrix*
|
|
Peek()
|
|
{
|
|
Check(this);
|
|
return Cast_Object(AffineMatrix*,MemoryStack::Peek());
|
|
}
|
|
|
|
AffineMatrixStack&
|
|
Concatenate(const AffineMatrix& matrix);
|
|
AffineMatrixStack&
|
|
operator*=(const AffineMatrix& matrix)
|
|
{Check(this); Check(&matrix); return Concatenate(matrix);}
|
|
|
|
AffineMatrix&
|
|
Push(const AffineMatrix& matrix)
|
|
{
|
|
Check(this); Check(&matrix);
|
|
return *Cast_Object(AffineMatrix*,MemoryStack::Push(&matrix));
|
|
}
|
|
|
|
operator AffineMatrix&()
|
|
{Check(this); return *Peek();}
|
|
};
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~ LinearMatrixStack ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
class LinearMatrixStack:
|
|
public MemoryStack
|
|
{
|
|
public:
|
|
LinearMatrixStack(
|
|
size_t start,
|
|
size_t delta
|
|
):
|
|
MemoryStack(sizeof(LinearMatrix),start,delta)
|
|
{}
|
|
|
|
LinearMatrix*
|
|
Peek()
|
|
{
|
|
Check(this);
|
|
return Cast_Object(LinearMatrix*,MemoryStack::Peek());
|
|
}
|
|
|
|
LinearMatrixStack&
|
|
Concatenate(const LinearMatrix& matrix);
|
|
LinearMatrixStack&
|
|
operator*=(const LinearMatrix& matrix)
|
|
{Check(this); Check(&matrix); return Concatenate(matrix);}
|
|
|
|
LinearMatrix&
|
|
Push(const LinearMatrix& matrix)
|
|
{
|
|
Check(this); Check(&matrix);
|
|
return *Cast_Object(LinearMatrix*,MemoryStack::Push(&matrix));
|
|
}
|
|
|
|
operator LinearMatrix&()
|
|
{Check(this); return *Peek();}
|
|
};
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~ Matrix4x4Stack ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
class Matrix4x4Stack:
|
|
public MemoryStack
|
|
{
|
|
public:
|
|
Matrix4x4Stack(
|
|
size_t start,
|
|
size_t delta
|
|
):
|
|
MemoryStack(sizeof(Matrix4x4),start,delta)
|
|
{}
|
|
|
|
Matrix4x4*
|
|
Peek()
|
|
{
|
|
Check(this);
|
|
return Cast_Object(Matrix4x4*,MemoryStack::Peek());
|
|
}
|
|
|
|
Matrix4x4Stack&
|
|
Concatenate(const Matrix4x4& matrix);
|
|
Matrix4x4Stack&
|
|
Concatenate(const AffineMatrix& matrix);
|
|
Matrix4x4Stack&
|
|
operator*=(const Matrix4x4& matrix)
|
|
{Check(this); Check(&matrix); return Concatenate(matrix);}
|
|
Matrix4x4Stack&
|
|
operator*=(const AffineMatrix& matrix)
|
|
{Check(this); Check(&matrix); return Concatenate(matrix);}
|
|
|
|
Matrix4x4&
|
|
Push(const Matrix4x4& matrix)
|
|
{
|
|
Check(this); Check(&matrix);
|
|
return *Cast_Object(Matrix4x4*,MemoryStack::Push(&matrix));
|
|
}
|
|
Matrix4x4&
|
|
Push(const AffineMatrix& matrix);
|
|
|
|
operator Matrix4x4&()
|
|
{Check(this); return *Peek();}
|
|
};
|
|
|
|
#endif
|