Commit iniziale: è presente una base del progetto con joint di base
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
#include "piece_interface.hpp"
|
||||
|
||||
#ifndef COSCIA_H
|
||||
#define COSCIA_H
|
||||
|
||||
const sf::Vector2f coscia_Dim = {80, 200};
|
||||
const sf::Color coscia_Col = sf::Color::Yellow;
|
||||
|
||||
|
||||
class Coscia : public PieceInterface{
|
||||
public:
|
||||
|
||||
Coscia(rb::Vector3 coords, _Float16 mass);
|
||||
~Coscia();
|
||||
|
||||
void update(sf::Clock cl) override;
|
||||
sf::Shape* draw(ReferencePlane plane) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1 @@
|
||||
#include "piece_interface.hpp"
|
||||
@@ -0,0 +1,40 @@
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include <math.h>
|
||||
#include "../../rigidbody/headers/rb.hpp"
|
||||
//#include "../../joints/headers/joint_interface.hpp"
|
||||
|
||||
#ifndef PIECE_INTERFACE_H
|
||||
#define PIECE_INTERFACE_H
|
||||
|
||||
|
||||
// costanti
|
||||
|
||||
const sf::Vector2f caviglia_Dim = {50, 200};
|
||||
const sf::Color caviglia_Col = sf::Color::Red;
|
||||
|
||||
enum class ReferencePlane {
|
||||
XY,
|
||||
YZ,
|
||||
XZ
|
||||
};
|
||||
|
||||
//classi
|
||||
class PieceInterface{
|
||||
protected:
|
||||
|
||||
//std::vector<JointInterface*> joints;
|
||||
|
||||
public:
|
||||
sf::Shape* shape;
|
||||
sf::Vector2f size;
|
||||
rb::Vector3 globalPos;
|
||||
rb::rigidbody body;
|
||||
sf::Color color;
|
||||
|
||||
virtual void update(sf::Clock cl) = 0;
|
||||
virtual sf::Shape* draw(ReferencePlane plane) = 0;
|
||||
virtual ~PieceInterface(){}
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,38 @@
|
||||
#include "piece_interface.hpp"
|
||||
|
||||
#ifndef SENSORE_H
|
||||
#define SENSORE_H
|
||||
|
||||
const sf::Vector2f sensore_Dim = {30, 60};
|
||||
const sf::Color sensore_Col = sf::Color::Red;
|
||||
|
||||
class Sensore : public PieceInterface{
|
||||
private:
|
||||
std::vector<std::vector<float>> accData;
|
||||
std::vector<std::vector<float>> gData;
|
||||
std::vector<std::vector<float>> rotData;
|
||||
std::vector<float> timeData;
|
||||
rb::Vector3 stPos;
|
||||
|
||||
//in che punto sto controllando il segnale
|
||||
unsigned int dataPos;
|
||||
unsigned int dataIntvl;
|
||||
|
||||
|
||||
//funzioni ausiliarie
|
||||
void calcRotWithG(unsigned int index);
|
||||
|
||||
public:
|
||||
Sensore(rb::Vector3 coords, _Float16 mass);
|
||||
Sensore(rb::Vector3 coords, _Float16 mass, unsigned int st, unsigned int dataIntvl, std::vector<std::vector<float>> data);
|
||||
~Sensore();
|
||||
|
||||
void update(sf::Clock cl) override;
|
||||
sf::Shape* draw(ReferencePlane plane) override;
|
||||
|
||||
//funzioni specifiche
|
||||
void initCSV(std::vector<std::vector<float>> data);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user