#pragma once

#ifndef SPLINE_H
#define SPLINE_H

#include "common.hpp"

#include <vector>
#include <sstream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>

using namespace std;

class Spline
{
public:
	//Constructor
	Spline();
	~Spline();

	void calculateTangentPoints();	//calculate the tangent points
	void calculateFireTangentPoints();
	void addEyeControl(glm::vec3 &point);
	void addCenterControl(glm::vec3 &point);
	glm::vec3 getEyeControl(int i);
	glm::vec3 getEyeTangent(int i);
	glm::vec3 getCenterControl(int i);
	glm::vec3 getCenterTangent(int i);

	glm::vec3 getInterpolPoint(float t, glm::vec3& p1, glm::vec3& t1, glm::vec3& p2, glm::vec3& t2);

	bool load_cam_positions(char* filepath);
	bool load_firecam_positions(char* filepath);
	//cast a string to a float
	float StringToFloat(const std::string& str_input, const float default_value);

//private:
	std::vector<glm::vec3> controlpointseye;
	std::vector<glm::vec3> tangentpointseye;
	std::vector<glm::vec3> controlpointscenter;
	std::vector<glm::vec3> tangentpointscenter;

};
#endif