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

56 lines
1.7 KiB
C++

//=======================================================================//
// File: sphere.cpp //
// Project: Architecture //
// Author: J.M. Albertson //
//-----------------------------------------------------------------------//
// Copyright (C) 1994, Virtual World Entertainments, All Rights reserved //
// PROPRIETARY AND CONFIDENTIAL //
//=======================================================================//
#include <munga.hpp>
#pragma hdrstop
#if !defined(SPHERE_HPP)
# include <sphere.hpp>
#endif
//
//###########################################################################
//###########################################################################
//
Logical
Sphere::Contains(const Point3D &A_Point) const
{
Vector3D
diff;
diff.Subtract(center,A_Point);
return radius*radius >= diff.LengthSquared();
}
//
//###########################################################################
//###########################################################################
//
Logical
Sphere::Intersects(const Sphere &sphere) const
{
Vector3D temp;
Scalar r;
r = radius + sphere.radius;
temp.Subtract(center, sphere.center);
return temp.LengthSquared() <= r*r;
}
//
//###########################################################################
//###########################################################################
//
ostream&
operator<<(ostream& Stream, const Sphere &A_Sphere)
{
Stream << "\n\tSphere Centerpoint: " << A_Sphere.center;
return Stream << "\n\tRadius: " << A_Sphere.radius;
}