//===========================================================================// // 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 #pragma hdrstop #if !defined(BTL4ARND_HPP) # include #endif #if !defined(JMOVER_HPP) # include #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; }