SuperTuxKart
three_d_animation.hpp
1 //
2 // SuperTuxKart - a fun racing game with go-kart
3 // Copyright (C) 2009-2015 Joerg Henrichs
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 3
8 // of the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 
19 #ifndef HEADER_THREE_D_ANIMATION_HPP
20 #define HEADER_THREE_D_ANIMATION_HPP
21 
22 #include <string>
23 
24 #include <vector3d.h>
25 using namespace irr;
26 
27 #include "btBulletDynamicsCommon.h"
28 
29 #include "animations/animation_base.hpp"
30 #include "physics/user_pointer.hpp"
31 
32 namespace irr
33 {
34  namespace scene { class IAnimatedMesh; class ISceneNode; class IMesh; }
35 }
36 
37 class TrackObject;
38 class BezierCurve;
39 class XMLNode;
40 
45 {
46 private:
47  TrackObject *m_object;
48 
52 
56 
57  bool m_flatten_kart;
58 
65 
70 
71 public:
72  ThreeDAnimation(const XMLNode &node, TrackObject* object);
73  virtual ~ThreeDAnimation();
74  virtual void update(float dt) {}
75  // ------------------------------------------------------------------------
76  void updateWithWorldTicks(bool with_physics);
77  // ------------------------------------------------------------------------
80  bool isCrashReset() const { return m_crash_reset; }
81  bool isExplodeKartObject() const { return m_explode_kart; }
82  bool isFlattenKartObject() const { return m_flatten_kart; }
83  void setPaused(bool mode){ m_is_paused = mode; }
84  // ------------------------------------------------------------------------
85  ThreeDAnimation* clone(TrackObject* obj);
86 }; // ThreeDAnimation
87 #endif
88 
A base class for all animations.
Definition: animation_base.hpp:41
A class to manage bezier curves and interpolation.
Definition: bezier_curve.hpp:34
A virtual base class for all animations.
Definition: three_d_animation.hpp:45
bool m_crash_reset
True if a collision with this object should trigger rescuing a kart.
Definition: three_d_animation.hpp:51
bool m_is_paused
True if animation is currently paused by scripts.
Definition: three_d_animation.hpp:60
bool m_explode_kart
True if a collision with this object should trigger "exploding" a kart.
Definition: three_d_animation.hpp:55
Vec3 m_hpr
We have to store the rotation value as computed in blender, since irrlicht uses a different order,...
Definition: three_d_animation.hpp:64
virtual void update(float dt)
This needs to be implemented by the inheriting classes.
Definition: three_d_animation.hpp:74
bool m_important_animation
If true, play animation even when GFX are disabled.
Definition: three_d_animation.hpp:69
bool isCrashReset() const
Returns true if a collision with this object should trigger a rescue.
Definition: three_d_animation.hpp:80
This is a base object for any separate object on the track, which might also have a skeletal animatio...
Definition: track_object.hpp:56
A wrapper around bullets btVector3 to include conventient conversion functions (e....
Definition: vec3.hpp:35
utility class used to parse XML files
Definition: xml_node.hpp:48
void setPaused(bool mode)
Pause/resumes a curve-based animation.
Definition: script_track.cpp:407