mirror of
https://github.com/GTAmodding/re3.git
synced 2024-12-28 07:46:19 +00:00
use SetOrientation
This commit is contained in:
parent
8a0a29c64e
commit
024f0a5027
1 changed files with 3 additions and 10 deletions
|
@ -54,10 +54,7 @@ CStinger::Init(CPed *pPed)
|
||||||
m_fMax_Z = Atan2(-pPed->GetForward().x, pPed->GetForward().y) + HALFPI;
|
m_fMax_Z = Atan2(-pPed->GetForward().x, pPed->GetForward().y) + HALFPI;
|
||||||
|
|
||||||
for (i = 0; i < NUM_STINGER_SEGMENTS; i++) {
|
for (i = 0; i < NUM_STINGER_SEGMENTS; i++) {
|
||||||
// shouldn't this be some inlined method? guh...
|
pSpikes[i]->SetOrientation(0.0f, 0.0f, Atan2(-pPed->GetForward().x, pPed->GetForward().y));
|
||||||
CVector pos = pSpikes[i]->GetPosition();
|
|
||||||
pSpikes[i]->GetMatrix().SetRotate(0.0f, 0.0f, Atan2(-pPed->GetForward().x, pPed->GetForward().y));
|
|
||||||
pSpikes[i]->GetMatrix().Translate(pos);
|
|
||||||
pSpikes[i]->SetPosition(m_vPos);
|
pSpikes[i]->SetPosition(m_vPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,15 +213,11 @@ CStinger::Process()
|
||||||
pos2d = CVector2D(0.0f, 0.0f);
|
pos2d = CVector2D(0.0f, 0.0f);
|
||||||
|
|
||||||
if (spike % 2 == 0) {
|
if (spike % 2 == 0) {
|
||||||
CVector pos = pSpikes[spike]->GetPosition();
|
pSpikes[spike]->SetOrientation(0.0f, 0.0f, angle1);
|
||||||
pSpikes[spike]->GetMatrix().SetRotate(0.0f, 0.0f, angle1);
|
|
||||||
pSpikes[spike]->GetMatrix().Translate(pos);
|
|
||||||
pos3d.x += pos2d.x;
|
pos3d.x += pos2d.x;
|
||||||
pos3d.y += pos2d.y;
|
pos3d.y += pos2d.y;
|
||||||
} else {
|
} else {
|
||||||
CVector pos = pSpikes[spike]->GetPosition();
|
pSpikes[spike]->SetOrientation(0.0f, 0.0f, angle2);
|
||||||
pSpikes[spike]->GetMatrix().SetRotate(0.0f, 0.0f, angle2);
|
|
||||||
pSpikes[spike]->GetMatrix().Translate(pos);
|
|
||||||
}
|
}
|
||||||
pSpikes[spike]->SetPosition(pos3d);
|
pSpikes[spike]->SetPosition(pos3d);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue