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>
104 lines
1.9 KiB
C++
104 lines
1.9 KiB
C++
//###########################################################################
|
|
//
|
|
// $Workfile: RAY.HPP $
|
|
// $Revision: 1.5 $
|
|
// $Modtime: 14 May 1996 20:06:14 $
|
|
//
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// 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
|