Skip to content

Commit d070011

Browse files
committed
Renamed XNASlopes physics option to MBUSlopes and added MBGSlopes option
1 parent b1cdeec commit d070011

File tree

5 files changed

+16
-12
lines changed

5 files changed

+16
-12
lines changed

engine/source/game/marble/marble.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -2274,8 +2274,11 @@ ConsoleMethod(Marble, setPhysics, void, 3, 3, "(physics)")
22742274
physicsStrings[Marble::XNA] = "XNA";
22752275
physicsFlags[Marble::XNA] = Marble::XNA;
22762276

2277-
physicsStrings[Marble::XNASlopes] = "XNASlopes";
2278-
physicsFlags[Marble::XNASlopes] = Marble::XNASlopes;
2277+
physicsStrings[Marble::MBUSlopes] = "MBUSlopes";
2278+
physicsFlags[Marble::MBUSlopes] = Marble::MBUSlopes;
2279+
2280+
physicsStrings[Marble::MBGSlopes] = "MBGSlopes";
2281+
physicsFlags[Marble::MBGSlopes] = Marble::MBGSlopes;
22792282

22802283
S32 i = 0;
22812284
while (dStricmp(physicsStrings[i], physics))

engine/source/game/marble/marble.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ class Marble : public ShapeBase
7171
MBU,
7272
MBG,
7373
XNA,
74-
XNASlopes,
74+
MBUSlopes,
75+
MBGSlopes,
7576
MBPhysics_Count
7677
};
7778

engine/source/game/marble/marblecollision.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -592,19 +592,19 @@ void Marble::findContacts(U32 contactMask, const Point3D* inPos, const F32* inRa
592592

593593
if (PlaneD(vertPlane + vertex, vertex, vertex + plane).distToPlane(contactVert) >= 0.0) {
594594
if (PlaneD(lastVertex - vertPlane, lastVertex, lastVertex + plane).distToPlane(contactVert) >= 0.0) {
595-
if (mPhysics == MBG)
595+
if (mPhysics == MBG || mPhysics == MBGSlopes)
596596
finalContact = vertPlane.project(contactVert);
597597
else
598598
contactVert = vertPlane.project(contactVert);
599599
break;
600600
}
601-
if (mPhysics == MBG)
601+
if (mPhysics == MBG || mPhysics == MBGSlopes)
602602
finalContact = lastVertex;
603603
else
604604
contactVert = lastVertex;
605605
}
606606
else {
607-
if (mPhysics == MBG)
607+
if (mPhysics == MBG || mPhysics == MBGSlopes)
608608
finalContact = vertex;
609609
else
610610
contactVert = vertex;
@@ -628,7 +628,7 @@ void Marble::findContacts(U32 contactMask, const Point3D* inPos, const F32* inRa
628628

629629
U32 materialId = poly->material;
630630
Point3D delta;
631-
if (mPhysics == MBG)
631+
if (mPhysics == MBG || mPhysics == MBGSlopes)
632632
delta = *pos - finalContact;
633633
else
634634
delta = *pos - contactVert;
@@ -655,7 +655,7 @@ void Marble::findContacts(U32 contactMask, const Point3D* inPos, const F32* inRa
655655

656656
contact.restitution = restitution;
657657
contact.normal = normal;
658-
if (mPhysics == MBG)
658+
if (mPhysics == MBG || mPhysics == MBGSlopes)
659659
contact.position = finalContact;
660660
else
661661
contact.position = contactVert;

engine/source/game/marble/marblephysics.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void Marble::applyContactForces(const Move* move, bool isCentered, Point3D& aCon
106106
}
107107
}
108108

109-
if (mPhysics != XNASlopes)
109+
if (mPhysics != MBUSlopes && mPhysics != MBGSlopes)
110110
{
111111
for (S32 i = 0; i < mContacts.size(); i++)
112112
{
@@ -265,7 +265,7 @@ bool Marble::computeMoveForces(Point3D& aControl, Point3D& desiredOmega, const M
265265
Point2F currentVelocity(mDot(sideDir, rollVelocity), mDot(motionDir, rollVelocity));
266266

267267
Point2F mv(move->x, move->y);
268-
if (mPhysics != MBG)
268+
if (mPhysics != MBG && mPhysics != MBGSlopes)
269269
{
270270
// Prevent increasing marble speed with diagonal movement (on the ground)
271271
mv *= 1.538461565971375;
@@ -677,7 +677,7 @@ void Marble::advancePhysics(const Move* move, U32 timeDelta)
677677
}
678678

679679
it++;
680-
} while (mPhysics == MBG || it <= 10);
680+
} while (mPhysics == MBG || mPhysics == MBGSlopes || it <= 10);
681681

682682
for (S32 i = 0; i < smPathItrVec.size(); i++)
683683
smPathItrVec[i]->popTickState();

game/marble/data/missions/Multiplayer/Polysoup/polysoup.mis

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ name = $Text::LevelNameMP26;
1111
difficulty = "4";
1212
gameType = "MultiPlayer";
1313
gameMode = "Scrum";
14-
physics = "XNASlopes";
14+
physics = "MBUSlopes";
1515
time = "300000";
1616
maxGemsPerGroup = "9";
1717
desc = "A preview mission";

0 commit comments

Comments
 (0)