MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / repath

Method repath

Engine/source/T3D/aiPlayer.cpp:934–948  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

932}
933
934void AIPlayer::repath()
935{
936 // Ineffectual if we don't have a path, or are using someone else's.
937 if(mPathData.path.isNull() || !mPathData.owned)
938 return;
939
940 // If we're following, get their position.
941 if(!mFollowData.object.isNull())
942 mPathData.path->mTo = mFollowData.object->getPosition();
943 // Update from position and replan.
944 mPathData.path->mFrom = getPosition();
945 mPathData.path->plan();
946 // Move to first node (skip start pos).
947 moveToNode(1);
948}
949
950DefineEngineMethod(AIPlayer, repath, void, (),,
951 "@brief Tells the AI to re-plan its path. Does nothing if the character "

Callers 1

aiPlayer.cppFile · 0.80

Calls 4

getPositionFunction · 0.85
planMethod · 0.80
isNullMethod · 0.45
getPositionMethod · 0.45

Tested by

no test coverage detected