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>
174 lines
3.5 KiB
C++
174 lines
3.5 KiB
C++
#pragma once
|
|
|
|
#include "plug.h"
|
|
#include "origin.h"
|
|
#include "rotation.h"
|
|
#include "linmtrx.h"
|
|
|
|
class NotationFile;
|
|
|
|
struct CameraInstance__StreamedInstance
|
|
{
|
|
size_t instanceSize;
|
|
int
|
|
cameraType,
|
|
cameraID;
|
|
Origin
|
|
localOrigin;
|
|
Radian
|
|
clampValues[4];
|
|
};
|
|
|
|
//##########################################################################
|
|
//############################# CameraInstance #######################
|
|
//##########################################################################
|
|
|
|
class CameraInstance :
|
|
public Plug
|
|
{
|
|
friend class CameraInstanceManager;
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// local member data
|
|
//
|
|
public:
|
|
|
|
enum {
|
|
ErrorCameraType,
|
|
DefaultCameraType,
|
|
AlwaysSeesCameraType,
|
|
CameraTypeCount,
|
|
};
|
|
|
|
Radian
|
|
clampValues[4];
|
|
|
|
protected:
|
|
Origin
|
|
localOrigin;
|
|
LinearMatrix
|
|
cameraToWorld;
|
|
|
|
static int
|
|
FindCameraType(const char *camera_data_type);
|
|
|
|
void
|
|
GetCameraTypeString(char *camera_type_string);
|
|
|
|
Enumeration
|
|
cameraDataType;
|
|
|
|
int
|
|
cameraID;
|
|
|
|
char
|
|
cameraName[128];
|
|
|
|
void
|
|
CalculateCameraRotation(
|
|
YawPitchRoll *result,
|
|
const Point3D &world
|
|
);
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// public member data access functions
|
|
//
|
|
public:
|
|
int
|
|
GetCameraID()
|
|
{Check(this); return cameraID;}
|
|
|
|
const char*
|
|
GetCameraName()
|
|
{Check(this); return cameraName;}
|
|
void
|
|
SetCameraName(const char* camera_name)
|
|
{Str_Copy(cameraName, camera_name, sizeof(cameraName));}
|
|
|
|
const Enumeration
|
|
GetCameraType()
|
|
{Check(this); return cameraDataType;}
|
|
|
|
const Origin&
|
|
GetLocalOrigin()
|
|
{Check(this); return localOrigin;}
|
|
void
|
|
SetLocalOrigin(const Origin &new_origin);
|
|
const Point3D&
|
|
GetPosition()
|
|
{Check(this); return localOrigin.linearPosition;}
|
|
|
|
void
|
|
LookAt(
|
|
Origin *result,
|
|
const Point3D &world_point
|
|
);
|
|
void
|
|
AllowLookingAt(const Point3D &world);
|
|
|
|
virtual Logical
|
|
CanCameraSee(const Point3D &world_point);
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Test Class Support
|
|
//
|
|
public:
|
|
Logical
|
|
TestInstance() const;
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Contruction and Destruction Support
|
|
//
|
|
public:
|
|
typedef CameraInstance__StreamedInstance StreamedInstance;
|
|
|
|
CameraInstance(
|
|
int camera_ID,
|
|
const Origin &camera_origin,
|
|
Enumeration camera_type = DefaultCameraType
|
|
);
|
|
CameraInstance(StreamedInstance *model);
|
|
CameraInstance(
|
|
NotationFile *cam_file,
|
|
const char *camera_page_name
|
|
);
|
|
|
|
~CameraInstance();
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Tool Support
|
|
//
|
|
public:
|
|
void
|
|
WriteNotationPage(NotationFile *camera_stream);
|
|
static Logical
|
|
CreateStreamedInstance(
|
|
StreamedInstance *model,
|
|
NotationFile *cam_file,
|
|
const char *camera_page_name
|
|
);
|
|
};
|
|
|
|
//##########################################################################
|
|
//############################# CameraInstance #######################
|
|
//##########################################################################
|
|
|
|
class AlwaysSeesCameraInstance :
|
|
public CameraInstance
|
|
{
|
|
public:
|
|
AlwaysSeesCameraInstance(
|
|
int camera_ID,
|
|
const Origin &camera_origin,
|
|
Enumeration camera_type = DefaultCameraType
|
|
);
|
|
AlwaysSeesCameraInstance(StreamedInstance *model);
|
|
AlwaysSeesCameraInstance(
|
|
NotationFile *cam_file,
|
|
const char *camera_page_name
|
|
);
|
|
|
|
Logical
|
|
CanCameraSee(const Point3D &world_point);
|
|
};
|