mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 23:54:35 +00:00
aiController.setMoveDestination test
This commit is contained in:
parent
19e73c0be2
commit
201b7bf695
3 changed files with 18 additions and 1 deletions
|
|
@ -126,7 +126,7 @@ class AIControllerData : public SimDataBlock {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
AIControllerData() {};
|
AIControllerData() { mMoveTolerance = 0.25; mFollowTolerance = 1.0; mAttackRadius = 2.0; mMoveStuckTolerance = 0.01f; mMoveStuckTestDelay = 30;};
|
||||||
~AIControllerData() {};
|
~AIControllerData() {};
|
||||||
|
|
||||||
static void initPersistFields();
|
static void initPersistFields();
|
||||||
|
|
|
||||||
|
|
@ -257,3 +257,19 @@ void AINavigation::clearPath()
|
||||||
// Reset path data.
|
// Reset path data.
|
||||||
mPathData = PathData();
|
mPathData = PathData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DefineEngineMethod(AIController, setMoveDestination, void, (Point3F goal, bool slowDown), (true),
|
||||||
|
"@brief Tells the AI to move to the location provided\n\n"
|
||||||
|
|
||||||
|
"@param goal Coordinates in world space representing location to move to.\n"
|
||||||
|
"@param slowDown A boolean value. If set to true, the bot will slow down "
|
||||||
|
"when it gets within 5-meters of its move destination. If false, the bot "
|
||||||
|
"will stop abruptly when it reaches the move destination. By default, this is true.\n\n"
|
||||||
|
|
||||||
|
"@note Upon reaching a move destination, the bot will clear its move destination and "
|
||||||
|
"calls to getMoveDestination will return \"0 0 0\"."
|
||||||
|
|
||||||
|
"@see getMoveDestination()\n")
|
||||||
|
{
|
||||||
|
object->getNav()->setMoveDestination(goal, slowDown);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -2287,6 +2287,7 @@ bool Player::getAIMove(Move* move)
|
||||||
if (mAIController)
|
if (mAIController)
|
||||||
{
|
{
|
||||||
mAIController->getAIMove(move); //actual result
|
mAIController->getAIMove(move); //actual result
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue