-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypes.proto
107 lines (95 loc) · 2.43 KB
/
types.proto
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// Common data type implementations
// Intended to be re-used
syntax = "proto3";
package mirabuf;
// Each proper object within the Graph - First one is Root
message Node {
string value = 1; /// the reference ID for whatever kind of graph this is
repeated Node children = 2; /// the children for the given leaf
UserData user_data = 3; /// other associated data that can be used
}
// Top level GraphContainer
// Contains all Graph element roots within
message GraphContainer {
// represents the root of each seperate assembly - most of the time 1 node
repeated Node nodes = 1;
}
/**
* UserData
*
* Arbitrary data to append to a given message in map form
*/
message UserData {
map<string, string> data = 1; /// e.g. data["wheel"] = "yes"
}
message Vector3 {
float x = 1;
float y = 2;
float z = 3;
}
message PhysicalProperties {
double density = 1; /// kg per cubic cm kg/(cm^3)
double mass = 2; /// kg
double volume = 3; /// cm^3
double area = 4; /// cm^2
Vector3 com = 5; /// non-negative? Vec3
}
/**
* Transform
*
* Data needed to apply scale, position, and rotational changes
*/
message Transform {
/*
* flat map of 4x4 transform matrix
* [00][01][02][03][10][11][12][13][20][21][22][23]
*/
repeated float spatial_matrix = 1;
}
// RGBA in expanded form 0-255
message Color {
// red
int32 R = 1;
// green
int32 G = 2;
// blue
int32 B = 3;
// alpha
int32 A = 4;
}
// Axis Enum
enum Axis {
X = 0;
Y = 1;
Z = 2;
}
/**
* Defines basic fields for almost all objects
* The location where you can access the GUID for a reference
*/
message Info {
// GUID unique value - must always be defined
// since guid's have exactly 128bits could be represented with bytes[]
// however endian becomes an issue
string GUID = 1;
// Generic readable name
string name = 2;
// Version of object iteration
uint32 version = 3;
}
/**
* A basic Thumbnail to be encoded in the file
* Most of the Time Fusion can encode the file with transparency as PNG not bitmap
*/
message Thumbnail {
/// Image Width
int32 width = 1;
/// Image Height
int32 height = 2;
/// Image Extension - ex. (.png, .bitmap, .jpeg)
string extension = 3;
/// Transparency - true from fusion when correctly configured
bool transparent = 4;
/// Data as read from the file in bytes[] form
bytes data = 5;
}