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

102 lines
1.8 KiB
C++

//###########################################################################
//
// $Workfile: RAY.HPP $
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Copyright(c) 1993 J. M. Albertson - All Rights Reserved
//
//###########################################################################
#if !defined(RAY_HPP)
# define RAY_HPP
# if !defined(POINT3D_HPP)
# include <point3d.hpp>
# endif
# if !defined(UNITVEC_HPP)
# include <unitvec.hpp>
# endif
class Plane;
class Sphere;
class Cylinder;
class Cone;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ray ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class Ray SIGNATURED
{
public:
Point3D
origin;
UnitVector
direction;
Ray()
{}
Ray(
const Point3D &origin,
const UnitVector &direction
):
origin(origin),
direction(direction)
{}
//
// Ray projection functions
//
void
Project(
Scalar length,
Point3D *result
);
Scalar
LengthToClosestPointTo(const Point3D &point);
void
ClosestPointTo(
const Point3D &point,
Point3D *result
)
{
Check(this); Check(result); Check(&point);
Project(LengthToClosestPointTo(point),result);
}
//
// Ray intersection functions
//
Scalar
DistanceTo(
const Plane &plane,
Scalar *product
) const;
Scalar
DistanceTo(
const Sphere &sphere,
Scalar *penetration
) const;
//
// Test support
//
Logical
TestInstance() const;
static Logical
TestClass();
};
extern Scalar
Find_Closest_Approach(
const Point3D& origin1,
const Vector3D& velocity1,
Point3D *result1,
const Point3D& origin2,
const Vector3D& velocity2,
Point3D *result2,
Scalar *time,
Logical *constant
);
#endif