| 
| enum   | AnimationPhase : uint8_t { SWATTER_AIMING = 0
, SWATTER_TO_TARGET = 1
, SWATTER_FROM_TARGET = 2
 } | 
|   | State of the animation, the swatter is successively:  More...
  | 
|   | 
 | 
| 
void  | chooseTarget () | 
|   | Determine the nearest kart or item and update the current target accordingly. 
  | 
|   | 
| void  | pointToTarget () | 
|   | If there is a current target, point to it, otherwise adopt the default position.  
  | 
|   | 
| 
void  | squashThingsAround () | 
|   | Squash karts or items that are around the end position (determined using a joint) of the swatter. 
  | 
|   | 
 | 
| 
AnimationPhase  | m_animation_phase | 
|   | 
| 
AbstractKart *  | m_closest_kart | 
|   | The kart the swatter is aiming at. 
  | 
|   | 
| 
SFXBase *  | m_swat_sound | 
|   | 
| scene::IAnimatedMeshSceneNode *  | m_scene_node | 
|   | Set the end ticks to complete the removing an attached bomb animation.  
  | 
|   | 
| 
scene::IAnimatedMeshSceneNode *  | m_bomb_scene_node | 
|   | The scene node where a bomb is saved (in case that the swatter replaces a bomb. 
  | 
|   | 
| 
int  | m_discard_ticks | 
|   | 
| 
int  | m_swatter_duration | 
|   | 
| 
int16_t  | m_bomb_remaining | 
|   | Set the bomb remaing ticks so we can set the timer on the removing bomb animation. 
  | 
|   | 
| 
int16_t  | m_swatter_animation_ticks | 
|   | 
| 
bool  | m_discard_now | 
|   | True if the swatter will be discarded now. 
  | 
|   | 
| 
bool  | m_played_swatter_animation | 
|   | True if the swatter animation has been played. 
  | 
|   | 
◆ AnimationPhase
State of the animation, the swatter is successively: 
- aiming (default state) => it's turning to the nearest target
 
- going down to the target
 
- going up from the target 
 
 
 
◆ Swatter()
Constructor: creates a swatter at a given attachment for a kart. 
If there was a bomb attached, it triggers the replace bomb animations. 
- Parameters
 - 
  
    | attachment | The attachment instance where the swatter is attached to.  | 
    | kart | The kart to which the swatter is attached.  | 
    | bomb_ticks | Remaining bomb time in ticks, -1 if none.  | 
    | ticks | Swatter duration.  | 
    | attachment | class attachment from karts.  | 
  
   
 
 
◆ isSwatterReady()
  
  
      
        
          | bool Swatter::isSwatterReady  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Returns if the swatter is currently aiming, i.e. 
can be used to swat an incoming projectile. 
 
 
◆ pointToTarget()
  
  
      
        
          | void Swatter::pointToTarget  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
private   | 
  
 
If there is a current target, point to it, otherwise adopt the default position. 
If there is a current target, point in its direction, otherwise adopt the default position. 
 
 
◆ restoreState()
◆ saveState()
◆ updateAndTestFinished()
  
  
      
        
          | bool Swatter::updateAndTestFinished  | 
          ( | 
          int  | 
          ticks | ) | 
           | 
         
       
   | 
  
virtual   | 
  
 
Updates an armed swatter: it checks for any karts that are close enough and not invulnerable, it swats the kart. 
- Parameters
 - 
  
  
 
- Returns
 - True if the attachment should be discarded. 
 
Implements AttachmentPlugin.
 
 
◆ updateGraphics()
  
  
      
        
          | void Swatter::updateGraphics  | 
          ( | 
          float  | 
          dt | ) | 
           | 
         
       
   | 
  
virtual   | 
  
 
 
◆ m_scene_node
  
  
      
        
          | scene::IAnimatedMeshSceneNode* Swatter::m_scene_node | 
         
       
   | 
  
private   | 
  
 
Set the end ticks to complete the removing an attached bomb animation. 
The scene node of the attachment. 
 
 
The documentation for this class was generated from the following files: