Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/animation.cc @ 3844

Last change on this file since 3844 was 3833, checked in by bensch, 20 years ago

orxonox/trunk: animation can now return the BaseObject it operates on

File size: 1.3 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   ### File Specific:
12   main-programmer: Benjamin Grauer
13   co-programmer: ...
14*/
15
16
17#include "animation.h"
18#include "debug.h"
19#include "animation_player.h"
20
21
22Anim::Anim(void)
23{ 
24  // initialize a beginning KeyFrame, that will be deleted afterwards
25  this->bHasKeys = false;
26  this->bHandled = true;
27  this->baseObject = NULL;
28
29  // setting default values
30  this->localTime = 0.0;
31  this->bRunning = true;
32
33  AnimationPlayer::getInstance()->addAnimation(this);
34}
35
36Anim::~Anim(void)
37{
38  this->doNotHandle();
39}
40
41void Anim::doNotHandle(void)
42{
43  if (this->bHandled)
44    AnimationPlayer::getInstance()->removeAnimation(this);
45}
46
47
48void Anim::setInfinity(ANIM_INFINITY postInfinity)
49{
50  this->postInfinity = postInfinity;
51}
52
53
54void Anim::play()
55{
56  this->bRunning = true;
57}
58
59
60void Anim::stop()
61{
62  this->rewind();
63  this->bRunning = true;
64  this->tick(0.0);
65  this->bRunning = false;
66}
67void Anim::pause()
68{
69  this->bRunning = false;
70}
71void Anim::replay()
72{
73  this->rewind();
74  this->bRunning = true;
75}
Note: See TracBrowser for help on using the repository browser.