V-Gears 0
Free Final Fantasy VII engine.
Background2DAnimation Class Reference

An animation in the background of a field. More...

#include <Background2DAnimation.h>

Collaboration diagram for Background2DAnimation:

Classes

struct  Background2DKeyFrameUV
 A keyframe. More...
 

Public Types

enum  State { ONCE , LOOPED }
 Repetition status of the animation. More...
 

Public Member Functions

 Background2DAnimation (const Ogre::String &name, Background2D *background, const int tile_index)
 Constructor. More...
 
virtual ~Background2DAnimation ()
 Destructor. More...
 
void AddTime (const float time)
 Adds time, so the animation state is changed according to it. More...
 
const Ogre::String & GetName () const
 Retrieves the animation name. More...
 
void SetTime (const float time)
 Sets the time the animation has been running. More...
 
float GetTime () const
 Retrieves the time the animation has been running. More...
 
void SetLength (const float time)
 Sets the duration of the animation. More...
 
float GetLength () const
 Retrieves the duration of the animation. More...
 
virtual void AddUVKeyFrame (const VGears::KeyFrame key_frame)
 Adds a keyframe to the animation. More...
 
virtual void AddUVKeyFrame (const float time, const Ogre::Vector4 &uv)
 Adds a keyframe to the animation. More...
 
virtual void AddUVKeyFrame (const float time, const float u1, const float v1, const float u2, const float v2)
 Adds a keyframe to the animation. More...
 

Private Member Functions

 Background2DAnimation ()
 Constructor. More...
 

Private Attributes

Ogre::String name_
 The animation name. More...
 
Background2Dbackground_
 The background the animation belongs to. More...
 
int tile_index_
 The index of the tile tha animation applies to. More...
 
float time_
 The animation current time. More...
 
float length_
 The duration of the animation. More...
 
std::vector< Background2DKeyFrameUVuv_
 Keyframe list. More...
 

Detailed Description

An animation in the background of a field.

Member Enumeration Documentation

◆ State

Repetition status of the animation.

Enumerator
ONCE 

The animation must be played once.

LOOPED 

The animation must loop indefinitely.

Constructor & Destructor Documentation

◆ Background2DAnimation() [1/2]

Background2DAnimation::Background2DAnimation ( const Ogre::String &  name,
Background2D background,
const int  tile_index 
)

Constructor.

Parameters
[in]nameThe animation name.
[in]backgroundThe background to animate.
[in]tile_indexThe tile the animation applies to.

◆ ~Background2DAnimation()

Background2DAnimation::~Background2DAnimation ( )
virtual

Destructor.

◆ Background2DAnimation() [2/2]

Background2DAnimation::Background2DAnimation ( )
private

Constructor.

Member Function Documentation

◆ AddTime()

void Background2DAnimation::AddTime ( const float  time)

Adds time, so the animation state is changed according to it.

Parameters
[in]timeThe time passed
Todo:
time is in seconds?

◆ AddUVKeyFrame() [1/3]

void Background2DAnimation::AddUVKeyFrame ( const float  time,
const float  u1,
const float  v1,
const float  u2,
const float  v2 
)
virtual

Adds a keyframe to the animation.

Parameters
[in]timeTime to add the keyframe at.
[in]u1Animation vector component.
[in]v1Animation vector component.
[in]u2Animation vector component.
[in]v2Animation vector component.
Todo:
time is in seconds?

◆ AddUVKeyFrame() [2/3]

void Background2DAnimation::AddUVKeyFrame ( const float  time,
const Ogre::Vector4 &  uv 
)
virtual

Adds a keyframe to the animation.

Parameters
[in]timeTime to add the keyframe at.
[in]uvAnimation vector.
Todo:
time is in seconds?

◆ AddUVKeyFrame() [3/3]

void Background2DAnimation::AddUVKeyFrame ( const VGears::KeyFrame  key_frame)
virtual

Adds a keyframe to the animation.

Parameters
[in]key_frameThe keyframe to add.

◆ GetLength()

float Background2DAnimation::GetLength ( ) const

Retrieves the duration of the animation.

Returns
The duration of the animation.
Todo:
time is in seconds?

◆ GetName()

const Ogre::String & Background2DAnimation::GetName ( ) const

Retrieves the animation name.

Returns
The animation name.

◆ GetTime()

float Background2DAnimation::GetTime ( ) const

Retrieves the time the animation has been running.

Returns
The time the animation has been running.
Todo:
time is in seconds?

◆ SetLength()

void Background2DAnimation::SetLength ( const float  time)

Sets the duration of the animation.

Parameters
[in]timeThe duration of the animation.
Todo:
time is in seconds?

◆ SetTime()

void Background2DAnimation::SetTime ( const float  time)

Sets the time the animation has been running.

Parameters
[in]timeThe time the animation has been running.
Todo:
time is in seconds?

Member Data Documentation

◆ background_

Background2D* Background2DAnimation::background_
private

The background the animation belongs to.

◆ length_

float Background2DAnimation::length_
private

The duration of the animation.

◆ name_

Ogre::String Background2DAnimation::name_
private

The animation name.

◆ tile_index_

int Background2DAnimation::tile_index_
private

The index of the tile tha animation applies to.

◆ time_

float Background2DAnimation::time_
private

The animation current time.

◆ uv_

std::vector<Background2DKeyFrameUV> Background2DAnimation::uv_
private

Keyframe list.


The documentation for this class was generated from the following files: