V-Gears 0
Free Final Fantasy VII engine.
VGearsBackground2DFile.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 <OgreQuaternion.h>
19#include <Ogre.h>
21#include "VGearsTile.h"
22
23namespace VGears{
24
30 class Background2DFile : public Resource{
31 public:
32
48 Ogre::ResourceManager* creator, const String &name, Ogre::ResourceHandle handle,
49 const String& group, bool is_manual = false,
50 Ogre::ManualResourceLoader* loader = nullptr
51 );
52
56 virtual ~Background2DFile();
57
61 static const String RESOURCE_TYPE;
62
63 typedef std::vector<Tile> TileList;
64
70 virtual void SetTextureName(const String &texture_name);
71
77 virtual String GetTextureName() const;
78
85 virtual void SetRange(const Ogre::Vector4& range);
86
93 virtual Ogre::Vector4 GetRange() const;
94
101 virtual void SetClip(const Ogre::Vector2& clip);
102
109 virtual Ogre::Vector2 GetClip() const;
110
116 virtual void SetPosition(const Ogre::Vector3 &position);
117
124 virtual Ogre::Vector3 GetPosition() const;
125
131 virtual void SetOrientation(const Ogre::Quaternion &orientation);
132
138 virtual Ogre::Quaternion GetOrientation() const;
139
145 virtual void SetFov(const Ogre::Radian &fov);
146
152 virtual Ogre::Radian GetFov() const;
153
157 virtual TileList& GetTiles();
158
159 protected:
160
164 virtual void loadImpl() override;
165
169 virtual void unloadImpl() override;
170
177 virtual size_t calculateSize() const override;
178
179 private:
180
185
189 Ogre::Vector2 clip_;
190
194 Ogre::Vector4 range_;
195
199 Ogre::Vector3 position_;
200
204 Ogre::Quaternion orientation_;
205
209 Ogre::Radian fov_;
210
215 };
216
217 typedef Ogre::SharedPtr<Background2DFile> Background2DFilePtr;
218}
float * position
Used to keep track of the skeleton and it's bones positions.
Definition: DrawSkeleton.cpp:33
Handles 2D background files.
Definition: VGearsBackground2DFile.h:30
virtual Ogre::Vector4 GetRange() const
Retrieves the background range.
Definition: VGearsBackground2DFile.cpp:63
virtual String GetTextureName() const
Retrieves the texture name.
Definition: VGearsBackground2DFile.cpp:55
virtual void SetPosition(const Ogre::Vector3 &position)
Sets the background position.
Definition: VGearsBackground2DFile.cpp:65
Ogre::Vector3 position_
The background position.
Definition: VGearsBackground2DFile.h:199
virtual Ogre::Vector2 GetClip() const
Retrieves the background clip.
Definition: VGearsBackground2DFile.cpp:59
TileList tiles_
The list of tiles.
Definition: VGearsBackground2DFile.h:214
virtual TileList & GetTiles()
Retrieves the list of tiles.
Definition: VGearsBackground2DFile.cpp:79
virtual void SetOrientation(const Ogre::Quaternion &orientation)
Sets the background orientation.
Definition: VGearsBackground2DFile.cpp:69
virtual void SetTextureName(const String &texture_name)
Sets the texture name.
Definition: VGearsBackground2DFile.cpp:53
virtual Ogre::Quaternion GetOrientation() const
Retrieves the background orientation.
Definition: VGearsBackground2DFile.cpp:73
Background2DFile(Ogre::ResourceManager *creator, const String &name, Ogre::ResourceHandle handle, const String &group, bool is_manual=false, Ogre::ManualResourceLoader *loader=nullptr)
Constructor.
Definition: VGearsBackground2DFile.cpp:26
virtual void loadImpl() override
Loads the file.
Definition: VGearsBackground2DFile.cpp:33
static const String RESOURCE_TYPE
The type of resource.
Definition: VGearsBackground2DFile.h:61
Ogre::Radian fov_
The background field of view.
Definition: VGearsBackground2DFile.h:209
Ogre::Quaternion orientation_
The background orientation.
Definition: VGearsBackground2DFile.h:204
virtual size_t calculateSize() const override
Calculates the size of the background.
Definition: VGearsBackground2DFile.cpp:51
virtual ~Background2DFile()
Destructor.
Definition: VGearsBackground2DFile.cpp:31
virtual void unloadImpl() override
Unloads the file.
Definition: VGearsBackground2DFile.cpp:39
virtual Ogre::Vector3 GetPosition() const
Retrieves the background clip.
Definition: VGearsBackground2DFile.cpp:67
virtual void SetClip(const Ogre::Vector2 &clip)
Sets the background clip.
Definition: VGearsBackground2DFile.cpp:57
virtual void SetFov(const Ogre::Radian &fov)
Sets the background field of view.
Definition: VGearsBackground2DFile.cpp:75
String texture_name_
The texture name.
Definition: VGearsBackground2DFile.h:184
std::vector< Tile > TileList
Definition: VGearsBackground2DFile.h:63
virtual void SetRange(const Ogre::Vector4 &range)
Sets the background range.
Definition: VGearsBackground2DFile.cpp:61
Ogre::Vector4 range_
The background range.
Definition: VGearsBackground2DFile.h:194
virtual Ogre::Radian GetFov() const
Retrieves the background field of view.
Definition: VGearsBackground2DFile.cpp:77
Ogre::Vector2 clip_
The background clip.
Definition: VGearsBackground2DFile.h:189
A resource.
Definition: VGearsResource.h:29
Definition: FF7NameLookup.h:24
Ogre::SharedPtr< Background2DFile > Background2DFilePtr
Definition: VGearsBackground2DFile.h:217
Ogre::String String
Definition: TypeDefine.h:37