added all missing functionis
This commit is contained in:
parent
b636977ccd
commit
fada2730bf
@ -14,8 +14,11 @@ void Vektor::add(const Vektor &vec2) {
|
|||||||
this->x += vec2.x;
|
this->x += vec2.x;
|
||||||
this->y += vec2.y;
|
this->y += vec2.y;
|
||||||
}
|
}
|
||||||
|
void Vektor::ausgabeVektor(const Vektor &vec){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Koerper bewegeKoerper(const Koerper &korp, const Vektor &gesamtkraft,const float &dt) {
|
/*Koerper bewegeKoerper(const Koerper &korp, const Vektor &gesamtkraft,const float &dt) {
|
||||||
Koerper erg = {0, {0,0}, {0,0}};
|
Koerper erg = {0, {0,0}, {0,0}};
|
||||||
// Berechnung der Beschleunigung aus der Kraft
|
// Berechnung der Beschleunigung aus der Kraft
|
||||||
const float xBeschleunigung = gesamtkraft.x / korp.masse;
|
const float xBeschleunigung = gesamtkraft.x / korp.masse;
|
||||||
@ -29,13 +32,32 @@ Koerper bewegeKoerper(const Koerper &korp, const Vektor &gesamtkraft,const float
|
|||||||
erg.position.x += korp.position.x + dt * erg.geschwindigkeit.x;
|
erg.position.x += korp.position.x + dt * erg.geschwindigkeit.x;
|
||||||
erg.position.y += korp.position.y + dt * erg.geschwindigkeit.y;
|
erg.position.y += korp.position.y + dt * erg.geschwindigkeit.y;
|
||||||
return erg;
|
return erg;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
float Koerper::liefereMasse()
|
||||||
|
{
|
||||||
|
return this->masse;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ausgabeKoerper(const Koerper &korp){
|
Koerper Koerper::bewegeKoerper(const Koerper &korp, const Vektor &gesamtkraft, const float &dt)
|
||||||
cout << "x = " << korp.position.x << "y = " << korp.position.y;
|
{
|
||||||
|
this->geschwindigkeit.x += gesamtkraft.x * dt;
|
||||||
|
this->geschwindigkeit.y += gesamtkraft.y * dt;
|
||||||
|
this->position.x += this->geschwindigkeit.x * dt;
|
||||||
|
this->position.y += this->geschwindigkeit.y * dt;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ausgabeVektor(const Vektor &vec){
|
Vektor Koerper::lieferePosition()
|
||||||
cout << "x = " << vec.x << endl;
|
{
|
||||||
cout << "y = " << vec.y << endl;
|
return this->position;
|
||||||
|
}
|
||||||
|
|
||||||
|
Vektor Koerper::liefereGeschwindigkeit()
|
||||||
|
{
|
||||||
|
return this->geschwindigkeit;
|
||||||
|
}
|
||||||
|
|
||||||
|
string Koerper::text()
|
||||||
|
{
|
||||||
|
return string();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,6 +33,5 @@ public:
|
|||||||
Koerper bewegeKoerper(const Koerper &korp, const Vektor &gesamtkraft, const float &dt);
|
Koerper bewegeKoerper(const Koerper &korp, const Vektor &gesamtkraft, const float &dt);
|
||||||
Vektor lieferePosition();
|
Vektor lieferePosition();
|
||||||
Vektor liefereGeschwindigkeit();
|
Vektor liefereGeschwindigkeit();
|
||||||
void bewegen(Vektor beschleunigung, float dt);
|
|
||||||
string text();
|
string text();
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user