mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-04 13:00:33 +00:00
behavioural change: feeding an AInfo an object with a 0 radius causes the class to fill in radius from that objects bounds box
also, vehicle direct hooks
This commit is contained in:
parent
78a26b0108
commit
2d0bcbcf8d
4 changed files with 32 additions and 3 deletions
|
|
@ -405,6 +405,7 @@ Vehicle::Vehicle()
|
|||
mWorkingQueryBoxCountDown = sWorkingQueryBoxStaleThreshold;
|
||||
|
||||
mPhysicsRep = NULL;
|
||||
mAIController = NULL;
|
||||
}
|
||||
|
||||
U32 Vehicle::getCollisionMask()
|
||||
|
|
@ -471,7 +472,7 @@ bool Vehicle::onAdd()
|
|||
void Vehicle::onRemove()
|
||||
{
|
||||
SAFE_DELETE(mPhysicsRep);
|
||||
|
||||
if (mAIController) mAIController->deleteObject();
|
||||
U32 i=0;
|
||||
|
||||
for( i=0; i<VehicleData::VC_NUM_DAMAGE_EMITTERS; i++ )
|
||||
|
|
@ -1219,3 +1220,25 @@ void Vehicle::_renderMuzzleVector( ObjectRenderInst *ri, SceneRenderState *state
|
|||
|
||||
PrimBuild::end();
|
||||
}
|
||||
|
||||
bool Vehicle::setAIController(SimObjectId controller)
|
||||
{
|
||||
if (Sim::findObject(controller, mAIController) && mAIController->mControllerData)
|
||||
{
|
||||
mAIController->setAIInfo(this);
|
||||
return true;
|
||||
}
|
||||
Con::errorf("unable to find AIController : %i", controller);
|
||||
mAIController = NULL;
|
||||
return false;
|
||||
}
|
||||
|
||||
DefineEngineMethod(Vehicle, setAIController, bool, (S32 controller), , "")
|
||||
{
|
||||
return object->setAIController(controller);
|
||||
}
|
||||
|
||||
DefineEngineMethod(Vehicle, getAIController, AIController*, (), , "")
|
||||
{
|
||||
return object->getAIController();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue