Commit iniziale: è presente una base del progetto con joint di base

This commit is contained in:
2026-05-30 22:58:06 +02:00
parent 62fbb000d8
commit 30c8f35b28
81 changed files with 113139 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
#include "../headers/coscia.hpp"
Coscia::Coscia(rb::Vector3 coords, _Float16 mass){
size = coscia_Dim;
rb::Vector3 com = {size.x/2,0, size.y/2};
body = rb::rigidbody(coords, com, mass);
color = coscia_Col;
shape = new sf::RectangleShape(size);
shape->setOrigin({size.x/2,size.y/2});
globalPos = {0,0,0};
}
Coscia::~Coscia(){
delete shape;
}
void Coscia::update(sf::Clock cl){
//body.step(cl);
}
sf::Shape* Coscia::draw(ReferencePlane plane){
shape->setFillColor(color);
rb::Vector3 tmpPos = body.getPos();
rb::Vector3_s tmpRot = body.getRot();
switch (plane)
{
case ReferencePlane::XZ:
shape->setPosition({tmpPos[0]+globalPos[0],tmpPos[2]+globalPos[2]});
shape->setRotation(sf::Angle(sf::radians(tmpRot[2])));
break;
default:
break;
}
return shape;
}