Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit b00f513

Browse files
committed
Use RotateOffset
1 parent b0a6bd0 commit b00f513

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

Entities/AtomGroup.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,7 +1280,7 @@ namespace RTE {
12801280

12811281
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
12821282

1283-
bool AtomGroup::ResolveTerrainIntersection(Vector &position, Matrix &rotation, unsigned char strongerThan) const {
1283+
bool AtomGroup::ResolveTerrainIntersection(Vector &position, unsigned char strongerThan) const {
12841284
std::list<Atom *> intersectingAtoms;
12851285
MOID hitMaterial = g_MaterialAir;
12861286

@@ -1292,8 +1292,7 @@ namespace RTE {
12921292

12931293
// First go through all Atoms to find the first intersection and get the intersected MO
12941294
for (Atom *atom : m_Atoms) {
1295-
atomOffset = atom->GetOffset().GetXFlipped(m_OwnerMO->IsHFlipped());
1296-
atomOffset *= rotation;
1295+
atomOffset = m_OwnerMO->RotateOffset(atom->GetOffset());
12971296
atom->SetupPos(position + atomOffset);
12981297
atomPos = atom->GetCurrentPos();
12991298
hitMaterial = g_SceneMan.GetTerrain()->GetPixel(atomPos.GetFloorIntX(), atomPos.GetFloorIntY());

Entities/AtomGroup.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,9 @@ namespace RTE {
313313
/// Checks whether any of the Atoms in this AtomGroup are on top of terrain pixels, and if so, attempt to move the OwnerMO out so none of the Atoms are inside any terrain pixels anymore.
314314
/// </summary>
315315
/// <param name="position">Current position of the owner MO.</param>
316-
/// <param name="rotation">Current rotation of the owner MO.</param>
317316
/// <param name="strongerThan">Only attempt to move out of materials stronger than this specific ID.</param>
318317
/// <returns>Whether any intersection was successfully resolved. Will return true even if there wasn't any intersections to begin with.</returns>
319-
bool ResolveTerrainIntersection(Vector &position, Matrix &rotation, unsigned char strongerThan = 0) const;
318+
bool ResolveTerrainIntersection(Vector &position, unsigned char strongerThan = 0) const;
320319

321320
/// <summary>
322321
/// Checks whether any of the Atoms in this AtomGroup are on top of MOSprites, and if so, attempt to move the OwnerMO out so none of the Atoms are inside the other MOSprite's silhouette anymore.

Entities/MOSRotating.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ void MOSRotating::GibThis(Vector impactImpulse, float internalBlast, MovableObje
10841084

10851085
bool MOSRotating::MoveOutOfTerrain(unsigned char strongerThan)
10861086
{
1087-
return m_pAtomGroup->ResolveTerrainIntersection(m_Pos, m_Rotation, strongerThan);
1087+
return m_pAtomGroup->ResolveTerrainIntersection(m_Pos, strongerThan);
10881088
}
10891089

10901090

0 commit comments

Comments
 (0)