Hallo Leute,
in Davids tbObject::ApplyForce hab ich den größten Teil verstanden, hab aber noch an dieser Stelle Verständnisprobleme.
|
C-/C++-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
|
// Rotation um die x-Achse
AddRotationRel(tbVector3(vRelAttack.z * -vRelForce.y * fInvMass, 0.0f, 0.0f));
AddRotationRel(tbVector3(vRelAttack.y * vRelForce.z * fInvMass, 0.0f, 0.0f));
// Rotation um die y-Achse
AddRotationRel(tbVector3(0.0f, vRelAttack.x * vRelForce.z * fInvMass, 0.0f));
AddRotationRel(tbVector3(0.0f, vRelAttack.z * vRelForce.x * fInvMass, 0.0f));
// Rotation um die z-Achse
AddRotationRel(tbVector3(0.0f, 0.0f, vRelAttack.x * -vRelForce.y * fInvMass));
AddRotationRel(tbVector3(0.0f, 0.0f, vRelAttack.y * vRelForce.x * fInvMass));
|
Ich weiß, dass es funktioniert und ich weiß, dass es dazu ist, um die Rotation des Objekts zu setzen. Auch verstehe ich recht gut, wie das funktioniert.
Allerdings frage ich mich, warum man vRelForce.y immer negativ verwendet.
Kann es mir jemand bitte kurz erklären?