mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-06-01 16:01:22 +00:00
CCameraSpline: Resolve sign-conversion warnings
All call sites are already compatible with these changes, so they can safely be made.
This commit is contained in:
parent
dd7d9c024f
commit
92d65462b9
@ -50,15 +50,18 @@ void CCameraSpline::Initialize(TUniqueId cameraId, const std::vector<SConnection
|
|||||||
x44_length = CalculateSplineLength();
|
x44_length = CalculateSplineLength();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCameraSpline::Reset(int size) {
|
void CCameraSpline::Reset(size_t size) {
|
||||||
x4_positions.clear();
|
x4_positions.clear();
|
||||||
x24_t.clear();
|
x24_t.clear();
|
||||||
x34_directions.clear();
|
x34_directions.clear();
|
||||||
if (size != 0) {
|
|
||||||
x4_positions.reserve(size);
|
if (size == 0) {
|
||||||
x24_t.reserve(size);
|
return;
|
||||||
x34_directions.reserve(size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
x4_positions.reserve(size);
|
||||||
|
x24_t.reserve(size);
|
||||||
|
x34_directions.reserve(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCameraSpline::AddKnot(const zeus::CVector3f& pos, const zeus::CVector3f& dir) {
|
void CCameraSpline::AddKnot(const zeus::CVector3f& pos, const zeus::CVector3f& dir) {
|
||||||
@ -66,21 +69,24 @@ void CCameraSpline::AddKnot(const zeus::CVector3f& pos, const zeus::CVector3f& d
|
|||||||
x34_directions.push_back(dir);
|
x34_directions.push_back(dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCameraSpline::SetKnotPosition(int idx, const zeus::CVector3f& pos) {
|
void CCameraSpline::SetKnotPosition(size_t idx, const zeus::CVector3f& pos) {
|
||||||
if (idx >= x4_positions.size())
|
if (idx >= x4_positions.size()) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
x4_positions[idx] = pos;
|
x4_positions[idx] = pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
const zeus::CVector3f& CCameraSpline::GetKnotPosition(int idx) const {
|
const zeus::CVector3f& CCameraSpline::GetKnotPosition(size_t idx) const {
|
||||||
if (idx >= x4_positions.size())
|
if (idx >= x4_positions.size()) {
|
||||||
return zeus::skZero3f;
|
return zeus::skZero3f;
|
||||||
|
}
|
||||||
return x4_positions[idx];
|
return x4_positions[idx];
|
||||||
}
|
}
|
||||||
|
|
||||||
float CCameraSpline::GetKnotT(int idx) const {
|
float CCameraSpline::GetKnotT(size_t idx) const {
|
||||||
if (idx >= x4_positions.size())
|
if (idx >= x4_positions.size()) {
|
||||||
return 0.f;
|
return 0.f;
|
||||||
|
}
|
||||||
return x24_t[idx];
|
return x24_t[idx];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,10 +123,11 @@ float CCameraSpline::CalculateSplineLength() {
|
|||||||
return 0.f;
|
return 0.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CCameraSpline::GetSurroundingPoints(int idx, rstl::reserved_vector<zeus::CVector3f, 4>& positions,
|
bool CCameraSpline::GetSurroundingPoints(size_t idx, rstl::reserved_vector<zeus::CVector3f, 4>& positions,
|
||||||
rstl::reserved_vector<zeus::CVector3f, 4>& directions) const {
|
rstl::reserved_vector<zeus::CVector3f, 4>& directions) const {
|
||||||
if (x4_positions.size() <= 3 || idx < 0 || idx >= x4_positions.size())
|
if (x4_positions.size() <= 3 || idx < 0 || idx >= x4_positions.size()) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (idx > 0) {
|
if (idx > 0) {
|
||||||
positions.push_back(x4_positions[idx - 1]);
|
positions.push_back(x4_positions[idx - 1]);
|
||||||
|
@ -15,18 +15,18 @@ class CCameraSpline {
|
|||||||
std::vector<zeus::CVector3f> x34_directions;
|
std::vector<zeus::CVector3f> x34_directions;
|
||||||
float x44_length = 0.f;
|
float x44_length = 0.f;
|
||||||
bool x48_closedLoop = false;
|
bool x48_closedLoop = false;
|
||||||
bool GetSurroundingPoints(int idx, rstl::reserved_vector<zeus::CVector3f, 4>& positions,
|
bool GetSurroundingPoints(size_t idx, rstl::reserved_vector<zeus::CVector3f, 4>& positions,
|
||||||
rstl::reserved_vector<zeus::CVector3f, 4>& directions) const;
|
rstl::reserved_vector<zeus::CVector3f, 4>& directions) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CCameraSpline(bool closedLoop);
|
explicit CCameraSpline(bool closedLoop);
|
||||||
void CalculateKnots(TUniqueId cameraId, const std::vector<SConnection>& connections, CStateManager& mgr);
|
void CalculateKnots(TUniqueId cameraId, const std::vector<SConnection>& connections, CStateManager& mgr);
|
||||||
void Initialize(TUniqueId cameraId, const std::vector<SConnection>& connections, CStateManager& mgr);
|
void Initialize(TUniqueId cameraId, const std::vector<SConnection>& connections, CStateManager& mgr);
|
||||||
void Reset(int size);
|
void Reset(size_t size);
|
||||||
void AddKnot(const zeus::CVector3f& pos, const zeus::CVector3f& dir);
|
void AddKnot(const zeus::CVector3f& pos, const zeus::CVector3f& dir);
|
||||||
void SetKnotPosition(int idx, const zeus::CVector3f& pos);
|
void SetKnotPosition(size_t idx, const zeus::CVector3f& pos);
|
||||||
const zeus::CVector3f& GetKnotPosition(int idx) const;
|
const zeus::CVector3f& GetKnotPosition(size_t idx) const;
|
||||||
float GetKnotT(int idx) const;
|
float GetKnotT(size_t idx) const;
|
||||||
float CalculateSplineLength();
|
float CalculateSplineLength();
|
||||||
void UpdateSplineLength() { x44_length = CalculateSplineLength(); }
|
void UpdateSplineLength() { x44_length = CalculateSplineLength(); }
|
||||||
zeus::CTransform GetInterpolatedSplinePointByLength(float pos) const;
|
zeus::CTransform GetInterpolatedSplinePointByLength(float pos) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user