Files
TeslaRel410/CODE/BT/BT_L4/BTL4ARND.CPP
T
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

186 lines
4.9 KiB
C++

//===========================================================================//
// File: btl4arnd.cc //
// Project: MUNGA Brick: Audio Renderer Manager //
// Contents: //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 01/30/95 ECH Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1994, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#include <btl4.hpp>
#pragma hdrstop
#if !defined(BTL4ARND_HPP)
# include <btl4arnd.hpp>
#endif
#if !defined(JMOVER_HPP)
# include <jmover.hpp>
#endif
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BTL4AudioHead ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//#############################################################################
//#############################################################################
//
BTL4AudioHead::BTL4AudioHead():
earToWorld(LinearMatrix::Identity)
{
useEyepointSegment = False;
eyepointSegment = NULL;
Check_Fpu();
}
//
//#############################################################################
//#############################################################################
//
BTL4AudioHead::~BTL4AudioHead()
{
Check_Fpu();
}
//
//#############################################################################
//#############################################################################
//
void
BTL4AudioHead::LinkToEntity(Entity *entity)
{
Check(this);
Check(entity);
//
// Call inherited method
//
AudioHead::LinkToEntity(entity);
#if 0
//
// Find segment containing eyepoint
//
JointedMover *jointed_mover;
jointed_mover = Cast_Object(JointedMover*, entity);
eyepointSegment = jointed_mover->GetSegment("siteeyepoint");
Check(eyepointSegment);
CalculateEarToWorld();
#else
useEyepointSegment = False;
if (entity->IsDerivedFrom(JointedMover::ClassDerivations))
{
//
// Find segment containing eyepoint
//
JointedMover *jointed_mover;
jointed_mover = Cast_Object(JointedMover*, entity);
if ((eyepointSegment = jointed_mover->GetSegment("siteeyepoint")) != NULL)
{
Check(eyepointSegment);
useEyepointSegment = True;
CalculateEarToWorld();
}
}
#endif
Check_Fpu();
}
//
//#############################################################################
//#############################################################################
//
void
BTL4AudioHead::CalculateEarToWorld()
{
Check(this);
if (useEyepointSegment)
{
Verify(GetHeadEntity()->IsDerivedFrom(JointedMover::ClassDerivations));
JointedMover *jointed_mover = Cast_Object(JointedMover*, GetHeadEntity());
//
// Get the ear transform
//
jointed_mover->GetSegmentToWorld(*eyepointSegment, &earToWorld);
}
else
{
earToWorld = AudioHead::GetEarToWorld();
}
Check(&earToWorld);
Check_Fpu();
}
//
//#############################################################################
//#############################################################################
//
void
BTL4AudioHead::Execute()
{
Check(this);
AudioHead::Execute();
CalculateEarToWorld();
Check_Fpu();
}
//
//#############################################################################
//#############################################################################
//
LinearMatrix
BTL4AudioHead::GetEarToWorld()
{
Check(this);
Check_Fpu();
return earToWorld;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BTL4AudioRenderer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//#############################################################################
//#############################################################################
//
BTL4AudioRenderer::BTL4AudioRenderer(
RendererRate render_rate,
Logical mission_review_mode
):
L4AudioRenderer(
render_rate,
mission_review_mode
)
{
Check_Fpu();
}
//
//#############################################################################
//#############################################################################
//
BTL4AudioRenderer::~BTL4AudioRenderer()
{
Check_Fpu();
}
//
//#############################################################################
//#############################################################################
//
AudioHead*
BTL4AudioRenderer::MakeAudioHead()
{
Check_Fpu();
return new BTL4AudioHead;
}