This repository has been archived by the owner on Sep 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
dynamic.h
63 lines (56 loc) · 1.8 KB
/
dynamic.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#pragma once
#include <vector>
#include <set>
#include "helpers.h"
#include "index.h"
#include "fbxmodel.h"
#include "vertex.h"
#include "texture.h"
#include "skeleton.h"
#include "texplate.h"
class Dynamic : public Model
{
private:
bool bTextures = false;
std::vector<File*> dyn2s;
std::vector<File*> dyn3s;
FbxModel* fbxModel = nullptr;
std::vector<DynamicMesh*> meshes;
std::vector<FbxNode*> nodes;
std::vector<Node*> bones;
std::string skeletonHash = "";
bool bSkeletonDiostOnly = false;
std::unordered_map<uint64_t, uint32_t> h64Table;
std::vector<Material*> externalMaterials;
std::vector<TexturePlateSet*> texplateSets;
int skeletonOverride = -1;
void getDyn3Files();
void parseDyn3s();
void getSubmeshes();
void getSkeleton();
void getTexturePlates();
std::vector<std::vector<float_t>> trimVertsData(std::vector<std::vector<float_t>> verts, std::set<int> dsort, bool bVertCol);
std::vector<std::vector<uint8_t>> trimVertsData(std::vector<std::vector<uint8_t>> verts, std::set<int> dsort);
void transformPos(DynamicMesh* mesh, unsigned char* data);
void transformUV(DynamicMesh* mesh, unsigned char* data);
void addVertColSlots(DynamicMesh* mesh, DynamicSubmesh* submesh);
void considerSkeletonOverride();
public:
std::string packagesPath;
Dynamic(std::string x, std::unordered_map<uint64_t, uint32_t> hash64Table, std::string pkgsPath, bool btex, int so) : Model(x, pkgsPath)
{
packagesPath = pkgsPath;
h64Table = hash64Table;
bTextures = btex;
skeletonOverride = so;
}
Dynamic(std::string x, std::string pkgsPath) : Model(x, pkgsPath)
{
packagesPath = pkgsPath;
}
bool get();
void pack(std::string saveDirectory, bool bCBuffer);
void save(std::string saveDirectory, std::string saveName);
bool RequestInfo(int& SubmeshCount, bool& bHasSkeleton);
bool RequestSaveDynamicMeshData();
};