MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / processTick

Method processTick

Engine/source/T3D/entity.cpp:271–369  ·  view source on GitHub ↗

Updating

Source from the content-addressed store, hash-verified

269
270//Updating
271void Entity::processTick(const Move* move)
272{
273 if (!isHidden())
274 {
275 if (mDelta.warpCount < mDelta.warpTicks)
276 {
277 mDelta.warpCount++;
278
279 // Set new pos.
280 mObjToWorld.getColumn(3, &mDelta.pos);
281 mDelta.pos += mDelta.warpOffset;
282 mDelta.rot[0] = mDelta.rot[1];
283 mDelta.rot[1].interpolate(mDelta.warpRot[0], mDelta.warpRot[1], F32(mDelta.warpCount) / mDelta.warpTicks);
284 setTransform(mDelta.pos, mDelta.rot[1]);
285
286 // Pos backstepping
287 mDelta.posVec.x = -mDelta.warpOffset.x;
288 mDelta.posVec.y = -mDelta.warpOffset.y;
289 mDelta.posVec.z = -mDelta.warpOffset.z;
290 }
291 else
292 {
293 if (isMounted())
294 {
295 MatrixF mat;
296 mMount.object->getMountTransform(mMount.node, mMount.xfm, &mat);
297 Parent::setTransform(mat);
298 Parent::setRenderTransform(mat);
299 }
300 else
301 {
302 if (!move)
303 {
304 if (isGhost())
305 {
306 // If we haven't run out of prediction time,
307 // predict using the last known move.
308 if (mPredictionCount-- <= 0)
309 return;
310
311 move = &mDelta.move;
312 }
313 else
314 {
315 move = &NullMove;
316 }
317 }
318 }
319 }
320
321 Move prevMove = lastMove;
322
323 if (move != NULL)
324 lastMove = *move;
325 else
326 lastMove = NullMove;
327
328 if (move && isServerObject())

Callers

nothing calls this directly

Calls 5

isHiddenFunction · 0.85
executefFunction · 0.85
getColumnMethod · 0.80
interpolateMethod · 0.45
getMountTransformMethod · 0.45

Tested by

no test coverage detected