Files
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

178 lines
4.4 KiB
C++

//===========================================================================//
// File: bndgbox.hh //
// Project: MUNGA Brick: Spatializer Library //
// Contents: Interface specification of bounding-box based spatialization //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 01/08/95 JMA Initial port back to C++ //
//---------------------------------------------------------------------------//
// Copyright (C) 1993-1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(BOXLIST_HPP)
# define BOXLIST_HPP
# if !defined(BNDGBOX_HPP)
# include <bndgbox.hpp>
# endif
# if !defined(MEMBLOCK_HPP)
# include <memblock.hpp>
# endif
# if !defined(POINT3D_HPP)
# include <point3d.hpp>
# endif
//##########################################################################
//####################### BoundingBoxListNode ########################
//##########################################################################
class BoundingBoxList;
class BoxedSolidList;
class BoundingBoxTree;
class BoundingBoxListNode SIGNATURED
{
friend class BoundingBoxList;
friend class BoxedSolidList;
//##########################################################################
// Memory Allocation
//
private:
static MemoryBlock
AllocatedMemory;
void*
operator new(size_t)
{return AllocatedMemory.New();}
void
operator delete(void *where)
{AllocatedMemory.Delete(where);}
//##########################################################################
// Construction and Destruction
//
protected:
BoundingBox
*boundingBox;
BoundingBoxListNode
*previousNode;
BoundingBoxListNode(
BoundingBox *volume,
const ExtentBox &slice
):
boundingBox(volume),
solidSlice(slice),
previousNode(NULL)
{Check_Pointer(this); Check(volume);}
~BoundingBoxListNode()
{Check(this);}
public:
ExtentBox
solidSlice;
BoundingBox*
GetBoundingBox()
{Check(this); return boundingBox;}
BoundingBoxListNode*
GetNextNode()
{Check(this); return previousNode;}
//##########################################################################
// Test Support
//
public:
Logical
TestInstance() const;
};
//##########################################################################
//######################## BoundingBoxList ###########################
//##########################################################################
class BoundingBoxList SIGNATURED
{
//##########################################################################
// Construction and Destruction
//
protected:
BoundingBoxListNode
*root;
int
nodeCount;
int*
scoreBoard;
BoundingBox
**boundingBoxIndex;
Logical
isXMajorAxis;
public:
BoundingBoxList();
~BoundingBoxList();
void
Add(
BoundingBox* volume,
const ExtentBox &slice
);
void
Remove(BoundingBox* volume);
void
EraseList();
BoundingBoxListNode*
GetRoot()
{Check(this); return root;}
//##########################################################################
// Tree Traversal Functions
//
public:
BoundingBox*
FindBoundingBoxContaining(const Point3D &point);
void
FindBoundingBoxesContaining(
BoundingBox *volume,
BoundingBoxCollisionList &list
);
BoundingBox*
FindBoundingBoxUnder(
const Point3D &point,
Scalar *height
);
BoundingBox*
FindBoundingBoxHitBy(Line *line);
void
Reduce();
void
SortForTree();
protected:
void
Sort(
BoundingBoxList &active_solids,
ExtentBox &clipping_box,
BoundingBoxTree &tree_so_far
);
//##########################################################################
// Test Support
//
public:
Logical
TestInstance() const;
};
#endif