mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 00:24:40 +00:00
elevated mAicontroller to shapebase
aiwheeleedveiclecontrollerdata resolvespeed now only touches throttle objects assigned aicontrollers now reflect that by thier objecttype basic flocking
This commit is contained in:
parent
d36cf31707
commit
3210325f3f
15 changed files with 352 additions and 185 deletions
|
|
@ -148,7 +148,6 @@ VehicleData::VehicleData()
|
|||
collDamageMultiplier = 0.05f;
|
||||
enablePhysicsRep = true;
|
||||
mControlMap = StringTable->EmptyString();
|
||||
mAIControllData = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -325,9 +324,7 @@ void VehicleData::initPersistFields()
|
|||
addGroup("Movement");
|
||||
addField("controlMap", TypeString, Offset(mControlMap, VehicleData),
|
||||
"@brief movemap used by these types of objects.\n\n");
|
||||
addField("aiControllerData", TYPEID< AIControllerData >(), Offset(mAIControllData, VehicleData),
|
||||
"@brief ai controller used by these types of objects.\n\n");
|
||||
endGroup("Collision");
|
||||
endGroup("Movement");
|
||||
|
||||
addGroup("Steering");
|
||||
addFieldV( "jetForce", TypeRangedF32, Offset(jetForce, VehicleData), &CommonValidators::PositiveFloat,
|
||||
|
|
@ -414,7 +411,6 @@ Vehicle::Vehicle()
|
|||
mWorkingQueryBoxCountDown = sWorkingQueryBoxStaleThreshold;
|
||||
|
||||
mPhysicsRep = NULL;
|
||||
mAIController = NULL;
|
||||
}
|
||||
|
||||
U32 Vehicle::getCollisionMask()
|
||||
|
|
@ -481,7 +477,6 @@ 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++ )
|
||||
|
|
@ -1236,37 +1231,3 @@ 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;
|
||||
}
|
||||
|
||||
bool Vehicle::getAIMove(Move* move)
|
||||
{
|
||||
if (!isServerObject()) return false;
|
||||
if (mAIController)
|
||||
{
|
||||
mAIController->getAIMove(move); //actual result
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
DefineEngineMethod(Vehicle, setAIController, bool, (S32 controller), , "")
|
||||
{
|
||||
return object->setAIController(controller);
|
||||
}
|
||||
|
||||
DefineEngineMethod(Vehicle, getAIController, AIController*, (), , "")
|
||||
{
|
||||
return object->getAIController();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,7 +73,6 @@ struct VehicleData : public RigidShapeData
|
|||
|
||||
bool enablePhysicsRep;
|
||||
StringTableEntry mControlMap;
|
||||
AIControllerData* mAIControllData;
|
||||
|
||||
//
|
||||
VehicleData();
|
||||
|
|
@ -102,7 +101,6 @@ class Vehicle : public RigidShape
|
|||
Point2F mSteering;
|
||||
F32 mThrottle;
|
||||
bool mJetting;
|
||||
AIController* mAIController;
|
||||
GFXStateBlockRef mSolidSB;
|
||||
|
||||
SimObjectPtr<ParticleEmitter> mDamageEmitterList[VehicleData::VC_NUM_DAMAGE_EMITTERS];
|
||||
|
|
@ -152,9 +150,6 @@ public:
|
|||
|
||||
Point2F getSteering() { return mSteering; };
|
||||
F32 getThrottle() { return mThrottle;};
|
||||
bool setAIController(SimObjectId controller);
|
||||
AIController* getAIController() { return mAIController; };
|
||||
virtual bool getAIMove(Move*);
|
||||
|
||||
/// Interpolates between move ticks @see processTick
|
||||
/// @param dt Change in time between the last call and this call to the function
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue