5959namespace gs
6060{
6161 // Primitive types
62- struct VarUint { std::uint64_t value; };
63- struct VarInt { std::int64_t value; };
64- struct Float16 { float value; };
62+ struct VarUint
63+ {
64+ std::uint64_t value;
65+
66+ auto operator <=>(const VarUint &other) const = default ;
67+ };
68+
69+ struct VarInt
70+ {
71+ std::int64_t value;
72+
73+ auto operator <=>(const VarInt &other) const = default ;
74+ };
75+
76+ struct Float16
77+ {
78+ float value;
79+
80+ auto operator <=>(const Float16 &other) const = default ;
81+ };
82+
6583 typedef float Float32;
6684 typedef double Float64;
6785 typedef std::uint8_t Uint8;
@@ -104,6 +122,8 @@ namespace gs
104122 Float32 x;
105123 Float32 y;
106124 Float32 z;
125+
126+ auto operator <=>(const Loc1 &other) const = default ;
107127 };
108128
109129 struct Loc2
@@ -114,26 +134,34 @@ namespace gs
114134 Float16 vy;
115135 Float16 vx;
116136 Float16 vz;
137+
138+ auto operator <=>(const Loc2 &other) const = default ;
117139 };
118140
119141 struct Norm1
120142 {
121143 Float16 x;
122144 Float16 y;
123145 Float16 z;
146+
147+ auto operator <=>(const Norm1 &other) const = default ;
124148 };
125149
126150 struct TextureUV1
127151 {
128152 VarUint u;
129153 VarUint v;
154+
155+ auto operator <=>(const TextureUV1 &other) const = default ;
130156 };
131157
132158 struct Rot1
133159 {
134160 Float16 i;
135161 Float16 j;
136162 Float16 k;
163+
164+ auto operator <=>(const Rot1 &other) const = default ;
137165 };
138166
139167 struct Rot2
@@ -144,13 +172,17 @@ namespace gs
144172 Float16 ei;
145173 Float16 ej;
146174 Float16 ek;
175+
176+ auto operator <=>(const Rot2 &other) const = default ;
147177 };
148178
149179 struct Transform1
150180 {
151181 Float16 tx;
152182 Float16 ty;
153183 Float16 tz;
184+
185+ auto operator <=>(const Transform1 &other) const = default ;
154186 };
155187
156188 struct Object1
@@ -162,11 +194,15 @@ namespace gs
162194 Loc1 scale;
163195 Boolean active;
164196 std::optional<ObjectID> parent;
197+
198+ bool operator ==(const Object1 &other) const = default ;
165199 };
166200
167201 struct HeadIPD1
168202 {
169203 Float16 ipd;
204+
205+ auto operator <=>(const HeadIPD1 &other) const = default ;
170206 };
171207
172208 struct Head1
@@ -176,6 +212,8 @@ namespace gs
176212 Loc2 location;
177213 Rot2 rotation;
178214 std::optional<HeadIPD1> ipd;
215+
216+ bool operator ==(const Head1 &other) const = default ;
179217 };
180218
181219 struct Mesh1
@@ -185,6 +223,8 @@ namespace gs
185223 std::vector<Norm1> normals;
186224 std::vector<TextureUV1> textures;
187225 std::vector<VarUint> triangles;
226+
227+ bool operator ==(const Mesh1 &other) const = default ;
188228 };
189229
190230 struct Hand1
@@ -194,6 +234,8 @@ namespace gs
194234 Boolean left;
195235 Loc2 location;
196236 Rot2 rotation;
237+
238+ auto operator <=>(const Hand1 &other) const = default ;
197239 };
198240
199241 struct Thumb
@@ -202,6 +244,8 @@ namespace gs
202244 Transform1 ip;
203245 Transform1 mcp;
204246 Transform1 cmc;
247+
248+ auto operator <=>(const Thumb &other) const = default ;
205249 };
206250
207251 struct Finger
@@ -211,6 +255,8 @@ namespace gs
211255 Transform1 pip;
212256 Transform1 mcp;
213257 Transform1 cmc;
258+
259+ auto operator <=>(const Finger &other) const = default ;
214260 };
215261
216262 struct Hand2
@@ -226,12 +272,16 @@ namespace gs
226272 Finger middle;
227273 Finger ring;
228274 Finger pinky;
275+
276+ auto operator <=>(const Hand2 &other) const = default ;
229277 };
230278
231279 struct UnknownObject
232280 {
233281 VarUint tag;
234282 Blob data;
283+
284+ bool operator ==(const UnknownObject &other) const = default ;
235285 };
236286
237287 // Variant type that can contain any object type
0 commit comments