mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-10 00:27:43 +00:00
Merge remote-tracking branch 'origin/master' into hsh
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -11,7 +11,7 @@
|
||||
#include <zeus/CTransform.hpp>
|
||||
#include <zeus/CVector3f.hpp>
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CPlayer;
|
||||
|
||||
class CCameraSpring {
|
||||
@@ -150,12 +150,12 @@ private:
|
||||
zeus::CVector3f x35c_splineIntermediatePos;
|
||||
TUniqueId x368_obscuringObjectId = kInvalidUniqueId;
|
||||
ESplineState x36c_splineState = ESplineState::Invalid;
|
||||
bool x370_24_reevalSplineEnd : 1;
|
||||
bool x370_24_reevalSplineEnd : 1 = false;
|
||||
float x374_splineCtrl = 0.f;
|
||||
float x378_splineCtrlRange;
|
||||
CCameraSpline x37c_camSpline{false};
|
||||
CMaterialList x3c8_collisionExcludeList = {EMaterialTypes::NoStepLogic};
|
||||
bool x3d0_24_camBehindFloorOrWall : 1;
|
||||
bool x3d0_24_camBehindFloorOrWall : 1 = false;
|
||||
float x3d4_elevInterpTimer = 0.f;
|
||||
float x3d8_elevInterpStart = 0.f;
|
||||
TUniqueId x3dc_tooCloseActorId = kInvalidUniqueId;
|
||||
@@ -202,12 +202,13 @@ private:
|
||||
void UpdateUsingPathCameras(float dt, CStateManager& mgr);
|
||||
zeus::CVector3f GetFixedLookTarget(const zeus::CVector3f& hintToLookDir, CStateManager& mgr) const;
|
||||
void UpdateUsingFixedCameras(float dt, CStateManager& mgr);
|
||||
zeus::CVector3f ComputeVelocity(const zeus::CVector3f& curVel, const zeus::CVector3f& posDelta) const;
|
||||
[[nodiscard]] zeus::CVector3f ComputeVelocity(const zeus::CVector3f& curVel, const zeus::CVector3f& posDelta) const;
|
||||
zeus::CVector3f TweenVelocity(const zeus::CVector3f& curVel, const zeus::CVector3f& newVel, float rate, float dt);
|
||||
zeus::CVector3f MoveCollisionActor(const zeus::CVector3f& pos, float dt, CStateManager& mgr);
|
||||
void UpdateUsingFreeLook(float dt, CStateManager& mgr);
|
||||
zeus::CVector3f InterpolateCameraElevation(const zeus::CVector3f& camPos, float dt);
|
||||
zeus::CVector3f CalculateCollidersCentroid(const std::vector<CCameraCollider>& colliderList, int numObscured) const;
|
||||
[[nodiscard]] zeus::CVector3f CalculateCollidersCentroid(const std::vector<CCameraCollider>& colliderList,
|
||||
int numObscured) const;
|
||||
zeus::CVector3f ApplyColliders();
|
||||
void UpdateColliders(const zeus::CTransform& xf, std::vector<CCameraCollider>& colliderList, int& it, int count,
|
||||
float tolerance, const rstl::reserved_vector<TUniqueId, 1024>& nearList, float dt,
|
||||
@@ -218,7 +219,7 @@ private:
|
||||
float dt, CStateManager& mgr);
|
||||
zeus::CAABox CalculateCollidersBoundingBox(const std::vector<CCameraCollider>& colliderList,
|
||||
CStateManager& mgr) const;
|
||||
int CountObscuredColliders(const std::vector<CCameraCollider>& colliderList) const;
|
||||
[[nodiscard]] int CountObscuredColliders(const std::vector<CCameraCollider>& colliderList) const;
|
||||
void UpdateCollidersDistances(std::vector<CCameraCollider>& colliderList, float xMag, float zMag, float angOffset);
|
||||
void UpdateUsingColliders(float dt, CStateManager& mgr);
|
||||
void UpdateUsingSpindleCameras(float dt, CStateManager& mgr);
|
||||
@@ -248,16 +249,16 @@ public:
|
||||
void ProcessInput(const CFinalInput& input, CStateManager& mgr) override;
|
||||
void Reset(const zeus::CTransform&, CStateManager& mgr) override;
|
||||
void Render(CStateManager& mgr) override;
|
||||
EBallCameraBehaviour GetBehaviour() const { return x188_behaviour; }
|
||||
EBallCameraState GetState() const { return x400_state; }
|
||||
[[nodiscard]] EBallCameraBehaviour GetBehaviour() const { return x188_behaviour; }
|
||||
[[nodiscard]] EBallCameraState GetState() const { return x400_state; }
|
||||
void SetState(EBallCameraState state, CStateManager& mgr);
|
||||
void Think(float dt, CStateManager& mgr) override;
|
||||
bool TransitionFromMorphBallState(CStateManager& mgr);
|
||||
TUniqueId GetTooCloseActorId() const { return x3dc_tooCloseActorId; }
|
||||
float GetTooCloseActorDistance() const { return x3e0_tooCloseActorDist; }
|
||||
[[nodiscard]] TUniqueId GetTooCloseActorId() const { return x3dc_tooCloseActorId; }
|
||||
[[nodiscard]] float GetTooCloseActorDistance() const { return x3e0_tooCloseActorDist; }
|
||||
void TeleportCamera(const zeus::CVector3f& pos, CStateManager& mgr);
|
||||
void TeleportCamera(const zeus::CTransform& xf, CStateManager& mgr);
|
||||
const zeus::CVector3f& GetLookPos() const { return x1d8_lookPos; }
|
||||
[[nodiscard]] const zeus::CVector3f& GetLookPos() const { return x1d8_lookPos; }
|
||||
void ResetToTweaks(CStateManager& mgr);
|
||||
void UpdateLookAtPosition(float dt, CStateManager& mgr);
|
||||
zeus::CTransform UpdateLookDirection(const zeus::CVector3f& dir, CStateManager& mgr);
|
||||
@@ -267,10 +268,11 @@ public:
|
||||
void ResetPosition(CStateManager& mgr);
|
||||
void DoorClosed(TUniqueId doorId);
|
||||
void DoorClosing(TUniqueId doorId);
|
||||
const zeus::CVector3f& GetLookPosAhead() const { return x1c0_lookPosAhead; }
|
||||
const zeus::CVector3f& GetFixedLookPos() const { return x1cc_fixedLookPos; }
|
||||
[[nodiscard]] const zeus::CVector3f& GetLookPosAhead() const { return x1c0_lookPosAhead; }
|
||||
[[nodiscard]] const zeus::CVector3f& GetFixedLookPos() const { return x1cc_fixedLookPos; }
|
||||
const TUniqueId GetCollisionActorId() const { return x46c_collisionActorId; }
|
||||
|
||||
static bool IsBallNearDoor(const zeus::CVector3f& pos, CStateManager& mgr);
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <algorithm>
|
||||
#include <zeus/CColor.hpp>
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
template <class S>
|
||||
void CCameraFilterPass<S>::Update(float dt) {
|
||||
@@ -224,4 +224,4 @@ void CCameraBlurPass::SetBlur(EBlurType type, float amount, float duration) {
|
||||
|
||||
void CCameraBlurPass::DisableBlur(float duration) { SetBlur(EBlurType::NoBlur, 0.f, duration); }
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "hsh/hsh.h"
|
||||
#include "zeus/CColor.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
enum class EFilterType {
|
||||
Passthru,
|
||||
Multiply,
|
||||
@@ -155,4 +155,4 @@ public:
|
||||
EBlurType GetCurrType() const { return x10_curType; }
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#include "TCastTo.hpp" // Generated file, do not modify include path
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
float CCameraManager::sFirstPersonFOV = 55.f;
|
||||
|
||||
CCameraManager::CCameraManager(TUniqueId curCameraId) : x0_curCameraId(curCameraId) {
|
||||
@@ -732,4 +732,4 @@ void CCameraManager::SetFogDensity(float fogDensityTarget, float fogDensitySpeed
|
||||
x9c_fogDensityFactorTarget = fogDensityTarget;
|
||||
x98_fogDensitySpeed = (x9c_fogDensityFactorTarget >= x94_fogDensityFactor ? fogDensitySpeed : -fogDensitySpeed);
|
||||
}
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include <zeus/CVector3f.hpp>
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CBallCamera;
|
||||
class CCameraShakeData;
|
||||
class CCinematicCamera;
|
||||
@@ -146,4 +146,4 @@ public:
|
||||
bool ShouldBypassInterpolation() { return false; }
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include <zeus/Math.hpp>
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
SCameraShakePoint SCameraShakePoint::LoadCameraShakePoint(CInputStream& in) {
|
||||
u32 useEnvelope = ScriptLoader::LoadParameterFlags(in);
|
||||
@@ -136,4 +136,4 @@ const CCameraShakeData CCameraShakeData::skChargedShotCameraShakeData{
|
||||
CCameraShakerComponent{},
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <zeus/CVector3f.hpp>
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CRandom16;
|
||||
class CStateManager;
|
||||
|
||||
@@ -179,4 +179,4 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "TCastTo.hpp" // Generated file, do not modify include path
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
CCameraSpline::CCameraSpline(bool closedLoop) : x48_closedLoop(closedLoop) {}
|
||||
|
||||
void CCameraSpline::CalculateKnots(TUniqueId cameraId, const std::vector<SConnection>& connections,
|
||||
@@ -13,11 +13,12 @@ void CCameraSpline::CalculateKnots(TUniqueId cameraId, const std::vector<SConnec
|
||||
const SConnection* lastConn = nullptr;
|
||||
|
||||
for (const SConnection& conn : connections) {
|
||||
if (conn.x0_state == EScriptObjectState::CameraPath && conn.x4_msg == EScriptObjectMessage::Follow)
|
||||
if (conn.x0_state == EScriptObjectState::CameraPath && conn.x4_msg == EScriptObjectMessage::Follow) {
|
||||
lastConn = &conn;
|
||||
}
|
||||
}
|
||||
|
||||
if (lastConn) {
|
||||
if (lastConn != nullptr) {
|
||||
TCastToConstPtr<CScriptCameraWaypoint> waypoint = mgr.ObjectById(mgr.GetIdForScript(lastConn->x8_objId));
|
||||
x14_wpTracker.clear();
|
||||
x14_wpTracker.reserve(4);
|
||||
@@ -93,7 +94,7 @@ float CCameraSpline::GetKnotT(size_t idx) const {
|
||||
float CCameraSpline::CalculateSplineLength() {
|
||||
float ret = 0.f;
|
||||
x24_t.clear();
|
||||
if (x4_positions.size() > 0) {
|
||||
if (!x4_positions.empty()) {
|
||||
zeus::CVector3f prevPoint = x4_positions[0];
|
||||
float tDiv = 1.f / float(x4_positions.size() - 1);
|
||||
for (size_t i = 0; i < x4_positions.size(); ++i) {
|
||||
@@ -394,4 +395,4 @@ float CCameraSpline::ClampLength(const zeus::CVector3f& pos, bool collide, const
|
||||
return x44_length;
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "World/CEntityInfo.hpp"
|
||||
#include "zeus/CVector3f.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
class CStateManager;
|
||||
class CMaterialFilter;
|
||||
|
||||
@@ -40,4 +40,4 @@ public:
|
||||
bool IsClosedLoop() const { return x48_closedLoop; }
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include "TCastTo.hpp" // Generated file, do not modify include path
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
CCinematicCamera::CCinematicCamera(TUniqueId uid, std::string_view name, const CEntityInfo& info,
|
||||
const zeus::CTransform& xf, bool active, float shotDuration, float fovy, float znear,
|
||||
@@ -454,4 +454,4 @@ void CCinematicCamera::CalculateWaypoints(CStateManager& mgr) {
|
||||
void CCinematicCamera::SendArrivedMsg(TUniqueId reciever, CStateManager& mgr) {
|
||||
mgr.SendScriptMsgAlways(reciever, GetUniqueId(), EScriptObjectMessage::Arrived);
|
||||
}
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <zeus/CQuaternion.hpp>
|
||||
#include <zeus/CVector3f.hpp>
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
class CCinematicCamera : public CGameCamera {
|
||||
std::vector<zeus::CVector3f> x188_viewPoints;
|
||||
@@ -56,4 +56,4 @@ public:
|
||||
float GetDuration() const { return x1e8_duration; }
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -8,11 +8,7 @@
|
||||
|
||||
#include "TCastTo.hpp" // Generated file, do not modify include path
|
||||
|
||||
namespace DataSpec::DNAMP1 {
|
||||
extern hecl::CVar* tw_fov;
|
||||
}
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
CFirstPersonCamera::CFirstPersonCamera(TUniqueId uid, const zeus::CTransform& xf, TUniqueId watchedObj,
|
||||
float orbitCameraSpeed, float fov, float nearz, float farz, float aspect)
|
||||
@@ -20,7 +16,7 @@ CFirstPersonCamera::CFirstPersonCamera(TUniqueId uid, const zeus::CTransform& xf
|
||||
nearz, farz, aspect, watchedObj, false, 0)
|
||||
, x188_orbitCameraSpeed(orbitCameraSpeed)
|
||||
, x190_gunFollowXf(xf) {
|
||||
DataSpec::DNAMP1::tw_fov->addListener([this](hecl::CVar* cv) { _fovListener(cv); });
|
||||
DataSpec::DNAMP1::tw_FieldOfView->addListener([this](hecl::CVar* cv) { _fovListener(cv); });
|
||||
}
|
||||
|
||||
void CFirstPersonCamera::Accept(IVisitor& visitor) { visitor.Visit(this); }
|
||||
@@ -337,4 +333,4 @@ void CFirstPersonCamera::_fovListener(hecl::CVar* cv) {
|
||||
x170_24_perspDirty = true;
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <zeus/CTransform.hpp>
|
||||
#include <zeus/CVector3f.hpp>
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
class CFirstPersonCamera : public CGameCamera {
|
||||
float x188_orbitCameraSpeed;
|
||||
@@ -37,4 +37,4 @@ public:
|
||||
void SetLockCamera(bool v) { x18c_lockCamera = v; }
|
||||
void DeferBallTransitionProcessing() { x1c6_24_deferBallTransitionProcessing = true; }
|
||||
};
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "Runtime/Camera/CCameraManager.hpp"
|
||||
#include "Runtime/World/CActorParameters.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
CGameCamera::CGameCamera(TUniqueId uid, bool active, std::string_view name, const CEntityInfo& info,
|
||||
const zeus::CTransform& xf, float fovy, float znear, float zfar, float aspect,
|
||||
@@ -134,4 +134,4 @@ void CGameCamera::SkipFovInterpolation() {
|
||||
|
||||
x178_perspInterpRemTime = x174_delayTime = 0.f;
|
||||
}
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <zeus/CMatrix4f.hpp>
|
||||
#include <zeus/CTransform.hpp>
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
struct CFinalInput;
|
||||
|
||||
class CGameCamera : public CActor {
|
||||
@@ -54,4 +54,4 @@ public:
|
||||
void SetFovInterpolation(float start, float end, float time, float delayTime);
|
||||
void SkipFovInterpolation();
|
||||
};
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "TCastTo.hpp" // Generated file, do not modify include path
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
CInterpolationCamera::CInterpolationCamera(TUniqueId uid, const zeus::CTransform& xf)
|
||||
: CGameCamera(uid, false, "Interpolation Camera",
|
||||
@@ -205,4 +205,4 @@ bool CInterpolationCamera::InterpolateWithDistance(zeus::CTransform& xf, const z
|
||||
return ret;
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <zeus/CTransform.hpp>
|
||||
#include <zeus/CVector3f.hpp>
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
class CInterpolationCamera : public CGameCamera {
|
||||
TUniqueId x188_targetId = kInvalidUniqueId;
|
||||
@@ -38,4 +38,4 @@ public:
|
||||
void DeactivateInterpCamera(CStateManager&);
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include "TCastTo.hpp" // Generated file, do not modify include path
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
CPathCamera::CPathCamera(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
|
||||
bool active, float lengthExtent, float filterMag, float filterProportion, float minEaseDist,
|
||||
@@ -211,4 +211,4 @@ void CPathCamera::ClampToClosedDoor(CStateManager& mgr) {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "Runtime/Camera/CCameraSpline.hpp"
|
||||
#include "Runtime/Camera/CGameCamera.hpp"
|
||||
|
||||
namespace urde {
|
||||
namespace metaforce {
|
||||
|
||||
class CPathCamera : public CGameCamera {
|
||||
public:
|
||||
@@ -36,4 +36,4 @@ public:
|
||||
void ClampToClosedDoor(CStateManager&);
|
||||
};
|
||||
|
||||
} // namespace urde
|
||||
} // namespace metaforce
|
||||
|
||||
Reference in New Issue
Block a user