mirror of
https://github.com/halpz/re3.git
synced 2025-07-15 03:58:08 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@ -108,7 +108,7 @@ CAnimViewer::Initialise(void) {
|
||||
CTimeCycle::Initialise();
|
||||
CCarCtrl::Init();
|
||||
CPlayerPed *player = new CPlayerPed();
|
||||
player->GetPosition() = CVector(0.0f, 0.0f, 0.0f);
|
||||
player->SetPosition(0.0f, 0.0f, 0.0f);
|
||||
CWorld::Players[0].m_pPed = player;
|
||||
CDraw::SetFOV(120.0f);
|
||||
CDraw::ms_fLODDistance = 500.0f;
|
||||
@ -292,14 +292,14 @@ CAnimViewer::Update(void)
|
||||
}
|
||||
newEntity->bIsStuck = true;
|
||||
}
|
||||
newEntity->GetPosition() = CVector(0.0f, 0.0f, 0.0f);
|
||||
newEntity->SetPosition(0.0f, 0.0f, 0.0f);
|
||||
CWorld::Add(newEntity);
|
||||
TheCamera.TakeControl(pTarget, CCam::MODE_MODELVIEW, JUMP_CUT, CAMCONTROL_SCRIPT);
|
||||
}
|
||||
if (pTarget->IsVehicle() || pTarget->IsPed() || pTarget->IsObject()) {
|
||||
((CPhysical*)pTarget)->m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
pTarget->GetPosition().z = 0.0f;
|
||||
pTarget->GetMatrix().GetPosition().z = 0.0f;
|
||||
|
||||
if (modelInfo->m_type != MITYPE_PED) {
|
||||
|
||||
|
@ -470,19 +470,19 @@ CCamera::Process(void)
|
||||
}
|
||||
}
|
||||
|
||||
GetRight() = CrossProduct(CamUp, CamFront); // actually Left
|
||||
GetForward() = CamFront;
|
||||
GetUp() = CamUp;
|
||||
GetPosition() = CamSource;
|
||||
GetMatrix().GetRight() = CrossProduct(CamUp, CamFront); // actually Left
|
||||
GetMatrix().GetForward() = CamFront;
|
||||
GetMatrix().GetUp() = CamUp;
|
||||
GetMatrix().GetPosition() = CamSource;
|
||||
|
||||
// Process Shake
|
||||
float shakeStrength = m_fCamShakeForce - 0.28f*(CTimer::GetTimeInMilliseconds()-m_uiCamShakeStart)/1000.0f;
|
||||
shakeStrength = clamp(shakeStrength, 0.0f, 2.0f);
|
||||
int shakeRand = CGeneral::GetRandomNumber();
|
||||
float shakeOffset = shakeStrength*0.1f;
|
||||
GetPosition().x += shakeOffset*((shakeRand&0xF)-7);
|
||||
GetPosition().y += shakeOffset*(((shakeRand&0xF0)>>4)-7);
|
||||
GetPosition().z += shakeOffset*(((shakeRand&0xF00)>>8)-7);
|
||||
GetMatrix().GetPosition().x += shakeOffset * ((shakeRand & 0xF) - 7);
|
||||
GetMatrix().GetPosition().y += shakeOffset * (((shakeRand & 0xF0) >> 4) - 7);
|
||||
GetMatrix().GetPosition().z += shakeOffset * (((shakeRand & 0xF00) >> 8) - 7);
|
||||
|
||||
if(shakeOffset > 0.0f && m_BlurType != MBLUR_SNIPER)
|
||||
SetMotionBlurAlpha(Min((int)(shakeStrength*255.0f) + 25, 150));
|
||||
@ -499,27 +499,27 @@ CCamera::Process(void)
|
||||
CVector Front = Cams[2].Front;
|
||||
CVector Up = Cams[2].Up;
|
||||
|
||||
GetRight() = CrossProduct(Up, Front);
|
||||
GetForward() = Front;
|
||||
GetUp() = Up;
|
||||
GetPosition() = Source;
|
||||
GetMatrix().GetRight() = CrossProduct(Up, Front);
|
||||
GetMatrix().GetForward() = Front;
|
||||
GetMatrix().GetUp() = Up;
|
||||
GetMatrix().GetPosition() = Source;
|
||||
|
||||
CDraw::SetFOV(Cams[2].FOV);
|
||||
m_vecGameCamPos = Cams[ActiveCam].Source;
|
||||
|
||||
*RwMatrixGetPos(RwFrameGetMatrix(frame)) = GetPosition().toRwV3d();
|
||||
*RwMatrixGetAt(RwFrameGetMatrix(frame)) = GetForward().toRwV3d();
|
||||
*RwMatrixGetUp(RwFrameGetMatrix(frame)) = GetUp().toRwV3d();
|
||||
*RwMatrixGetRight(RwFrameGetMatrix(frame)) = GetRight().toRwV3d();
|
||||
*RwMatrixGetPos(RwFrameGetMatrix(frame)) = GetPosition();
|
||||
*RwMatrixGetAt(RwFrameGetMatrix(frame)) = GetForward();
|
||||
*RwMatrixGetUp(RwFrameGetMatrix(frame)) = GetUp();
|
||||
*RwMatrixGetRight(RwFrameGetMatrix(frame)) = GetRight();
|
||||
RwMatrixUpdate(RwFrameGetMatrix(frame));
|
||||
RwFrameUpdateObjects(frame);
|
||||
}else{
|
||||
RwFrame *frame = RwCameraGetFrame(m_pRwCamera);
|
||||
m_vecGameCamPos = GetPosition();
|
||||
*RwMatrixGetPos(RwFrameGetMatrix(frame)) = GetPosition().toRwV3d();
|
||||
*RwMatrixGetAt(RwFrameGetMatrix(frame)) = GetForward().toRwV3d();
|
||||
*RwMatrixGetUp(RwFrameGetMatrix(frame)) = GetUp().toRwV3d();
|
||||
*RwMatrixGetRight(RwFrameGetMatrix(frame)) = GetRight().toRwV3d();
|
||||
*RwMatrixGetPos(RwFrameGetMatrix(frame)) = GetPosition();
|
||||
*RwMatrixGetAt(RwFrameGetMatrix(frame)) = GetForward();
|
||||
*RwMatrixGetUp(RwFrameGetMatrix(frame)) = GetUp();
|
||||
*RwMatrixGetRight(RwFrameGetMatrix(frame)) = GetRight();
|
||||
RwMatrixUpdate(RwFrameGetMatrix(frame));
|
||||
RwFrameUpdateObjects(frame);
|
||||
}
|
||||
|
@ -12,9 +12,9 @@ CPlaceable::~CPlaceable(void) = default;
|
||||
void
|
||||
CPlaceable::SetHeading(float angle)
|
||||
{
|
||||
CVector pos = GetPosition();
|
||||
CVector pos = GetMatrix().GetPosition();
|
||||
m_matrix.SetRotateZ(angle);
|
||||
GetPosition() += pos;
|
||||
GetMatrix().Translate(pos);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -10,7 +10,7 @@ public:
|
||||
|
||||
CPlaceable(void);
|
||||
virtual ~CPlaceable(void);
|
||||
CVector &GetPosition(void) { return m_matrix.GetPosition(); }
|
||||
const CVector &GetPosition(void) { return m_matrix.GetPosition(); }
|
||||
void SetPosition(float x, float y, float z) {
|
||||
m_matrix.GetPosition().x = x;
|
||||
m_matrix.GetPosition().y = y;
|
||||
|
@ -38,7 +38,7 @@ CPlayerInfo::SetPlayerSkin(char *skin)
|
||||
LoadPlayerSkin();
|
||||
}
|
||||
|
||||
CVector&
|
||||
const CVector &
|
||||
CPlayerInfo::GetPos()
|
||||
{
|
||||
#ifdef FIX_BUGS
|
||||
@ -430,7 +430,7 @@ CPlayerInfo::Process(void)
|
||||
CPed::PedSetOutCarCB(0, m_pPed);
|
||||
CAnimManager::BlendAnimation(m_pPed->GetClump(), m_pPed->m_animGroup, ANIM_IDLE_STANCE, 100.0f);
|
||||
CAnimManager::BlendAnimation(m_pPed->GetClump(), ASSOCGRP_STD, ANIM_FALL_LAND, 100.0f);
|
||||
m_pPed->GetPosition() = sth;
|
||||
m_pPed->SetPosition(sth);
|
||||
m_pPed->SetMoveState(PEDMOVE_STILL);
|
||||
m_pPed->m_vecMoveSpeed = veh->m_vecMoveSpeed;
|
||||
}
|
||||
@ -456,7 +456,7 @@ CPlayerInfo::Process(void)
|
||||
#ifdef VC_PED_PORTS
|
||||
if (carBelow->GetStatus() != STATUS_WRECKED && carBelow->GetUp().z > 0.3f)
|
||||
#else
|
||||
if (carBelow->m_status != STATUS_WRECKED)
|
||||
if (carBelow->GetStatus() != STATUS_WRECKED)
|
||||
#endif
|
||||
m_pPed->SetSeekBoatPosition(carBelow);
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ public:
|
||||
void DeletePlayerSkin();
|
||||
void AwardMoneyForExplosion(CVehicle *vehicle);
|
||||
void SetPlayerSkin(char* skin);
|
||||
CVector& GetPos();
|
||||
const CVector &GetPos();
|
||||
void Process(void);
|
||||
void KillPlayer(void);
|
||||
void ArrestPlayer(void);
|
||||
|
@ -523,7 +523,7 @@ void CRadar::DrawBlips()
|
||||
DrawRadarSprite(ms_RadarTrace[blipId].m_eRadarSprite, out.x, out.y, CalculateBlipAlpha(dist));
|
||||
} else {
|
||||
#ifdef TRIANGULAR_BLIPS
|
||||
CVector &pos = FindPlayerCentreOfWorld_NoSniperShift();
|
||||
const CVector &pos = FindPlayerCentreOfWorld_NoSniperShift();
|
||||
const CVector &blipPos = blipEntity->GetPosition();
|
||||
uint8 mode = BLIP_MODE_TRIANGULAR_UP;
|
||||
if (blipPos.z - pos.z <= 2.0f) {
|
||||
@ -562,8 +562,8 @@ void CRadar::DrawBlips()
|
||||
DrawRadarSprite(ms_RadarTrace[blipId].m_eRadarSprite, out.x, out.y, CalculateBlipAlpha(dist));
|
||||
} else {
|
||||
#ifdef TRIANGULAR_BLIPS
|
||||
CVector &pos = FindPlayerCentreOfWorld_NoSniperShift();
|
||||
CVector &blipPos = ms_RadarTrace[blipId].m_vecPos;
|
||||
const CVector &pos = FindPlayerCentreOfWorld_NoSniperShift();
|
||||
const CVector &blipPos = ms_RadarTrace[blipId].m_vecPos;
|
||||
uint8 mode = BLIP_MODE_TRIANGULAR_UP;
|
||||
if (blipPos.z - pos.z <= 2.0f) {
|
||||
if (blipPos.z - pos.z < -4.0f) mode = BLIP_MODE_TRIANGULAR_DOWN;
|
||||
@ -629,7 +629,7 @@ void CRadar::DrawBlips()
|
||||
else
|
||||
#ifdef TRIANGULAR_BLIPS
|
||||
{
|
||||
CVector &pos = FindPlayerCentreOfWorld_NoSniperShift();
|
||||
const CVector &pos = FindPlayerCentreOfWorld_NoSniperShift();
|
||||
const CVector &blipPos = blipEntity->GetPosition();
|
||||
uint8 mode = BLIP_MODE_TRIANGULAR_UP;
|
||||
if (blipPos.z - pos.z <= 2.0f) {
|
||||
@ -678,8 +678,8 @@ void CRadar::DrawBlips()
|
||||
else
|
||||
#ifdef TRIANGULAR_BLIPS
|
||||
{
|
||||
CVector &pos = FindPlayerCentreOfWorld_NoSniperShift();
|
||||
CVector &blipPos = ms_RadarTrace[blipId].m_vecPos;
|
||||
const CVector &pos = FindPlayerCentreOfWorld_NoSniperShift();
|
||||
const CVector &blipPos = ms_RadarTrace[blipId].m_vecPos;
|
||||
uint8 mode = BLIP_MODE_TRIANGULAR_UP;
|
||||
if (blipPos.z - pos.z <= 2.0f) {
|
||||
if (blipPos.z - pos.z < -4.0f) mode = BLIP_MODE_TRIANGULAR_DOWN;
|
||||
|
@ -1417,7 +1417,7 @@ FindPlayerSpeed(void)
|
||||
return ped->m_vecMoveSpeed;
|
||||
}
|
||||
|
||||
CVector &
|
||||
const CVector &
|
||||
FindPlayerCentreOfWorld(int32 player)
|
||||
{
|
||||
#ifdef FIX_BUGS
|
||||
@ -1429,7 +1429,7 @@ FindPlayerCentreOfWorld(int32 player)
|
||||
return CWorld::Players[player].m_pPed->GetPosition();
|
||||
}
|
||||
|
||||
CVector &
|
||||
const CVector &
|
||||
FindPlayerCentreOfWorld_NoSniperShift(void)
|
||||
{
|
||||
#ifdef FIX_BUGS
|
||||
@ -1824,12 +1824,7 @@ void
|
||||
CWorld::RepositionOneObject(CEntity *pEntity)
|
||||
{
|
||||
int16 modelId = pEntity->m_modelIndex;
|
||||
if(modelId == MI_SINGLESTREETLIGHTS1 || modelId == MI_SINGLESTREETLIGHTS2 ||
|
||||
modelId == MI_SINGLESTREETLIGHTS3 || modelId == MI_DOUBLESTREETLIGHTS || modelId == MI_TREE1 ||
|
||||
modelId == MI_TREE2 || modelId == MI_TREE3 || modelId == MI_TREE4 || modelId == MI_TREE5 ||
|
||||
modelId == MI_TREE6 || modelId == MI_TREE7 || modelId == MI_TREE8 || modelId == MI_TREE9 ||
|
||||
modelId == MI_TREE10 || modelId == MI_TREE11 || modelId == MI_TREE12 || modelId == MI_TREE13 ||
|
||||
modelId == MI_TREE14 || modelId == MI_TRAFFICLIGHTS || modelId == MI_PARKINGMETER ||
|
||||
if (IsTrafficLight(modelId) || IsTreeModel(modelId) || modelId == MI_PARKINGMETER ||
|
||||
modelId == MI_PHONEBOOTH1 || modelId == MI_WASTEBIN || modelId == MI_BIN || modelId == MI_POSTBOX1 ||
|
||||
modelId == MI_NEWSSTAND || modelId == MI_TRAFFICCONE || modelId == MI_DUMP1 ||
|
||||
modelId == MI_ROADWORKBARRIER1 || modelId == MI_BUSSIGN1 || modelId == MI_NOPARKINGSIGN1 ||
|
||||
@ -1837,7 +1832,7 @@ CWorld::RepositionOneObject(CEntity *pEntity)
|
||||
modelId == MI_FISHSTALL02 || modelId == MI_FISHSTALL03 || modelId == MI_FISHSTALL04 ||
|
||||
modelId == MI_BAGELSTAND2 || modelId == MI_FIRE_HYDRANT || modelId == MI_BOLLARDLIGHT ||
|
||||
modelId == MI_PARKTABLE) {
|
||||
CVector &position = pEntity->GetPosition();
|
||||
CVector &position = pEntity->GetMatrix().GetPosition();
|
||||
float fBoundingBoxMinZ = pEntity->GetColModel()->boundingBox.min.z;
|
||||
position.z = CWorld::FindGroundZFor3DCoord(position.x, position.y,
|
||||
position.z + OBJECT_REPOSITION_OFFSET_Z, nil) -
|
||||
@ -1855,7 +1850,7 @@ CWorld::RepositionOneObject(CEntity *pEntity)
|
||||
if(!bFound || fWaterLevel > fGroundZ) {
|
||||
CColModel *pColModel = pEntity->GetColModel();
|
||||
float fHeight = pColModel->boundingBox.max.z - pColModel->boundingBox.min.z;
|
||||
pEntity->GetPosition().z = 0.2f * fHeight + fWaterLevel - 0.5f * fHeight;
|
||||
pEntity->GetMatrix().GetPosition().z = 0.2f * fHeight + fWaterLevel - 0.5f * fHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -164,6 +164,6 @@ CVehicle *FindPlayerTrain(void);
|
||||
CEntity *FindPlayerEntity(void);
|
||||
CVector FindPlayerCoors(void);
|
||||
CVector &FindPlayerSpeed(void);
|
||||
CVector &FindPlayerCentreOfWorld(int32 player);
|
||||
CVector &FindPlayerCentreOfWorld_NoSniperShift(void);
|
||||
const CVector &FindPlayerCentreOfWorld(int32 player);
|
||||
const CVector &FindPlayerCentreOfWorld_NoSniperShift(void);
|
||||
float FindPlayerHeading(void);
|
||||
|
Reference in New Issue
Block a user