Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 3855 was 3853, checked in by bensch, 20 years ago

orxonox/trunk: doxygen-comments

File size: 2.1 KB
RevLine 
[3782]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"
[3812]19#include "animation_player.h"
[3782]20
[3853]21/**
22   \brief creates a new Animation
23   
24   This also adds the Animation automatically to the AnimationPlayer's list
25*/
[3847]26Animation::Animation(void)
[3795]27{ 
[3784]28  // initialize a beginning KeyFrame, that will be deleted afterwards
29  this->bHasKeys = false;
[3820]30  this->bHandled = true;
[3833]31  this->baseObject = NULL;
[3784]32
[3785]33  // setting default values
[3786]34  this->localTime = 0.0;
[3787]35  this->bRunning = true;
[3812]36
37  AnimationPlayer::getInstance()->addAnimation(this);
[3782]38}
39
[3853]40/**
41   \brief destructs the Animation
42   
43   this also takes the animation out of the AnimationPlayer's list (if it is there)
44*/
[3847]45Animation::~Animation(void)
[3784]46{
[3820]47  this->doNotHandle();
[3784]48}
49
[3853]50/**
51   \brief tells the AnimationPlayer, that we do not wish to  handle this animation
52   automatically.
53   
54   This means that it will not be ticked, and not be deleted with the AnimationPlayer
55*/
[3847]56void Animation::doNotHandle(void)
[3820]57{
58  if (this->bHandled)
59    AnimationPlayer::getInstance()->removeAnimation(this);
60}
61
[3853]62/**
63   \brief Sets the infinitymode
64   \param postInfinity How the Animation should advance after the last Keyframe
65*/
[3847]66void Animation::setInfinity(ANIM_INFINITY postInfinity)
[3784]67{
68  this->postInfinity = postInfinity;
69}
[3797]70
[3853]71/**
72   \brief plays the animation back from the current Time forward
73*/
[3847]74void Animation::play()
[3797]75{
76  this->bRunning = true;
77}
[3833]78
[3853]79/**
80   \brief Stops the animation. eg. pause(); rewind();
81*/
[3847]82void Animation::stop()
[3797]83{
84  this->rewind();
[3798]85  this->bRunning = true;
86  this->tick(0.0);
[3797]87  this->bRunning = false;
88}
[3853]89
90/**
91   \brief Pauses the animation. Stays at the current Time
92*/
[3847]93void Animation::pause()
[3797]94{
95  this->bRunning = false;
96}
[3853]97
98/**
99   \brief replays the animation, eg. rewind();play();
100*/
[3847]101void Animation::replay()
[3797]102{
103  this->rewind();
104  this->bRunning = true;
105}
Note: See TracBrowser for help on using the repository browser.