mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2025-01-31 06:57:28 +05:00
Tweaked Sweeper/Phoenix constants
This commit is contained in:
parent
fb679617de
commit
49796ff0cf
2 changed files with 25 additions and 19 deletions
|
@ -7,6 +7,10 @@
|
||||||
#include "TimerSA.h"
|
#include "TimerSA.h"
|
||||||
#include "DelimStringReader.h"
|
#include "DelimStringReader.h"
|
||||||
|
|
||||||
|
static constexpr float PHOENIX_FLUTTER_PERIOD = 70.0f;
|
||||||
|
static constexpr float PHOENIX_FLUTTER_AMP = 0.13f;
|
||||||
|
static constexpr float SWEEPER_BRUSH_SPEED = 0.3f;
|
||||||
|
|
||||||
std::vector<int32_t> vecRotorExceptions;
|
std::vector<int32_t> vecRotorExceptions;
|
||||||
|
|
||||||
float CAutomobile::ms_engineCompSpeed;
|
float CAutomobile::ms_engineCompSpeed;
|
||||||
|
@ -138,25 +142,25 @@ void CVehicle::CustomCarPlate_BeforeRenderingStart(CVehicleModelInfo* pModelInfo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CVehicle::SetComponentRotation( RwFrame* component, int axis, float angle, bool absolute )
|
void CVehicle::SetComponentRotation( RwFrame* component, eRotAxis axis, float angle, bool absolute )
|
||||||
{
|
{
|
||||||
if ( component == nullptr ) return;
|
if ( component == nullptr ) return;
|
||||||
|
|
||||||
CMatrix matrix( RwFrameGetMatrix(component) );
|
CMatrix matrix( RwFrameGetMatrix(component) );
|
||||||
if ( absolute )
|
if ( absolute )
|
||||||
{
|
{
|
||||||
if ( axis == 0 ) matrix.SetRotateXOnly(angle);
|
if ( axis == ROT_AXIS_X ) matrix.SetRotateXOnly(angle);
|
||||||
else if ( axis == 1 ) matrix.SetRotateYOnly(angle);
|
else if ( axis == ROT_AXIS_Y ) matrix.SetRotateYOnly(angle);
|
||||||
else if ( axis == 2 ) matrix.SetRotateZOnly(angle);
|
else if ( axis == ROT_AXIS_Z ) matrix.SetRotateZOnly(angle);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const CVector pos = matrix.GetPos();
|
const CVector pos = matrix.GetPos();
|
||||||
matrix.SetTranslateOnly(0.0f, 0.0f, 0.0f);
|
matrix.SetTranslateOnly(0.0f, 0.0f, 0.0f);
|
||||||
|
|
||||||
if ( axis == 0 ) matrix.RotateX(angle);
|
if ( axis == ROT_AXIS_X ) matrix.RotateX(angle);
|
||||||
else if ( axis == 1 ) matrix.RotateY(angle);
|
else if ( axis == ROT_AXIS_Y ) matrix.RotateY(angle);
|
||||||
else if ( axis == 2 ) matrix.RotateZ(angle);
|
else if ( axis == ROT_AXIS_Z ) matrix.RotateZ(angle);
|
||||||
|
|
||||||
matrix.GetPos() += pos;
|
matrix.GetPos() += pos;
|
||||||
}
|
}
|
||||||
|
@ -355,7 +359,7 @@ void CAutomobile::ProcessPhoenixBlower( int32_t modelID )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
finalAngle = m_fSpecialComponentAngle + (std::sin( (CTimer::m_snTimeInMilliseconds % 10000) / 70.0f ) * 0.13f);
|
finalAngle = m_fSpecialComponentAngle + (std::sin( (CTimer::m_snTimeInMilliseconds % 10000) / PHOENIX_FLUTTER_PERIOD ) * PHOENIX_FLUTTER_AMP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -366,7 +370,7 @@ void CAutomobile::ProcessPhoenixBlower( int32_t modelID )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SetComponentRotation( m_pCarNode[20], 0, finalAngle, false );
|
SetComponentRotation( m_pCarNode[20], ROT_AXIS_X, finalAngle, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAutomobile::ProcessSweeper()
|
void CAutomobile::ProcessSweeper()
|
||||||
|
@ -382,13 +386,8 @@ void CAutomobile::ProcessSweeper()
|
||||||
m_pCarNode[21] = GetFrameFromName( RpClumpGetFrame(m_pRwObject), "miscb" );
|
m_pCarNode[21] = GetFrameFromName( RpClumpGetFrame(m_pRwObject), "miscb" );
|
||||||
}
|
}
|
||||||
|
|
||||||
const float angle = CTimer::m_fTimeStep * 0.5f;
|
const float angle = CTimer::m_fTimeStep * SWEEPER_BRUSH_SPEED;
|
||||||
if ( m_pCarNode[20] != nullptr )
|
|
||||||
{
|
SetComponentRotation( m_pCarNode[20], ROT_AXIS_Z, angle, false );
|
||||||
SetComponentRotation( m_pCarNode[20], 2, angle, false );
|
SetComponentRotation( m_pCarNode[21], ROT_AXIS_Z, -angle, false );
|
||||||
}
|
|
||||||
if ( m_pCarNode[21] != nullptr )
|
|
||||||
{
|
|
||||||
SetComponentRotation( m_pCarNode[21], 2, -angle, false );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,6 +112,13 @@ public:
|
||||||
CVector m_vecBounceVector;
|
CVector m_vecBounceVector;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum eRotAxis
|
||||||
|
{
|
||||||
|
ROT_AXIS_X = 0,
|
||||||
|
ROT_AXIS_Y = 1,
|
||||||
|
ROT_AXIS_Z = 2
|
||||||
|
};
|
||||||
|
|
||||||
class NOVMT CVehicle : public CPhysical
|
class NOVMT CVehicle : public CPhysical
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
@ -145,7 +152,7 @@ public:
|
||||||
|
|
||||||
bool IsLawEnforcementVehicle();
|
bool IsLawEnforcementVehicle();
|
||||||
|
|
||||||
static void SetComponentRotation( RwFrame* component, int axis, float angle, bool absolute );
|
static void SetComponentRotation( RwFrame* component, eRotAxis axis, float angle, bool absolute );
|
||||||
static void SetComponentAtomicAlpha(RpAtomic* pAtomic, int nAlpha);
|
static void SetComponentAtomicAlpha(RpAtomic* pAtomic, int nAlpha);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue