mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
logical inversion to stock functionality as requested. Now assumes if it has a target and does not hit anything Static by the time the ray terminates, then it must be the right target.
This commit is contained in:
parent
ae55ad2b50
commit
9bed39b7d0
1 changed files with 2 additions and 9 deletions
|
|
@ -28,8 +28,7 @@
|
||||||
#include "T3D/gameBase/moveManager.h"
|
#include "T3D/gameBase/moveManager.h"
|
||||||
#include "console/engineAPI.h"
|
#include "console/engineAPI.h"
|
||||||
|
|
||||||
static U32 sAIPlayerLoSMask = TerrainObjectType | WaterObjectType |
|
static U32 sAIPlayerLoSMask = TerrainObjectType | StaticShapeObjectType | StaticObjectType;
|
||||||
ShapeBaseObjectType | StaticShapeObjectType;
|
|
||||||
|
|
||||||
IMPLEMENT_CO_NETOBJECT_V1(AIPlayer);
|
IMPLEMENT_CO_NETOBJECT_V1(AIPlayer);
|
||||||
|
|
||||||
|
|
@ -643,19 +642,13 @@ bool AIPlayer::checkInLos(GameBase* target, bool _useMuzzle, bool _checkEnabled)
|
||||||
eyeMat.getColumn(3, &checkPoint );
|
eyeMat.getColumn(3, &checkPoint );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hit = gServerContainer.castRay(checkPoint , target->getBoxCenter(), sAIPlayerLoSMask, &ri);
|
bool hit = !gServerContainer.castRay(checkPoint, target->getBoxCenter(), sAIPlayerLoSMask, &ri);
|
||||||
enableCollision();
|
enableCollision();
|
||||||
|
|
||||||
for (S32 i = 0; i < mountCount; i++)
|
for (S32 i = 0; i < mountCount; i++)
|
||||||
{
|
{
|
||||||
target->getMountedObject(i)->enableCollision();
|
target->getMountedObject(i)->enableCollision();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hit)
|
|
||||||
{
|
|
||||||
if (target != dynamic_cast<GameBase*>(ri.object)) hit = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return hit;
|
return hit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue