@@ -2030,7 +2030,10 @@ void Marble::processTick(const Move* move)
2030
2030
{
2031
2031
Parent::processTick (move);
2032
2032
2033
+ #ifndef MB_CLIENT_PHYSICS_EVERY_FRAME
2033
2034
clearMarbleAxis ();
2035
+ #endif
2036
+
2034
2037
if ((mMode & TimerMode) != 0 )
2035
2038
{
2036
2039
U32 bonusTime = mMarbleBonusTime ;
@@ -2075,17 +2078,20 @@ void Marble::processTick(const Move* move)
2075
2078
if (move)
2076
2079
{
2077
2080
dMemcpy (&delta.move , move, sizeof (delta.move ));
2078
- newMove = move;
2081
+ newMove = move;
2079
2082
}
2080
2083
else
2081
2084
newMove = &delta.move ;
2082
2085
}
2083
2086
else
2084
2087
newMove = &NullMove;
2085
2088
2089
+ #ifndef MB_CLIENT_PHYSICS_EVERY_FRAME
2086
2090
processMoveTriggers (newMove);
2091
+ #endif
2087
2092
processCameraMove (newMove);
2088
2093
2094
+ #ifndef MB_CLIENT_PHYSICS_EVERY_FRAME
2089
2095
Point3F startPos (mPosition .x , mPosition .y , mPosition .z );
2090
2096
2091
2097
advancePhysics (newMove, TickMs);
@@ -2124,7 +2130,7 @@ void Marble::processTick(const Move* move)
2124
2130
{
2125
2131
if (Marble::smEndPadId && Marble::smEndPadId != -1 )
2126
2132
Marble::smEndPad = dynamic_cast <StaticShape*>(Sim::findObject (Marble::smEndPadId));
2127
-
2133
+
2128
2134
if (Marble::smEndPad.isNull ())
2129
2135
Marble::smEndPadId = 0 ;
2130
2136
}
@@ -2153,10 +2159,112 @@ void Marble::processTick(const Move* move)
2153
2159
mSinglePrecision .mVelocity = mVelocity ;
2154
2160
mSinglePrecision .mOmega = mOmega ;
2155
2161
2162
+ mPosition = mSinglePrecision .mPosition ;
2163
+ mVelocity = mSinglePrecision .mVelocity ;
2164
+ mOmega = mSinglePrecision .mOmega ;
2165
+ #else
2166
+ if (isServerObject ())
2167
+ {
2168
+ processPhysicsTick (move, TickSec);
2169
+ }
2170
+ #endif
2171
+ }
2172
+
2173
+ #ifdef MB_CLIENT_PHYSICS_EVERY_FRAME
2174
+ void Marble::processPhysicsTick (const Move *move, F32 dt)
2175
+ {
2176
+ clearMarbleAxis ();
2177
+
2178
+ const Move* newMove;
2179
+ if (mControllable )
2180
+ {
2181
+ if (move)
2182
+ {
2183
+ dMemcpy (&delta.move , move, sizeof (delta.move ));
2184
+ newMove = move;
2185
+ }
2186
+ else
2187
+ newMove = &delta.move ;
2188
+ }
2189
+ else
2190
+ newMove = &NullMove;
2191
+
2192
+ processMoveTriggers (newMove);
2193
+ // processCameraMove(newMove);
2194
+
2195
+ Point3F startPos (mPosition .x , mPosition .y , mPosition .z );
2196
+
2197
+ // advancePhysics(newMove, TickMs);
2198
+ advancePhysics (newMove, (U32)(dt * 1000 .0f ));
2199
+
2200
+ Point3F endPos (mPosition .x , mPosition .y , mPosition .z );
2201
+
2202
+ processItemsAndTriggers (startPos, endPos);
2203
+ updatePowerups ();
2204
+
2205
+ if (mPadPtr )
2206
+ {
2207
+ bool oldOnPad = mOnPad ;
2208
+ updatePadState ();
2209
+ #ifdef MB_ULTRA_PREVIEWS
2210
+ if (oldOnPad != mOnPad && !(isGhost () || gSPMode ))
2211
+ #else
2212
+ if (oldOnPad != mOnPad && !isGhost ())
2213
+ #endif
2214
+ {
2215
+ const char * funcName = " onLeavePad" ;
2216
+ if (!oldOnPad)
2217
+ funcName = " onEnterPad" ;
2218
+ Con::executef (mDataBlock , 2 , funcName, scriptThis ());
2219
+ }
2220
+ }
2221
+
2222
+ #ifdef MB_ULTRA_PREVIEWS
2223
+ if (isGhost () || gSPMode )
2224
+ #else
2225
+ if (isGhost ())
2226
+ #endif
2227
+ {
2228
+ if (getControllingClient ())
2229
+ {
2230
+ if (Marble::smEndPad.isNull () || Marble::smEndPad->getId () != Marble::smEndPadId)
2231
+ {
2232
+ if (Marble::smEndPadId && Marble::smEndPadId != -1 )
2233
+ Marble::smEndPad = dynamic_cast <StaticShape*>(Sim::findObject (Marble::smEndPadId));
2234
+
2235
+ if (Marble::smEndPad.isNull ())
2236
+ Marble::smEndPadId = 0 ;
2237
+ }
2238
+ }
2239
+ }
2240
+
2241
+ if (mOmega .len () < 0.000001 )
2242
+ mOmega .set (0 , 0 , 0 );
2243
+
2244
+ #ifdef MBG_PHYSICS
2245
+ #define MB_RESPAWN_TRIGGER_ID 0
2246
+ #else
2247
+ #define MB_RESPAWN_TRIGGER_ID 2
2248
+ #endif
2249
+
2250
+ #ifdef MB_ULTRA_PREVIEWS
2251
+ if (!(isGhost () || gSPMode ) && mOOB && newMove->trigger [MB_RESPAWN_TRIGGER_ID])
2252
+ #else
2253
+ if (!isGhost () && mOOB && newMove->trigger [MB_RESPAWN_TRIGGER_ID])
2254
+ #endif
2255
+ Con::executef (this , 1 , " onOOBClick" );
2256
+
2257
+ notifyCollision ();
2258
+
2259
+ mSinglePrecision .mPosition = mPosition ;
2260
+ mSinglePrecision .mVelocity = mVelocity ;
2261
+ mSinglePrecision .mOmega = mOmega ;
2262
+
2156
2263
mPosition = mSinglePrecision .mPosition ;
2157
2264
mVelocity = mSinglePrecision .mVelocity ;
2158
2265
mOmega = mSinglePrecision .mOmega ;
2159
2266
}
2267
+ #endif
2160
2268
2161
2269
// ----------------------------------------------------------------------------
2162
2270
0 commit comments