1 //-----------------------------------------------------------------------------
2 // Copyright (c) 2012 GarageGames, LLC
4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to
6 // deal in the Software without restriction, including without limitation the
7 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 // sell copies of the Software, and to permit persons to whom the Software is
9 // furnished to do so, subject to the following conditions:
11 // The above copyright notice and this permission notice shall be included in
12 // all copies or substantial portions of the Software.
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 //-----------------------------------------------------------------------------
26 #ifndef _AICONNECTION_H_
27 #include "T3D/aiConnection.h"
30 #include "core/util/tVector.h"
36 class AIClient
: public AIConnection
{
38 typedef AIConnection Parent
;
51 F32 mMoveTolerance
; // How close to the destination before we stop
53 bool mTriggers
[MaxTriggerKeys
];
57 Point3F mMoveDestination
;
59 Point3F mLastLocation
; // For stuck check
61 bool mAimToDestination
;
65 SimObjectPtr
<ShapeBase
> mTargetObject
;
68 void throwCallback( const char *name
);
71 DECLARE_CONOBJECT( AIClient
);
73 DECLARE_CALLBACK( void, onConnect
, (const char* idString
) );
79 ModeCount
// This is in there as a max index value
85 U32
getMoveList( Move
**movePtr
,U32
*numMoves
);
87 // ---Targeting and aiming sets/gets
88 void setTargetObject( ShapeBase
*targetObject
);
89 S32
getTargetObject() const;
91 // ---Movement sets/gets
92 void setMoveSpeed( const F32 speed
);
93 F32
getMoveSpeed() const { return mMoveSpeed
; }
95 void setMoveMode( S32 mode
);
96 S32
getMoveMode() const { return mMoveMode
; }
98 void setMoveTolerance( const F32 tolerance
);
99 F32
getMoveTolerance() const { return mMoveTolerance
; }
101 void setMoveDestination( const Point3F
&location
);
102 Point3F
getMoveDestination() const { return mMoveDestination
; }
104 Point3F
getLocation() const { return mLocation
; }
106 // ---Facing(Aiming) sets/gets
107 void setAimLocation( const Point3F
&location
);
108 Point3F
getAimLocation() const { return mAimLocation
; }
112 void missionCycleCleanup();
113 void onAdd( const char *nameSpace
);