V-Gears 0
Free Final Fantasy VII engine.
EntityModel.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 The V-Gears Team
3 *
4 * This file is part of V-Gears
5 *
6 * V-Gears is free software: you can redistribute it and/or modify it under
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, version 3.0 (GPLv3) of the License.
9 *
10 * V-Gears 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
16#pragma once
17
18#include "Entity.h"
19
23class EntityModel : public Entity{
24
25 public:
26
38 const Ogre::String& name, const Ogre::String file_name,
39 Ogre::SceneNode* node
40 );
41 virtual ~EntityModel();
42
46 virtual void Update();
47
54 virtual void SetVisible(const bool visible);
55
61 virtual bool IsVisible() const;
62
63 Ogre::Entity* GetModel();
64
74 virtual void PlayAnimation(
75 const Ogre::String& animation, AnimationState state,
76 AnimationPlayType play_type, const float start, const float end
77 );
78
84 virtual void PlayAnimationContinue(const Ogre::String& animation);
85
91 virtual void UpdateAnimation(const float delta);
92
93 private:
94
99
103 Ogre::Entity* model_;
104
108 Ogre::AnimationState* animation_current_;
109};
110
A 3D model for an entity.
Definition: EntityModel.h:23
virtual void Update()
Updates the model status.
Definition: EntityModel.cpp:52
virtual bool IsVisible() const
Checks the model visibility.
Definition: EntityModel.cpp:59
Ogre::Entity * model_
The model.
Definition: EntityModel.h:103
virtual void SetVisible(const bool visible)
Toggles the model visibility.
Definition: EntityModel.cpp:57
virtual ~EntityModel()
Definition: EntityModel.cpp:48
Ogre::Entity * GetModel()
Definition: EntityModel.cpp:61
virtual void PlayAnimationContinue(const Ogre::String &animation)
Resumes an animation.
Definition: EntityModel.cpp:94
EntityModel()
Constructor.
Ogre::AnimationState * animation_current_
The current animation state.
Definition: EntityModel.h:108
virtual void UpdateAnimation(const float delta)
Updates the animation.
Definition: EntityModel.cpp:110
virtual void PlayAnimation(const Ogre::String &animation, AnimationState state, AnimationPlayType play_type, const float start, const float end)
Plays an animation of the model.
Definition: EntityModel.cpp:63
Any entity in a field.
Definition: Entity.h:101
AnimationPlayType
Types of animations.
Definition: Entity.h:124
AnimationState
Entity animation states.
Definition: Entity.h:108
Ogre::String String
Definition: TypeDefine.h:37