mirror of
https://github.com/halpz/re3.git
synced 2025-07-21 17:59:46 +00:00
CVehicle
This commit is contained in:
@ -509,18 +509,18 @@ CCoronas::DoSunAndMoon(void)
|
||||
{
|
||||
// yeah, moon is done somewhere else....
|
||||
|
||||
CVector sunCoors = CTimeCycle::GetSunPosition();
|
||||
CVector sunCoors = CTimeCycle::GetSunDirection();
|
||||
sunCoors *= 150.0f;
|
||||
sunCoors += TheCamera.GetPosition();
|
||||
|
||||
if(CTimeCycle::GetSunPosition().z > -0.2f){
|
||||
if(CTimeCycle::GetSunDirection().z > -0.2f){
|
||||
float size = ((CGeneral::GetRandomNumber()&0xFF) * 0.005f + 10.0f) * CTimeCycle::GetSunSize();
|
||||
RegisterCorona(SUN_CORE,
|
||||
CTimeCycle::GetSunCoreRed(), CTimeCycle::GetSunCoreGreen(), CTimeCycle::GetSunCoreBlue(),
|
||||
255, sunCoors, size,
|
||||
999999.88f, TYPE_STAR, FLARE_NONE, REFLECTION_OFF, LOSCHECK_OFF, STREAK_OFF, 0.0f);
|
||||
|
||||
if(CTimeCycle::GetSunPosition().z > 0.0f)
|
||||
if(CTimeCycle::GetSunDirection().z > 0.0f)
|
||||
RegisterCorona(SUN_CORONA,
|
||||
CTimeCycle::GetSunCoronaRed(), CTimeCycle::GetSunCoronaGreen(), CTimeCycle::GetSunCoronaBlue(),
|
||||
255, sunCoors, 25.0f * CTimeCycle::GetSunSize(),
|
||||
|
@ -643,12 +643,12 @@ CShadows::StoreShadowForPole(CEntity *pPole, float fOffsetX, float fOffsetY, flo
|
||||
PolePos.y += fOffsetX * pPole->GetRight().y + fOffsetY * pPole->GetForward().y;
|
||||
PolePos.z += fOffsetZ;
|
||||
|
||||
PolePos.x += -CTimeCycle::GetSunPosition().x * (fPoleHeight / 2);
|
||||
PolePos.y += -CTimeCycle::GetSunPosition().y * (fPoleHeight / 2);
|
||||
PolePos.x += -CTimeCycle::GetSunDirection().x * (fPoleHeight / 2);
|
||||
PolePos.y += -CTimeCycle::GetSunDirection().y * (fPoleHeight / 2);
|
||||
|
||||
StoreStaticShadow((uintptr)pPole + nID + _TODOCONST(51), SHADOWTYPE_DARK, gpPostShadowTex, &PolePos,
|
||||
-CTimeCycle::GetSunPosition().x * (fPoleHeight / 2),
|
||||
-CTimeCycle::GetSunPosition().y * (fPoleHeight / 2),
|
||||
-CTimeCycle::GetSunDirection().x * (fPoleHeight / 2),
|
||||
-CTimeCycle::GetSunDirection().y * (fPoleHeight / 2),
|
||||
CTimeCycle::GetShadowSideX() * fPoleWidth,
|
||||
CTimeCycle::GetShadowSideY() * fPoleWidth,
|
||||
2 * (int32)((pPole->GetUp().z - 0.5f) * CTimeCycle::GetShadowStrength() * 2.0f) / 3,
|
||||
|
@ -199,8 +199,8 @@ CSkidmarks::RegisterOne(uintptr id, CVector pos, float fwdX, float fwdY, bool *i
|
||||
aSkidmarks[i].m_pos[aSkidmarks[i].m_last] = pos;
|
||||
|
||||
CVector2D dist = aSkidmarks[i].m_pos[aSkidmarks[i].m_last] - aSkidmarks[i].m_pos[aSkidmarks[i].m_last-1];
|
||||
dist.NormaliseSafe();
|
||||
fwd.NormaliseSafe();
|
||||
dist.Normalise();
|
||||
fwd.Normalise();
|
||||
CVector2D right(dist.y, -dist.x);
|
||||
float turn = DotProduct2D(fwd, right);
|
||||
turn = Abs(turn) + 1.0f;
|
||||
|
@ -28,6 +28,7 @@ RwImVertexIndex StreakIndexList[12];
|
||||
RwIm3DVertex TraceVertices[6];
|
||||
RwImVertexIndex TraceIndexList[12];
|
||||
|
||||
bool CSpecialFX::bSnapShotActive;
|
||||
|
||||
void
|
||||
CSpecialFX::Init(void)
|
||||
|
@ -3,6 +3,8 @@
|
||||
class CSpecialFX
|
||||
{
|
||||
public:
|
||||
static bool bSnapShotActive;
|
||||
|
||||
static void Render(void);
|
||||
static void Update(void);
|
||||
static void Init(void);
|
||||
|
@ -350,7 +350,7 @@ CTimeCycle::Update(void)
|
||||
m_CurrentStoredValue = (m_CurrentStoredValue+1)&0xF;
|
||||
|
||||
float sunAngle = 2*PI*(CClock::GetSeconds()/60.0f + CClock::GetMinutes() + CClock::GetHours()*60)/(24*60);
|
||||
CVector &sunPos = GetSunPosition();
|
||||
CVector &sunPos = GetSunDirection();
|
||||
sunPos.x = Sin(sunAngle);
|
||||
sunPos.y = 1.0f;
|
||||
sunPos.z = 0.2f - Cos(sunAngle);
|
||||
|
@ -180,7 +180,7 @@ public:
|
||||
|
||||
static void Initialise(void);
|
||||
static void Update(void);
|
||||
static CVector &GetSunPosition(void) { return m_VectorToSun[m_CurrentStoredValue]; }
|
||||
static CVector &GetSunDirection(void) { return m_VectorToSun[m_CurrentStoredValue]; }
|
||||
static float GetShadowFrontX(void) { return m_fShadowFrontX[m_CurrentStoredValue]; }
|
||||
static float GetShadowFrontY(void) { return m_fShadowFrontY[m_CurrentStoredValue]; }
|
||||
static float GetShadowSideX(void) { return m_fShadowSideX[m_CurrentStoredValue]; }
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "Vehicle.h"
|
||||
#include "World.h"
|
||||
#include "ZoneCull.h"
|
||||
#include "SpecialFX.h"
|
||||
|
||||
int32 CWeather::SoundHandle = -1;
|
||||
|
||||
@ -271,9 +272,10 @@ void CWeather::Update(void)
|
||||
SunGlare += InterpolationValue;
|
||||
|
||||
if (SunGlare > 0.0f) {
|
||||
SunGlare *= Min(1.0f, 7.0 * CTimeCycle::GetSunPosition().z);
|
||||
SunGlare *= Min(1.0f, 7.0 * CTimeCycle::GetSunDirection().z);
|
||||
SunGlare = clamp(SunGlare, 0.0f, 1.0f);
|
||||
// TODO(MIAMI): if (CSpecialFX::bSnapShotActive)...
|
||||
if (!CSpecialFX::bSnapShotActive)
|
||||
SunGlare *= (1.0f - (CGeneral::GetRandomNumber()&0x1F)*0.007f);
|
||||
}
|
||||
|
||||
Wind = InterpolationValue * Windiness[NewWeatherType] + (1.0f - InterpolationValue) * Windiness[OldWeatherType];
|
||||
|
Reference in New Issue
Block a user