V-Gears 0
Free Final Fantasy VII engine.
FF7WalkmeshFileSerializer.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 "common/TypeDefine.h"
21
22namespace VGears{
23
28
29 public:
30
35
40
47 virtual void ImportWalkmeshFile(Ogre::DataStreamPtr &stream, WalkmeshFile *dest);
48
50
52
56 enum{
57
62
67
72 };
73
77 struct Triangle{
78
82 Ogre::Vector3 a;
83
87 Ogre::Vector3 b;
88
92 Ogre::Vector3 c;
93 };
94
98 struct Access{
111 };
112
113 typedef std::vector<Triangle> TriangleList;
114
115 typedef std::vector<Access> AccessList;
116
117 protected:
118
125 virtual void readObject(Ogre::DataStreamPtr &stream, Triangle &dest);
126
133 virtual void readObject(Ogre::DataStreamPtr &stream, Ogre::Vector3 &dest);
134
141 virtual void readObject(Ogre::DataStreamPtr &stream, Access &dest);
142
144
152 template<typename ValueType> void ReadVector(
153 Ogre::DataStreamPtr &stream, std::vector<ValueType> &dest, size_t count
154 );
155
156 };
157}
Handles file serialization.
Definition: VGearsSerializer.h:30
void readObject(Ogre::DataStreamPtr &stream, Ogre::Vector2 &dest)
Reads an object as a 2 dimensional vector.
Definition: VGearsSerializer.cpp:32
Handles the serialization of walkmesh files.
Definition: FF7WalkmeshFileSerializer.h:27
virtual void readObject(Ogre::DataStreamPtr &stream, Triangle &dest)
Reads an object as a walkmesh triangle.
Definition: FF7WalkmeshFileSerializer.cpp:64
virtual ~WalkmeshFileSerializer()
Destructor.
Definition: FF7WalkmeshFileSerializer.cpp:24
void ReadVector(Ogre::DataStreamPtr &stream, std::vector< ValueType > &dest, size_t count)
Reads an object as a vector.
Definition: FF7WalkmeshFileSerializer.cpp:26
@ VERTEX_COMPONENT_COUNT
Definition: FF7WalkmeshFileSerializer.h:66
@ ACCESS_COMPONENT_COUNT
Definition: FF7WalkmeshFileSerializer.h:71
@ VERTEX_PADDING_COUNT
Definition: FF7WalkmeshFileSerializer.h:61
virtual void ImportWalkmeshFile(Ogre::DataStreamPtr &stream, WalkmeshFile *dest)
Imports a walkmesh file.
Definition: FF7WalkmeshFileSerializer.cpp:38
WalkmeshFileSerializer()
Constructor.
Definition: FF7WalkmeshFileSerializer.cpp:22
std::vector< Triangle > TriangleList
Definition: FF7WalkmeshFileSerializer.h:113
std::vector< Access > AccessList
Definition: FF7WalkmeshFileSerializer.h:115
WalkmeshFile::Triangle WalkmeshTriangle
Definition: FF7WalkmeshFileSerializer.h:49
WalkmeshFile::TriangleList WalkmeshTriangleList
Definition: FF7WalkmeshFileSerializer.h:51
Handles walkmesh files.
Definition: VGearsWalkmeshFile.h:26
std::vector< Triangle > TriangleList
Definition: VGearsWalkmeshFile.h:67
Definition: FF7NameLookup.h:24
Ogre::int16 sint16
Definition: TypeDefine.h:35
Defines the access to a triangle.
Definition: FF7WalkmeshFileSerializer.h:98
sint16 a
Definition: FF7WalkmeshFileSerializer.h:102
sint16 b
Definition: FF7WalkmeshFileSerializer.h:106
sint16 c
Definition: FF7WalkmeshFileSerializer.h:110
A walkmesh triangle.
Definition: FF7WalkmeshFileSerializer.h:77
Ogre::Vector3 a
A side of the triangle.
Definition: FF7WalkmeshFileSerializer.h:82
Ogre::Vector3 b
A side of the triangle.
Definition: FF7WalkmeshFileSerializer.h:87
Ogre::Vector3 c
A side of the triangle.
Definition: FF7WalkmeshFileSerializer.h:92
A triangle of a walkmesh.
Definition: Walkmesh.h:24