diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-05-05 03:45:18 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-05-05 03:45:18 +0200 |
commit | 84c9484e55874c57c1c017cb2394e0c6b2f32303 (patch) | |
tree | bcd2cbc38055ee38aa1aa2b35dd46d0f5e2e0772 /src/vehicles/Automobile.cpp | |
parent | Merge pull request #508 from Nick007J/master (diff) | |
download | re3-84c9484e55874c57c1c017cb2394e0c6b2f32303.tar re3-84c9484e55874c57c1c017cb2394e0c6b2f32303.tar.gz re3-84c9484e55874c57c1c017cb2394e0c6b2f32303.tar.bz2 re3-84c9484e55874c57c1c017cb2394e0c6b2f32303.tar.lz re3-84c9484e55874c57c1c017cb2394e0c6b2f32303.tar.xz re3-84c9484e55874c57c1c017cb2394e0c6b2f32303.tar.zst re3-84c9484e55874c57c1c017cb2394e0c6b2f32303.zip |
Diffstat (limited to '')
-rw-r--r-- | src/vehicles/Automobile.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp index 58971786..9db60da0 100644 --- a/src/vehicles/Automobile.cpp +++ b/src/vehicles/Automobile.cpp @@ -3186,10 +3186,10 @@ CAutomobile::PlaceOnRoadProperly(void) float c = Cos(angle); float s = Sin(angle); - GetRight() = CVector((front.y - rear.y)/len, -(front.x - rear.x)/len, 0.0f); - GetForward() = CVector(-c*GetRight().y, c*GetRight().x, s); - GetUp() = CrossProduct(GetRight(), GetForward()); - GetPosition() = CVector((front.x + rear.x)/2.0f, (front.y + rear.y)/2.0f, (frontZ + rearZ)/2.0f + GetHeightAboveRoad()); + GetMatrix().GetRight() = CVector((front.y - rear.y) / len, -(front.x - rear.x) / len, 0.0f); + GetMatrix().GetForward() = CVector(-c * GetRight().y, c * GetRight().x, s); + GetMatrix().GetUp() = CrossProduct(GetRight(), GetForward()); + GetMatrix().GetPosition() = CVector((front.x + rear.x) / 2.0f, (front.y + rear.y) / 2.0f, (frontZ + rearZ) / 2.0f + GetHeightAboveRoad()); } void @@ -4408,7 +4408,7 @@ CAutomobile::SpawnFlyingComponent(int32 component, uint32 type) if(GetUp().z > 0.0f){ // simulate fast upward movement if going fast float speed = CVector2D(m_vecMoveSpeed).MagnitudeSqr(); - obj->GetPosition() += GetUp()*speed; + obj->GetMatrix().Translate(GetUp()*speed); } } obj->ApplyMoveForce(dist); |