SEGS  0.4.2
Super Entity Game Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CoHSceneConverter.h
Go to the documentation of this file.
1 /*
2  * SEGS - Super Entity Game Server
3  * http://www.segs.io/
4  * Copyright (c) 2006 - 2018 SEGS Team (see Authors.txt)
5  * This software is licensed! (See License.txt for details)
6  */
7 
8 #pragma once
9 
10 #include <Lutefisk3D/Math/Matrix3x4.h>
11 #include <Lutefisk3D/Math/BoundingBox.h>
12 #include <Lutefisk3D/Container/Ptr.h>
13 #include <glm/matrix.hpp>
14 
15 #include <QString>
16 #include <QHash>
17 
18 #include <vector>
19 
20 namespace Urho3D
21 {
22  class Node;
23  class Context;
24 };
25 
26 enum
27 {
30 };
31 
32 enum class CoHBlendMode : uint8_t
33 {
34  MULTIPLY = 0,
35  MULTIPLY_REG = 1,
36  COLORBLEND_DUAL = 2,
37  ADDGLOW = 3,
38  ALPHADETAIL = 4,
39  BUMPMAP_MULTIPLY = 5,
41  INVALID = 255,
42 };
43 
44 struct CoHModel;
45 
46 struct NodeChild
47 {
48  Urho3D::Matrix3x4 m_matrix;
49  struct CoHNode * m_def = nullptr;
50 };
51 
52 struct CoHNode
53 {
54  CoHNode * parent = nullptr;
55  std::vector<NodeChild> children;
56  QString name;
57  QString dir;
58  CoHModel * model = nullptr;
59  struct GeoStoreDef * geoset_info = nullptr;
60  Urho3D::BoundingBox m_bbox;
61  glm::vec3 center;
62  Urho3D::WeakPtr<Urho3D::Node> m_lutefisk_result;
63  float radius = 0;
64  float vis_dist = 0;
65  float lod_near = 0;
66  float lod_far = 0;
67  float lod_near_fade = 0;
68  float lod_far_fade = 0;
69  float lod_scale = 0;
70  float shadow_dist = 0;
71  int lod_autogen = 0;
72  bool in_use = false;
73  bool lod_fromtrick = false;
74 };
75 
77 {
78  Urho3D::Matrix3x4 mat;
79  CoHNode *node = nullptr;
81 
82 
83 };
84 
86 {
87  int last_node_id=0; // used to create new number suffixes for generic nodes
88  std::vector<CoHNode *> all_converted_defs;
89  std::vector<ConvertedRootNode *> refs;
90  QHash<QString,CoHNode *> name_to_node;
91 };
92 
93 bool loadSceneGraph(CoHSceneGraph &conv,const QString &path);
94 
95 Urho3D::Node * convertedNodeToLutefisk(CoHNode *def, const Urho3D::Matrix3x4 & mat, Urho3D::Context *ctx, int depth, int opt=CONVERT_MINIMAL);
struct CoHNode * m_def
Definition: CoHSceneConverter.h:49
float shadow_dist
Definition: CoHSceneConverter.h:70
bool lod_fromtrick
Definition: CoHSceneConverter.h:73
float lod_far_fade
Definition: CoHSceneConverter.h:68
Definition: CoHModelLoader.h:91
Definition: CoHSceneConverter.h:28
int lod_autogen
Definition: CoHSceneConverter.h:71
Urho3D::Matrix3x4 m_matrix
Definition: CoHSceneConverter.h:48
float lod_scale
Definition: CoHSceneConverter.h:69
bool loadSceneGraph(CoHSceneGraph &conv, const QString &path)
Definition: CoHSceneConverter.cpp:496
std::vector< CoHNode * > all_converted_defs
Definition: CoHSceneConverter.h:88
Definition: CoHSceneConverter.h:52
CoHModel * model
Definition: CoHSceneConverter.h:58
uint32_t index_in_roots_array
Definition: CoHSceneConverter.h:80
Urho3D::Matrix3x4 mat
Definition: CoHSceneConverter.h:78
QHash< QString, CoHNode * > name_to_node
Definition: CoHSceneConverter.h:90
Definition: CoHSceneConverter.h:29
float lod_far
Definition: CoHSceneConverter.h:66
glm::vec3 center
Definition: CoHSceneConverter.h:61
QString dir
Definition: CoHSceneConverter.h:57
Urho3D::BoundingBox m_bbox
Definition: CoHSceneConverter.h:60
Urho3D::Node * convertedNodeToLutefisk(CoHNode *conv_node, const Urho3D::Matrix3x4 &mat, Context *ctx, int depth, int opt)
Definition: CoHSceneConverter.cpp:511
float lod_near_fade
Definition: CoHSceneConverter.h:67
int last_node_id
Definition: CoHSceneConverter.h:87
Definition: CoHSceneConverter.h:46
Urho3D::WeakPtr< Urho3D::Node > m_lutefisk_result
Definition: CoHSceneConverter.h:62
CoHBlendMode
Definition: CoHSceneConverter.h:32
CoHNode * parent
Definition: CoHSceneConverter.h:54
float vis_dist
Definition: CoHSceneConverter.h:64
Definition: CoHSceneConverter.h:76
CoHNode * node
Definition: CoHSceneConverter.h:79
QString name
Definition: CoHSceneConverter.h:56
float lod_near
Definition: CoHSceneConverter.h:65
struct GeoStoreDef * geoset_info
Definition: CoHSceneConverter.h:59
bool in_use
Definition: CoHSceneConverter.h:72
Definition: CoHModelLoader.h:25
Definition: CoHSceneConverter.h:85
std::vector< ConvertedRootNode * > refs
Definition: CoHSceneConverter.h:89
std::vector< NodeChild > children
Definition: CoHSceneConverter.h:55
float radius
Definition: CoHSceneConverter.h:63