Rotate Newsvan dish when player is using the car

This commit is contained in:
Silent 2017-09-09 20:29:01 +02:00
parent 88de5b8f00
commit 5050c6510e
2 changed files with 24 additions and 2 deletions

View file

@ -9,7 +9,9 @@
static constexpr float PHOENIX_FLUTTER_PERIOD = 70.0f;
static constexpr float PHOENIX_FLUTTER_AMP = 0.13f;
static constexpr float SWEEPER_BRUSH_SPEED = 0.3f;
static constexpr float SWEEPER_BRUSH_SPEED = 0.3f;
static constexpr float PI = 3.14159265358979323846f;
std::vector<int32_t> vecRotorExceptions;
@ -298,6 +300,11 @@ void CAutomobile::PreRender()
{
ProcessSweeper();
}
if ( FLAUtils::GetExtendedID( &m_nModelIndex ) == 582 )
{
ProcessNewsvan();
}
}
void CAutomobile::Fix_SilentPatch()
@ -394,3 +401,14 @@ void CAutomobile::ProcessSweeper()
SetComponentRotation( m_pCarNode[21], ROT_AXIS_Z, -angle, false );
}
}
void CAutomobile::ProcessNewsvan()
{
if ( GetStatus() == STATUS_PLAYER )
{
// TODO: Point at something? Like nearest collectable or safehouse
m_fGunOrientation += CTimer::m_fTimeStep * 0.05f;
if ( m_fGunOrientation > 2.0f * PI ) m_fGunOrientation -= 2.0f * PI;
SetComponentRotation( m_pCarNode[20], ROT_AXIS_Z, m_fGunOrientation );
}
}

View file

@ -164,7 +164,10 @@ public:
CBouncingPanel m_aBouncingPanel[3];
BYTE padding[320];
float m_fRotorSpeed;
BYTE __moarpad[264];
BYTE __moarpad[252];
float m_fGunOrientation;
float m_fGunElevation;
float m_fUnknown;
float m_fSpecialComponentAngle;
BYTE __pad3[44];
@ -179,6 +182,7 @@ public:
void ResetFrames();
void ProcessPhoenixBlower( int32_t modelID );
void ProcessSweeper();
void ProcessNewsvan();
static void (CAutomobile::*orgPreRender)();
static float ms_engineCompSpeed;