Skip to content

Commit c115e79

Browse files
committed
Physics tweaks for debris
1 parent 119b37d commit c115e79

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,11 @@ class GenericObjectCreationNugget : public ObjectCreationNugget
11101110
objUp->setExtraFriction(m_extraFriction);
11111111

11121112
Coord3D force;
1113+
#if defined(GENERALS_ONLINE)
1114+
Real horizForce = 2.0f * m_dispositionIntensity; // 2
1115+
#else
11131116
Real horizForce = 4.0f * m_dispositionIntensity; // 2
1117+
#endif
11141118
force.x = GameLogicRandomValueReal( -horizForce, horizForce );
11151119
force.y = GameLogicRandomValueReal( -horizForce, horizForce );
11161120
force.z = 0;
@@ -1202,16 +1206,29 @@ class GenericObjectCreationNugget : public ObjectCreationNugget
12021206
DUMPREAL(m_maxPitch);
12031207
DUMPCOORD3D(&force);
12041208
}
1209+
1210+
#if defined(GENERALS_ONLINE)
1211+
force.x /= 2.f;
1212+
force.y /= 2.f;
1213+
force.z /= 2.f;
1214+
#endif
1215+
12051216
objUp->applyForce(&force);
12061217
if (m_orientInForceDirection)
12071218
{
12081219
orientation = atan2(force.y, force.x);
12091220
}
12101221
DUMPREAL(orientation);
12111222
objUp->setAngles(orientation, 0, 0);
1223+
#if defined(GENERALS_ONLINE)
1224+
objUp->setYawRate(yaw/2.f);
1225+
objUp->setRollRate(roll / 2.f);
1226+
objUp->setPitchRate(pitch / 2.f);
1227+
#else
12121228
objUp->setYawRate(yaw);
12131229
objUp->setRollRate(roll);
12141230
objUp->setPitchRate(pitch);
1231+
#endif
12151232
DUMPCOORD3D(objUp->getAcceleration());
12161233
DUMPCOORD3D(objUp->getVelocity());
12171234
DUMPMATRIX3D(obj->getTransformMatrix());

0 commit comments

Comments
 (0)