2017-01-30 02:15:21 +00:00
|
|
|
#ifndef __URDE_CCAMERASPLINE_HPP__
|
|
|
|
#define __URDE_CCAMERASPLINE_HPP__
|
|
|
|
|
|
|
|
#include "World/CEntityInfo.hpp"
|
|
|
|
|
|
|
|
namespace urde
|
|
|
|
{
|
|
|
|
class CStateManager;
|
|
|
|
class CCameraSpline
|
|
|
|
{
|
2017-10-09 02:41:50 +00:00
|
|
|
friend class CBallCamera;
|
2017-10-10 03:50:48 +00:00
|
|
|
std::vector<zeus::CVector3f> x4_positions;
|
2017-01-30 02:15:21 +00:00
|
|
|
std::vector<TUniqueId> x14_;
|
2017-10-13 07:19:22 +00:00
|
|
|
std::vector<float> x24_t;
|
2017-10-10 03:50:48 +00:00
|
|
|
std::vector<zeus::CVector3f> x34_directions;
|
2017-10-13 07:19:22 +00:00
|
|
|
float x44_length = 0.f;
|
|
|
|
bool x48_closedLoop = false;
|
|
|
|
bool GetSurroundingPoints(int idx, rstl::reserved_vector<zeus::CVector3f, 4>& positions,
|
|
|
|
rstl::reserved_vector<zeus::CVector3f, 4>& directions) const;
|
2017-01-30 02:15:21 +00:00
|
|
|
public:
|
|
|
|
CCameraSpline(bool);
|
|
|
|
void CalculateKnots(TUniqueId, const std::vector<SConnection>&, CStateManager&);
|
|
|
|
void Initialize(TUniqueId, const std::vector<SConnection>&, CStateManager&);
|
2017-10-09 02:41:50 +00:00
|
|
|
void Reset(int size);
|
2017-10-10 03:50:48 +00:00
|
|
|
void AddKnot(const zeus::CVector3f& pos, const zeus::CVector3f& dir);
|
|
|
|
void SetKnotPosition(int idx, const zeus::CVector3f& pos);
|
2017-10-13 07:19:22 +00:00
|
|
|
const zeus::CVector3f& GetKnotPosition(int idx) const;
|
|
|
|
float GetKnotT(int idx) const;
|
2017-10-09 02:41:50 +00:00
|
|
|
float CalculateSplineLength();
|
2017-10-13 07:19:22 +00:00
|
|
|
void UpdateSplineLength() { x44_length = CalculateSplineLength(); }
|
|
|
|
zeus::CTransform GetInterpolatedSplinePointByLength(float pos);
|
|
|
|
zeus::CVector3f GetInterpolatedSplinePointByTime(float time, float range);
|
2017-01-30 02:15:21 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // __URDE_CCAMERASPLINE_HPP__
|