V-Gears 0
Free Final Fantasy VII engine.
VGearsCameraMatrixFile.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 <OgreMatrix3.h>
20
21namespace VGears{
22
26 class CameraMatrixFile : public Resource{
27
28 public:
29
49 Ogre::ResourceManager *creator, const String &name,
50 Ogre::ResourceHandle handle, const String &group,
51 bool is_manual = false, Ogre::ManualResourceLoader *loader = NULL
52 );
53
57 virtual ~CameraMatrixFile();
58
62 static const String RESOURCE_TYPE;
63
69 const Ogre::Matrix3& GetMatrix() const;
70
76 void SetMatrix(const Ogre::Matrix3& matrix);
77
83 const Ogre::Vector3& GetPosition() const;
84
90 void SetPosition(const Ogre::Vector3& position);
91
97 const Pixel& GetOffset() const;
98
104 void SetOffset(const Pixel& offset);
105
112 const size_t& GetCount() const;
113
120 void SetCount(const size_t count);
121
127 const Ogre::Real& GetFocalLength() const;
128
134 void SetFocalLength(const Ogre::Real focal_length);
135
141 Ogre::Quaternion GetOrientation() const;
142
148 Ogre::Radian GetFov(Ogre::Real width) const;
149
150 protected:
151
155 virtual void loadImpl(void);
156
160 virtual void unloadImpl(void);
161
167 virtual size_t CalculateSize(void) const;
168
169 private:
170
174 Ogre::Matrix3 matrix_;
175
179 Ogre::Vector3 position_;
180
185
189 Ogre::Real focal_length_;
190
194 size_t count_;
195 };
196
197 typedef Ogre::SharedPtr<CameraMatrixFile> CameraMatrixFilePtr;
198}
float * position
Used to keep track of the skeleton and it's bones positions.
Definition: DrawSkeleton.cpp:33
Handles camera matrix files.
Definition: VGearsCameraMatrixFile.h:26
static const String RESOURCE_TYPE
The type of resource.
Definition: VGearsCameraMatrixFile.h:62
CameraMatrixFile(Ogre::ResourceManager *creator, const String &name, Ogre::ResourceHandle handle, const String &group, bool is_manual=false, Ogre::ManualResourceLoader *loader=NULL)
Constructor.
Definition: VGearsCameraMatrixFile.cpp:24
void SetMatrix(const Ogre::Matrix3 &matrix)
Sets the camera matrix.
Definition: VGearsCameraMatrixFile.cpp:58
void SetCount(const size_t count)
Sets the number of ???
Definition: VGearsCameraMatrixFile.cpp:76
Ogre::Vector3 position_
The position of the camera.
Definition: VGearsCameraMatrixFile.h:179
void SetFocalLength(const Ogre::Real focal_length)
Sets the focal length.
Definition: VGearsCameraMatrixFile.cpp:82
Ogre::Radian GetFov(Ogre::Real width) const
Retrieves the camera field of view.
Definition: VGearsCameraMatrixFile.cpp:86
Ogre::Real focal_length_
The focal length.
Definition: VGearsCameraMatrixFile.h:189
void SetOffset(const Pixel &offset)
Sets the camera offset.
Definition: VGearsCameraMatrixFile.cpp:72
size_t count_
The number of.
Definition: VGearsCameraMatrixFile.h:194
virtual void loadImpl(void)
Loads the file.
Definition: VGearsCameraMatrixFile.cpp:32
Ogre::Matrix3 matrix_
The camera matrix.
Definition: VGearsCameraMatrixFile.h:174
const size_t & GetCount() const
Counts the ???
Definition: VGearsCameraMatrixFile.cpp:74
const Pixel & GetOffset() const
Retrieves the camera offset.
Definition: VGearsCameraMatrixFile.cpp:70
const Ogre::Matrix3 & GetMatrix() const
Retrieves the camera matrix in the file.
Definition: VGearsCameraMatrixFile.cpp:56
virtual void unloadImpl(void)
Unloads the file.
Definition: VGearsCameraMatrixFile.cpp:38
virtual ~CameraMatrixFile()
Destructor.
Definition: VGearsCameraMatrixFile.cpp:30
virtual size_t CalculateSize(void) const
Calculates the file size.
Definition: VGearsCameraMatrixFile.cpp:47
const Ogre::Vector3 & GetPosition() const
Retrieves the camera position.
Definition: VGearsCameraMatrixFile.cpp:62
void SetPosition(const Ogre::Vector3 &position)
Sets the camera position.
Definition: VGearsCameraMatrixFile.cpp:66
Ogre::Quaternion GetOrientation() const
Retrieves the camera orientation.
Definition: VGearsCameraMatrixFile.cpp:52
const Ogre::Real & GetFocalLength() const
Retrieves the focal length.
Definition: VGearsCameraMatrixFile.cpp:78
Pixel offset_
The camera offset.
Definition: VGearsCameraMatrixFile.h:184
A resource.
Definition: VGearsResource.h:29
Definition: FF7NameLookup.h:24
Ogre::String String
Definition: TypeDefine.h:37
Ogre::SharedPtr< CameraMatrixFile > CameraMatrixFilePtr
Definition: VGearsCameraMatrixFile.h:197
Pixel coordinates.
Definition: TypeDefine.h:76