19#ifndef HEADER_ABSTRACT_KART_ANIMATION_HPP
20#define HEADER_ABSTRACT_KART_ANIMATION_HPP
22#include "LinearMath/btTransform.h"
24#include "config/stk_config.hpp"
25#include "utils/no_copy.hpp"
26#include "utils/vec3.hpp"
35enum KartAnimationType : uint8_t
47 virtual int getSkippingOffset()
const = 0;
80 int m_created_transform_compressed[4];
90 const std::string &name);
92 virtual void update(
int ticks);
94 virtual void updateGraphics(
float dt);
102 virtual KartAnimationType getAnimationType()
const = 0;
105 void handleResetRace() {
m_end_ticks = std::numeric_limits<int>::max(); }
The base class for all kart animation, like rescue, explosion, or cannon.
Definition: abstract_kart_animation.hpp:60
float getMaximumHeight(const Vec3 &up_vector, float height_remove)
Determine maximum rescue height with up-raycast.
Definition: abstract_kart_animation.cpp:160
void restoreBasicState(BareNetworkString *buffer)
Used in constructor of sub-class as no virtual function can be used there.
Definition: abstract_kart_animation.cpp:194
virtual float getAnimationTimer() const
Returns the current animation timer.
Definition: abstract_kart_animation.cpp:149
void resetPowerUp()
In CTF mode call this to reset kart powerup when get hit.
Definition: abstract_kart_animation.cpp:107
int m_created_ticks
Time in ticks for the animation creation.
Definition: abstract_kart_animation.hpp:73
int m_end_ticks
Time in ticks for the animation which ends in world count up ticks.
Definition: abstract_kart_animation.hpp:70
virtual void update(int ticks)
Updates the timer, and if it expires, the kart animation will be removed from the kart and this objec...
Definition: abstract_kart_animation.cpp:121
std::string m_name
Name of this animation, used for debug prints only.
Definition: abstract_kart_animation.hpp:63
virtual const std::string & getName() const
To easily allow printing the name of the animation being used atm.
Definition: abstract_kart_animation.hpp:100
btTransform m_created_transform
Transformation by the time the animation was created, used for rewind to recreate the animation with ...
Definition: abstract_kart_animation.hpp:77
AbstractKart * m_kart
A pointer to the kart which is animated by this class.
Definition: abstract_kart_animation.hpp:67
An abstract interface for the actual karts.
Definition: abstract_kart.hpp:62
Describes a chain of 8-bit unsigned integers.
Definition: network_string.hpp:53
Exception for kart animation creation in networking, so if thrown it will tell the num of bytes skipp...
Definition: abstract_kart_animation.hpp:45
Utility class, you can inherit from this class to disallow the assignment operator and copy construct...
Definition: no_copy.hpp:26
A wrapper around bullets btVector3 to include conventient conversion functions (e....
Definition: vec3.hpp:35