Files
CydandClaude Opus 4.8 4abbf8879f Initial import of Red Planet v4.10 Win32 source
Imports the current Win32 source for the pod-racing game 'Red Planet',
built on the MUNGA engine and its L4 (Win32/DirectX) platform layer:

- MUNGA / MUNGA_L4: cross-platform engine core and Win32 backend
- RP / RP_L4: Red Planet game logic and Win32 application
- DivLoader, Setup1: asset loader and installer project
- lib, MUNGA_L4/openal, MUNGA_L4/sos: third-party audio dependencies

Removed stale Subversion metadata and added .gitignore/.gitattributes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 07:59:51 -05:00

48 lines
1.1 KiB
C++

#pragma once
#include "point3d.h"
#include "unitvec.h"
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);