Rerun C++ SDK
Loading...
Searching...
No Matches
transform3d.hpp
1// DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/cpp/mod.rs
2// Based on "crates/store/re_types/definitions/rerun/archetypes/transform3d.fbs".
3
4#pragma once
5
6#include "../collection.hpp"
7#include "../compiler_utils.hpp"
8#include "../component_batch.hpp"
9#include "../component_column.hpp"
10#include "../components/axis_length.hpp"
11#include "../components/rotation_axis_angle.hpp"
12#include "../components/rotation_quat.hpp"
13#include "../components/scale3d.hpp"
14#include "../components/transform_frame_id.hpp"
15#include "../components/transform_mat3x3.hpp"
16#include "../components/transform_relation.hpp"
17#include "../components/translation3d.hpp"
18#include "../rerun_sdk_export.hpp"
19#include "../result.hpp"
20#include "../rotation3d.hpp"
21
22#include <cstdint>
23#include <optional>
24#include <utility>
25#include <vector>
26
27namespace rerun::archetypes {
28 /// **Archetype**: A transform between two 3D spaces, i.e. a pose.
29 ///
30 /// From the point of view of the entity's coordinate system,
31 /// all components are applied in the inverse order they are listed here.
32 /// E.g. if both a translation and a max3x3 transform are present,
33 /// the 3x3 matrix is applied first, followed by the translation.
34 ///
35 /// Whenever you log this archetype, it will write all components, even if you do not explicitly set them.
36 /// This means that if you first log a transform with only a translation, and then log one with only a rotation,
37 /// it will be resolved to a transform with only a rotation.
38 ///
39 /// For transforms that affect only a single entity and do not propagate along the entity tree refer to `archetypes::InstancePoses3D`.
40 ///
41 /// ## Examples
42 ///
43 /// ### Variety of 3D transforms
44 /// ![image](https://static.rerun.io/transform3d_simple/141368b07360ce3fcb1553079258ae3f42bdb9ac/full.png)
45 ///
46 /// ```cpp
47 /// #include <rerun.hpp>
48 ///
49 /// constexpr float TAU = 6.28318530717958647692528676655900577f;
50 ///
51 /// int main() {
52 /// const auto rec = rerun::RecordingStream("rerun_example_transform3d");
53 /// rec.spawn().exit_on_failure();
54 ///
55 /// auto arrow =
56 /// rerun::Arrows3D::from_vectors({{0.0f, 1.0f, 0.0f}}).with_origins({{0.0f, 0.0f, 0.0f}});
57 ///
58 /// rec.log("base", arrow);
59 ///
60 /// rec.log("base/translated", rerun::Transform3D::from_translation({1.0f, 0.0f, 0.0f}));
61 /// rec.log("base/translated", arrow);
62 ///
63 /// rec.log(
64 /// "base/rotated_scaled",
65 /// rerun::Transform3D::from_rotation_scale(
66 /// rerun::RotationAxisAngle({0.0f, 0.0f, 1.0f}, rerun::Angle::radians(TAU / 8.0f)),
67 /// 2.0f
68 /// )
69 /// );
70 /// rec.log("base/rotated_scaled", arrow);
71 /// }
72 /// ```
73 ///
74 /// ### Transform hierarchy
75 /// ![image](https://static.rerun.io/transform_hierarchy/cb7be7a5a31fcb2efc02ba38e434849248f87554/full.png)
76 ///
77 /// ```cpp
78 /// #include <rerun.hpp>
79 ///
80 /// constexpr float TAU = 6.28318530717958647692528676655900577f;
81 ///
82 /// int main() {
83 /// const auto rec = rerun::RecordingStream("rerun_example_transform3d_hierarchy");
84 /// rec.spawn().exit_on_failure();
85 ///
86 /// // TODO(#5521): log two views as in the python example
87 ///
88 /// rec.set_time_duration_secs("sim_time", 0.0);
89 ///
90 /// // Planetary motion is typically in the XY plane.
91 /// rec.log_static("/", rerun::ViewCoordinates::RIGHT_HAND_Z_UP);
92 ///
93 /// // Setup points, all are in the center of their own space:
94 /// rec.log(
95 /// "sun",
96 /// rerun::Points3D({{0.0f, 0.0f, 0.0f}})
97 /// .with_radii({1.0f})
98 /// .with_colors({rerun::Color(255, 200, 10)})
99 /// );
100 /// rec.log(
101 /// "sun/planet",
102 /// rerun::Points3D({{0.0f, 0.0f, 0.0f}})
103 /// .with_radii({0.4f})
104 /// .with_colors({rerun::Color(40, 80, 200)})
105 /// );
106 /// rec.log(
107 /// "sun/planet/moon",
108 /// rerun::Points3D({{0.0f, 0.0f, 0.0f}})
109 /// .with_radii({0.15f})
110 /// .with_colors({rerun::Color(180, 180, 180)})
111 /// );
112 ///
113 /// // Draw fixed paths where the planet & moon move.
114 /// float d_planet = 6.0f;
115 /// float d_moon = 3.0f;
116 /// std::vector<std::array<float, 3>> planet_path, moon_path;
117 /// for (int i = 0; i <= 100; i++) {
118 /// float angle = static_cast<float>(i) * 0.01f * TAU;
119 /// float circle_x = std::sin(angle);
120 /// float circle_y = std::cos(angle);
121 /// planet_path.push_back({circle_x * d_planet, circle_y * d_planet, 0.0f});
122 /// moon_path.push_back({circle_x * d_moon, circle_y * d_moon, 0.0f});
123 /// }
124 /// rec.log("sun/planet_path", rerun::LineStrips3D(rerun::LineStrip3D(planet_path)));
125 /// rec.log("sun/planet/moon_path", rerun::LineStrips3D(rerun::LineStrip3D(moon_path)));
126 ///
127 /// // Movement via transforms.
128 /// for (int i = 0; i <6 * 120; i++) {
129 /// float time = static_cast<float>(i) / 120.0f;
130 /// rec.set_time_duration_secs("sim_time", time);
131 /// float r_moon = time * 5.0f;
132 /// float r_planet = time * 2.0f;
133 ///
134 /// rec.log(
135 /// "sun/planet",
136 /// rerun::Transform3D::from_translation_rotation(
137 /// {std::sin(r_planet) * d_planet, std::cos(r_planet) * d_planet, 0.0f},
138 /// rerun::RotationAxisAngle{
139 /// {1.0, 0.0f, 0.0f},
140 /// rerun::Angle::degrees(20.0f),
141 /// }
142 /// )
143 /// );
144 /// rec.log(
145 /// "sun/planet/moon",
146 /// rerun::Transform3D::from_translation(
147 /// {std::cos(r_moon) * d_moon, std::sin(r_moon) * d_moon, 0.0f}
148 /// )
149 /// .with_relation(rerun::components::TransformRelation::ChildFromParent)
150 /// );
151 /// }
152 /// }
153 /// ```
154 ///
155 /// ### Update a transform over time
156 /// ![image](https://static.rerun.io/transform3d_column_updates/80634e1c7c7a505387e975f25ea8b6bc1d4eb9db/full.png)
157 ///
158 /// ```cpp
159 /// #include <rerun.hpp>
160 ///
161 /// float truncated_radians(int deg) {
162 /// auto degf = static_cast<float>(deg);
163 /// const auto pi = 3.14159265358979323846f;
164 /// return static_cast<float>(static_cast<int>(degf * pi / 180.0f * 1000.0f)) / 1000.0f;
165 /// }
166 ///
167 /// int main() {
168 /// const auto rec = rerun::RecordingStream("rerun_example_transform3d_row_updates");
169 /// rec.spawn().exit_on_failure();
170 ///
171 /// rec.set_time_sequence("tick", 0);
172 /// rec.log(
173 /// "box",
174 /// rerun::Boxes3D::from_half_sizes({{4.f, 2.f, 1.0f}}).with_fill_mode(rerun::FillMode::Solid),
175 /// rerun::Transform3D().with_axis_length(10.0)
176 /// );
177 ///
178 /// for (int t = 0; t <100; t++) {
179 /// rec.set_time_sequence("tick", t + 1);
180 /// rec.log(
181 /// "box",
182 /// rerun::Transform3D()
183 /// .with_translation({0.0f, 0.0f, static_cast<float>(t) / 10.0f})
184 /// .with_rotation_axis_angle(rerun::RotationAxisAngle(
185 /// {0.0f, 1.0f, 0.0f},
186 /// rerun::Angle::radians(truncated_radians(t * 4))
187 /// ))
188 /// );
189 /// }
190 /// }
191 /// ```
192 ///
193 /// ### Update a transform over time, in a single operation
194 /// ![image](https://static.rerun.io/transform3d_column_updates/80634e1c7c7a505387e975f25ea8b6bc1d4eb9db/full.png)
195 ///
196 /// ```cpp
197 /// #include <cmath>
198 /// #include <numeric>
199 /// #include <vector>
200 ///
201 /// #include <rerun.hpp>
202 ///
203 /// float truncated_radians(int deg) {
204 /// auto degf = static_cast<float>(deg);
205 /// const auto pi = 3.14159265358979323846f;
206 /// return static_cast<float>(static_cast<int>(degf * pi / 180.0f * 1000.0f)) / 1000.0f;
207 /// }
208 ///
209 /// int main() {
210 /// const auto rec = rerun::RecordingStream("rerun_example_transform3d_column_updates");
211 /// rec.spawn().exit_on_failure();
212 ///
213 /// rec.set_time_sequence("tick", 0);
214 /// rec.log(
215 /// "box",
216 /// rerun::Boxes3D::from_half_sizes({{4.f, 2.f, 1.0f}}).with_fill_mode(rerun::FillMode::Solid),
217 /// rerun::Transform3D().with_axis_length(10.0)
218 /// );
219 ///
220 /// std::vector<std::array<float, 3>> translations;
221 /// std::vector<rerun::RotationAxisAngle> rotations;
222 /// for (int t = 0; t <100; t++) {
223 /// translations.push_back({0.0f, 0.0f, static_cast<float>(t) / 10.0f});
224 /// rotations.push_back(rerun::RotationAxisAngle(
225 /// {0.0f, 1.0f, 0.0f},
226 /// rerun::Angle::radians(truncated_radians(t * 4))
227 /// ));
228 /// }
229 ///
230 /// std::vector<int64_t> ticks(100);
231 /// std::iota(ticks.begin(), ticks.end(), 1);
232 ///
233 /// rec.send_columns(
234 /// "box",
235 /// rerun::TimeColumn::from_sequence("tick", ticks),
236 /// rerun::Transform3D()
237 /// .with_many_translation(translations)
238 /// .with_many_rotation_axis_angle(rotations)
239 /// .columns()
240 /// );
241 /// }
242 /// ```
243 ///
244 /// ### Update specific properties of a transform over time
245 /// ![image](https://static.rerun.io/transform3d_partial_updates/11815bebc69ae400847896372b496cdd3e9b19fb/full.png)
246 ///
247 /// ```cpp
248 /// #include <rerun.hpp>
249 ///
250 /// float truncated_radians(int deg) {
251 /// auto degf = static_cast<float>(deg);
252 /// const auto pi = 3.14159265358979323846f;
253 /// return static_cast<float>(static_cast<int>(degf * pi / 180.0f * 1000.0f)) / 1000.0f;
254 /// }
255 ///
256 /// int main() {
257 /// const auto rec = rerun::RecordingStream("rerun_example_transform3d_partial_updates");
258 /// rec.spawn().exit_on_failure();
259 ///
260 /// // Set up a 3D box.
261 /// rec.log(
262 /// "box",
263 /// rerun::Boxes3D::from_half_sizes({{4.f, 2.f, 1.0f}}).with_fill_mode(rerun::FillMode::Solid),
264 /// rerun::Transform3D().with_axis_length(10.0)
265 /// );
266 ///
267 /// // Update only the rotation of the box.
268 /// for (int deg = 0; deg <= 45; deg++) {
269 /// auto rad = truncated_radians(deg * 4);
270 /// rec.log(
271 /// "box",
272 /// rerun::Transform3D::update_fields().with_rotation_axis_angle(
273 /// rerun::RotationAxisAngle({0.0f, 1.0f, 0.0f}, rerun::Angle::radians(rad))
274 /// )
275 /// );
276 /// }
277 ///
278 /// // Update only the position of the box.
279 /// for (int t = 0; t <= 50; t++) {
280 /// rec.log(
281 /// "box",
282 /// rerun::Transform3D::update_fields().with_translation(
283 /// {0.0f, 0.0f, static_cast<float>(t) / 10.0f}
284 /// )
285 /// );
286 /// }
287 ///
288 /// // Update only the rotation of the box.
289 /// for (int deg = 0; deg <= 45; deg++) {
290 /// auto rad = truncated_radians((deg + 45) * 4);
291 /// rec.log(
292 /// "box",
293 /// rerun::Transform3D::update_fields().with_rotation_axis_angle(
294 /// rerun::RotationAxisAngle({0.0f, 1.0f, 0.0f}, rerun::Angle::radians(rad))
295 /// )
296 /// );
297 /// }
298 ///
299 /// // Clear all of the box's attributes, and reset its axis length.
300 /// rec.log("box", rerun::Transform3D::clear_fields().with_axis_length(15.0));
301 /// }
302 /// ```
303 struct Transform3D {
304 /// Translation vector.
305 std::optional<ComponentBatch> translation;
306
307 /// Rotation via axis + angle.
308 std::optional<ComponentBatch> rotation_axis_angle;
309
310 /// Rotation via quaternion.
311 std::optional<ComponentBatch> quaternion;
312
313 /// Scaling factor.
314 std::optional<ComponentBatch> scale;
315
316 /// 3x3 transformation matrix.
317 std::optional<ComponentBatch> mat3x3;
318
319 /// Specifies the relation this transform establishes between this entity and its parent.
320 std::optional<ComponentBatch> relation;
321
322 /// The child frame this transform transforms from.
323 ///
324 /// The entity at which the transform relationship of any given child frame is specified mustn't change over time.
325 /// E.g. if you specified the child frame `"robot_arm"` on an entity named `"my_transforms"`, you may not log transforms
326 /// with the child frame `"robot_arm"` on any other entity than `"my_transforms"`.
327 /// An exception to this rule is static time - you may first mention a child frame on one entity statically and later on
328 /// another one temporally.
329 ///
330 /// ⚠ This currently also affects the child frame of `archetypes::Pinhole`.
331 /// ⚠ This currently is also used as the frame id of `archetypes::InstancePoses3D`.
332 ///
333 /// If not specified, this is set to the implicit transform frame of the current entity path.
334 /// This means that if a `archetypes::Transform3D` is set on an entity called `/my/entity/path` then this will default to `tf#/my/entity/path`.
335 ///
336 /// To set the frame an entity is part of see `archetypes::CoordinateFrame`.
337 std::optional<ComponentBatch> child_frame;
338
339 /// The parent frame this transform transforms into.
340 ///
341 /// ⚠ This currently also affects the parent frame of `archetypes::Pinhole`.
342 ///
343 /// If not specified, this is set to the implicit transform frame of the current entity path's parent.
344 /// This means that if a `archetypes::Transform3D` is set on an entity called `/my/entity/path` then this will default to `tf#/my/entity`.
345 ///
346 /// To set the frame an entity is part of see `archetypes::CoordinateFrame`.
347 std::optional<ComponentBatch> parent_frame;
348
349 /// Visual length of the 3 axes.
350 ///
351 /// The length is interpreted in the local coordinate system of the transform.
352 /// If the transform is scaled, the axes will be scaled accordingly.
353 std::optional<ComponentBatch> axis_length;
354
355 public:
356 /// The name of the archetype as used in `ComponentDescriptor`s.
357 static constexpr const char ArchetypeName[] = "rerun.archetypes.Transform3D";
358
359 /// `ComponentDescriptor` for the `translation` field.
361 ArchetypeName, "Transform3D:translation",
363 );
364 /// `ComponentDescriptor` for the `rotation_axis_angle` field.
366 ArchetypeName, "Transform3D:rotation_axis_angle",
368 );
369 /// `ComponentDescriptor` for the `quaternion` field.
371 ArchetypeName, "Transform3D:quaternion",
373 );
374 /// `ComponentDescriptor` for the `scale` field.
375 static constexpr auto Descriptor_scale = ComponentDescriptor(
377 );
378 /// `ComponentDescriptor` for the `mat3x3` field.
379 static constexpr auto Descriptor_mat3x3 = ComponentDescriptor(
380 ArchetypeName, "Transform3D:mat3x3",
382 );
383 /// `ComponentDescriptor` for the `relation` field.
385 ArchetypeName, "Transform3D:relation",
387 );
388 /// `ComponentDescriptor` for the `child_frame` field.
390 ArchetypeName, "Transform3D:child_frame",
392 );
393 /// `ComponentDescriptor` for the `parent_frame` field.
395 ArchetypeName, "Transform3D:parent_frame",
397 );
398 /// `ComponentDescriptor` for the `axis_length` field.
400 ArchetypeName, "Transform3D:axis_length",
402 );
403
404 public: // START of extensions from transform3d_ext.cpp:
405 /// Identity transformation.
406 ///
407 /// Applying this transform does not alter an entity's transformation.
408 RERUN_SDK_EXPORT static const Transform3D IDENTITY;
409
410 /// Invalid transformation.
411 ///
412 /// Applying this transform will cause this entity and the entire subtree not to be visualized.
413 RERUN_SDK_EXPORT static const Transform3D INVALID;
414
415 /// Creates a new 3D transform from translation and matrix provided as 3 columns.
416 /// Clears out all other components like `Transform3D::clear_fields`.
417 ///
418 /// \param translation_ \çopydoc Transform3D::translation
419 /// \param columns Column vectors of 3x3 matrix.
420 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
421 ///
422 /// _Implementation note:_ This overload is necessary, otherwise the array may be
423 /// interpreted as bool and call the wrong overload.
425 const components::Translation3D& translation_, const datatypes::Vec3D (&columns)[3],
426 bool from_parent = false
427 )
428 : Transform3D(translation_, components::TransformMat3x3(columns), from_parent) {}
429
430 /// Creates a new 3D transform from translation/matrix.
431 /// Clears out all other components like `Transform3D::clear_fields`.
432 ///
433 /// \param translation_ \çopydoc Transform3D::translation
434 /// \param mat3x3_ \copydoc Transform3D::mat3x3
435 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
437 const components::Translation3D& translation_,
438 const components::TransformMat3x3& mat3x3_, bool from_parent = false
439 ) {
440 *this = Transform3D::clear_fields().with_translation(translation_).with_mat3x3(mat3x3_);
441 if (from_parent) {
442 *this =
444 }
445 }
446
447 /// From a translation applied after a 3x3 matrix.
448 /// Clears out all other components like `Transform3D::clear_fields`.
449 ///
450 /// \param translation \çopydoc Transform3D::translation
451 /// \param mat3x3 \copydoc Transform3D::mat3x3
454 ) {
455 return Transform3D(translation, mat3x3, false);
456 }
457
458 /// From a translation applied after a 3x3 matrix provided as 3 columns.
459 /// Clears out all other components like `Transform3D::clear_fields`.
460 ///
461 /// \param translation \çopydoc Transform3D::translation
462 /// \param columns Column vectors of 3x3 matrix.
465 ) {
469 );
470 }
471
472 /// From translation only.
473 /// Clears out all other components like `Transform3D::clear_fields`.
474 ///
475 /// \param translation_ \çopydoc Transform3D::translation
476 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
477 Transform3D(const components::Translation3D& translation_, bool from_parent = false) {
478 *this = Transform3D::clear_fields().with_translation(translation_);
479 if (from_parent) {
480 *this =
482 }
483 }
484
485 /// From a translation.
486 /// Clears out all other components like `Transform3D::clear_fields`.
487 ///
488 /// \param translation \çopydoc Transform3D::translation
490 return Transform3D(translation, false);
491 }
492
493 /// From 3x3 matrix only.
494 /// Clears out all other components like `Transform3D::clear_fields`.
495 ///
496 /// \param mat3x3_ \copydoc Transform3D::mat3x3
497 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
498 Transform3D(const components::TransformMat3x3& mat3x3_, bool from_parent = false) {
499 *this = Transform3D::clear_fields().with_mat3x3(mat3x3_);
500 if (from_parent) {
501 *this =
503 }
504 }
505
506 /// From 3x3 matrix only.
507 /// Clears out all other components like `Transform3D::clear_fields`.
508 ///
509 /// \param mat3x3 \copydoc Transform3D::mat3x3
511 return Transform3D(mat3x3, false);
512 }
513
514 /// From 3x3 matrix provided as 3 columns only.
515 /// Clears out all other components like `Transform3D::clear_fields`.
516 ///
517 /// \param columns Column vectors of 3x3 matrix.
518 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
519 Transform3D(const datatypes::Vec3D (&columns)[3], bool from_parent = false)
520 : Transform3D(components::TransformMat3x3(columns), from_parent) {}
521
522 /// From 3x3 matrix provided as 3 columns only.
523 /// Clears out all other components like `Transform3D::clear_fields`.
524 ///
525 /// \param columns Column vectors of 3x3 matrix.
528 }
529
530 /// Creates a new 3D transform from translation/rotation/scale.
531 /// Clears out all other components like `Transform3D::clear_fields`.
532 ///
533 /// \param translation_ \copydoc Transform3D::translation
534 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
535 /// \param scale_ \copydoc Transform3D::scale
536 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
538 const components::Translation3D& translation_, const Rotation3D& rotation,
539 const components::Scale3D& scale_, bool from_parent = false
540 ) {
542 .with_translation(translation_)
543 .with_scale(scale_)
544 .with_rotation(rotation);
545 if (from_parent) {
546 *this =
548 }
549 }
550
551 /// Creates a new 3D transform from translation/rotation/uniform-scale.
552 /// Clears out all other components like `Transform3D::clear_fields`.
553 ///
554 /// \param translation_ \copydoc Transform3D::translation
555 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
556 /// \param uniform_scale Uniform scale factor that is applied to all axis equally.
557 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
558 ///
559 /// _Implementation note:_ This explicit overload prevents interpretation of the float as
560 /// bool, leading to a call to the wrong overload.
562 const components::Translation3D& translation_, const Rotation3D& rotation,
563 float uniform_scale, bool from_parent = false
564 )
565 : Transform3D(translation_, rotation, components::Scale3D(uniform_scale), from_parent) {
566 }
567
568 /// From a translation, applied after a rotation & scale, known as an affine transformation.
569 /// Clears out all other components like `Transform3D::clear_fields`.
570 ///
571 /// \param translation \copydoc Transform3D::translation
572 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
573 /// \param scale \copydoc Transform3D::scale
575 const components::Translation3D& translation, const Rotation3D& rotation,
577 ) {
578 return Transform3D(translation, rotation, scale, false);
579 }
580
581 /// From a translation, applied after a rotation & scale, known as an affine transformation.
582 /// Clears out all other components like `Transform3D::clear_fields`.
583 ///
584 /// \param translation \copydoc Transform3D::translation
585 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
586 /// \param uniform_scale Uniform scale factor that is applied to all axis equally.
588 const components::Translation3D& translation, const Rotation3D& rotation,
589 float uniform_scale
590 ) {
591 return Transform3D(translation, rotation, components::Scale3D(uniform_scale), false);
592 }
593
594 /// Creates a new rigid transform (translation & rotation only).
595 /// Clears out all other components like `Transform3D::clear_fields`.
596 ///
597 /// \param translation_ \copydoc Transform3D::translation
598 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
599 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
601 const components::Translation3D& translation_, const Rotation3D& rotation,
602 bool from_parent = false
603 ) {
604 *this =
606 if (from_parent) {
607 *this =
609 }
610 }
611
612 /// From a rotation & scale.
613 /// Clears out all other components like `Transform3D::clear_fields`.
614 ///
615 /// \param translation \copydoc Transform3D::translation
616 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
618 const components::Translation3D& translation, const Rotation3D& rotation
619 ) {
620 return Transform3D(translation, rotation, false);
621 }
622
623 /// From translation & scale only.
624 /// Clears out all other components like `Transform3D::clear_fields`.
625 ///
626 /// \param translation_ \copydoc Transform3D::translation
627 /// \param scale_ Transform3D::scale
628 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
630 const components::Translation3D& translation_, const components::Scale3D& scale_,
631 bool from_parent = false
632 ) {
633 *this = Transform3D::clear_fields().with_translation(translation_).with_scale(scale_);
634 if (from_parent) {
635 *this =
637 }
638 }
639
640 /// From a translation applied after a scale.
641 /// Clears out all other components like `Transform3D::clear_fields`.
642 ///
643 /// \param translation \copydoc Transform3D::translation
644 /// \param scale Transform3D::scale
647 ) {
648 return Transform3D(translation, scale, false);
649 }
650
651 /// From translation & uniform scale only.
652 /// Clears out all other components like `Transform3D::clear_fields`.
653 ///
654 /// \param translation_ \copydoc Transform3D::translation
655 /// \param uniform_scale Uniform scale factor that is applied to all axis equally.
656 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
657 ///
658 /// _Implementation note:_ This explicit overload prevents interpretation of the float as
659 /// bool, leading to a call to the wrong overload.
661 const components::Translation3D& translation_, float uniform_scale,
662 bool from_parent = false
663 )
664 : Transform3D(translation_, components::Scale3D(uniform_scale), from_parent) {}
665
666 /// From rotation & scale.
667 /// Clears out all other components like `Transform3D::clear_fields`.
668 ///
669 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
670 /// \param scale_ Transform3D::scale
671 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
673 const Rotation3D& rotation, const components::Scale3D& scale_, bool from_parent = false
674 ) {
675 *this = Transform3D::clear_fields().with_scale(scale_).with_rotation(rotation);
676 if (from_parent) {
677 *this =
679 }
680 }
681
682 /// From rotation & uniform scale.
683 /// Clears out all other components like `Transform3D::clear_fields`.
684 ///
685 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
686 /// \param uniform_scale Uniform scale factor that is applied to all axis equally.
687 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
688 ///
689 /// _Implementation note:_ This explicit overload prevents interpretation of the float as
690 /// bool, leading to a call to the wrong overload.
691 Transform3D(const Rotation3D& rotation, float uniform_scale, bool from_parent = false)
692 : Transform3D(rotation, components::Scale3D(uniform_scale), from_parent) {}
693
694 /// From a rotation & scale.
695 /// Clears out all other components like `Transform3D::clear_fields`.
696 ///
697 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
698 /// \param scale Transform3D::scale
700 const Rotation3D& rotation, const components::Scale3D& scale
701 ) {
702 return Transform3D(rotation, scale, false);
703 }
704
705 /// From a rotation & uniform scale.
706 /// Clears out all other components like `Transform3D::clear_fields`.
707 ///
708 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
709 /// \param uniform_scale Uniform scale factor that is applied to all axis equally.
710 static Transform3D from_rotation_scale(const Rotation3D& rotation, float uniform_scale) {
711 return Transform3D(rotation, components::Scale3D(uniform_scale), false);
712 }
713
714 /// From rotation only.
715 /// Clears out all other components like `Transform3D::clear_fields`.
716 ///
717 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
718 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
719 Transform3D(const Rotation3D& rotation, bool from_parent = false) {
720 *this = Transform3D::clear_fields().with_rotation(rotation);
721 if (from_parent) {
722 *this =
724 }
725 }
726
727 /// From rotation only.
728 /// Clears out all other components like `Transform3D::clear_fields`.
729 ///
730 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
731 static Transform3D from_rotation(const Rotation3D& rotation) {
732 return Transform3D(rotation, false);
733 }
734
735 /// From scale only.
736 /// Clears out all other components like `Transform3D::clear_fields`.
737 ///
738 /// \param scale_ If true, the transform relation to `TransformRelation::ChildFromParent`.
739 /// \param from_parent \copydoc Transform3D::scale
740 Transform3D(const components::Scale3D& scale_, bool from_parent = false) {
741 *this = Transform3D::clear_fields().with_scale(scale_);
742 if (from_parent) {
743 *this =
745 }
746 }
747
748 /// From scale only.
749 /// Clears out all other components like `Transform3D::clear_fields`.
750 ///
751 /// \param scale Transform3D::scale
753 return Transform3D(scale, false);
754 }
755
756 /// From scale only.
757 /// Clears out all other components like `Transform3D::clear_fields`.
758 ///
759 /// \param uniform_scale Uniform scale factor that is applied to all axis equally.
760 static Transform3D from_scale(float uniform_scale) {
761 return Transform3D(components::Scale3D(uniform_scale), false);
762 }
763
764 /// Set the rotation component of the transform using the `rerun::Rotation3D` utility.
766 if (rotation.axis_angle.has_value()) {
767 *this = std::move(*this).with_rotation_axis_angle(rotation.axis_angle.value());
768 }
769 if (rotation.quaternion.has_value()) {
770 *this = std::move(*this).with_quaternion(rotation.quaternion.value());
771 }
772 return std::move(*this);
773 }
774
775 // END of extensions from transform3d_ext.cpp, start of generated code:
776
777 public:
778 Transform3D() = default;
779 Transform3D(Transform3D&& other) = default;
780 Transform3D(const Transform3D& other) = default;
781 Transform3D& operator=(const Transform3D& other) = default;
782 Transform3D& operator=(Transform3D&& other) = default;
783
784 /// Update only some specific fields of a `Transform3D`.
786 return Transform3D();
787 }
788
789 /// Clear all the fields of a `Transform3D`.
791
792 /// Translation vector.
795 .value_or_throw();
796 return std::move(*this);
797 }
798
799 /// This method makes it possible to pack multiple `translation` in a single component batch.
800 ///
801 /// This only makes sense when used in conjunction with `columns`. `with_translation` should
802 /// be used when logging a single row's worth of data.
805 ) && {
807 .value_or_throw();
808 return std::move(*this);
809 }
810
811 /// Rotation via axis + angle.
813 const rerun::components::RotationAxisAngle& _rotation_axis_angle
814 ) && {
817 .value_or_throw();
818 return std::move(*this);
819 }
820
821 /// This method makes it possible to pack multiple `rotation_axis_angle` in a single component batch.
822 ///
823 /// This only makes sense when used in conjunction with `columns`. `with_rotation_axis_angle` should
824 /// be used when logging a single row's worth of data.
826 const Collection<rerun::components::RotationAxisAngle>& _rotation_axis_angle
827 ) && {
830 .value_or_throw();
831 return std::move(*this);
832 }
833
834 /// Rotation via quaternion.
836 quaternion =
837 ComponentBatch::from_loggable(_quaternion, Descriptor_quaternion).value_or_throw();
838 return std::move(*this);
839 }
840
841 /// This method makes it possible to pack multiple `quaternion` in a single component batch.
842 ///
843 /// This only makes sense when used in conjunction with `columns`. `with_quaternion` should
844 /// be used when logging a single row's worth of data.
847 ) && {
848 quaternion =
849 ComponentBatch::from_loggable(_quaternion, Descriptor_quaternion).value_or_throw();
850 return std::move(*this);
851 }
852
853 /// Scaling factor.
855 scale = ComponentBatch::from_loggable(_scale, Descriptor_scale).value_or_throw();
856 return std::move(*this);
857 }
858
859 /// This method makes it possible to pack multiple `scale` in a single component batch.
860 ///
861 /// This only makes sense when used in conjunction with `columns`. `with_scale` should
862 /// be used when logging a single row's worth of data.
864 scale = ComponentBatch::from_loggable(_scale, Descriptor_scale).value_or_throw();
865 return std::move(*this);
866 }
867
868 /// 3x3 transformation matrix.
870 mat3x3 = ComponentBatch::from_loggable(_mat3x3, Descriptor_mat3x3).value_or_throw();
871 return std::move(*this);
872 }
873
874 /// This method makes it possible to pack multiple `mat3x3` in a single component batch.
875 ///
876 /// This only makes sense when used in conjunction with `columns`. `with_mat3x3` should
877 /// be used when logging a single row's worth of data.
879 ) && {
880 mat3x3 = ComponentBatch::from_loggable(_mat3x3, Descriptor_mat3x3).value_or_throw();
881 return std::move(*this);
882 }
883
884 /// Specifies the relation this transform establishes between this entity and its parent.
886 relation =
887 ComponentBatch::from_loggable(_relation, Descriptor_relation).value_or_throw();
888 return std::move(*this);
889 }
890
891 /// This method makes it possible to pack multiple `relation` in a single component batch.
892 ///
893 /// This only makes sense when used in conjunction with `columns`. `with_relation` should
894 /// be used when logging a single row's worth of data.
897 ) && {
898 relation =
899 ComponentBatch::from_loggable(_relation, Descriptor_relation).value_or_throw();
900 return std::move(*this);
901 }
902
903 /// The child frame this transform transforms from.
904 ///
905 /// The entity at which the transform relationship of any given child frame is specified mustn't change over time.
906 /// E.g. if you specified the child frame `"robot_arm"` on an entity named `"my_transforms"`, you may not log transforms
907 /// with the child frame `"robot_arm"` on any other entity than `"my_transforms"`.
908 /// An exception to this rule is static time - you may first mention a child frame on one entity statically and later on
909 /// another one temporally.
910 ///
911 /// ⚠ This currently also affects the child frame of `archetypes::Pinhole`.
912 /// ⚠ This currently is also used as the frame id of `archetypes::InstancePoses3D`.
913 ///
914 /// If not specified, this is set to the implicit transform frame of the current entity path.
915 /// This means that if a `archetypes::Transform3D` is set on an entity called `/my/entity/path` then this will default to `tf#/my/entity/path`.
916 ///
917 /// To set the frame an entity is part of see `archetypes::CoordinateFrame`.
920 .value_or_throw();
921 return std::move(*this);
922 }
923
924 /// This method makes it possible to pack multiple `child_frame` in a single component batch.
925 ///
926 /// This only makes sense when used in conjunction with `columns`. `with_child_frame` should
927 /// be used when logging a single row's worth of data.
930 ) && {
932 .value_or_throw();
933 return std::move(*this);
934 }
935
936 /// The parent frame this transform transforms into.
937 ///
938 /// ⚠ This currently also affects the parent frame of `archetypes::Pinhole`.
939 ///
940 /// If not specified, this is set to the implicit transform frame of the current entity path's parent.
941 /// This means that if a `archetypes::Transform3D` is set on an entity called `/my/entity/path` then this will default to `tf#/my/entity`.
942 ///
943 /// To set the frame an entity is part of see `archetypes::CoordinateFrame`.
946 .value_or_throw();
947 return std::move(*this);
948 }
949
950 /// This method makes it possible to pack multiple `parent_frame` in a single component batch.
951 ///
952 /// This only makes sense when used in conjunction with `columns`. `with_parent_frame` should
953 /// be used when logging a single row's worth of data.
956 ) && {
958 .value_or_throw();
959 return std::move(*this);
960 }
961
962 /// Visual length of the 3 axes.
963 ///
964 /// The length is interpreted in the local coordinate system of the transform.
965 /// If the transform is scaled, the axes will be scaled accordingly.
968 .value_or_throw();
969 return std::move(*this);
970 }
971
972 /// This method makes it possible to pack multiple `axis_length` in a single component batch.
973 ///
974 /// This only makes sense when used in conjunction with `columns`. `with_axis_length` should
975 /// be used when logging a single row's worth of data.
978 ) && {
980 .value_or_throw();
981 return std::move(*this);
982 }
983
984 /// Partitions the component data into multiple sub-batches.
985 ///
986 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
987 /// instead, via `ComponentBatch::partitioned`.
988 ///
989 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
990 ///
991 /// The specified `lengths` must sum to the total length of the component batch.
993
994 /// Partitions the component data into unit-length sub-batches.
995 ///
996 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
997 /// where `n` is automatically guessed.
999 };
1000
1001} // namespace rerun::archetypes
1002
1003namespace rerun {
1004 /// \private
1005 template <typename T>
1006 struct AsComponents;
1007
1008 /// \private
1009 template <>
1010 struct AsComponents<archetypes::Transform3D> {
1011 /// Serialize all set component batches.
1012 static Result<Collection<ComponentBatch>> as_batches(
1013 const archetypes::Transform3D& archetype
1014 );
1015 };
1016} // namespace rerun
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
A class for representing either a usable value, or an error.
Definition result.hpp:14
All built-in archetypes. See Types in the Rerun manual.
Definition rerun.hpp:76
TransformRelation
Component: Specifies relation a spatial transform describes.
Definition transform_relation.hpp:24
@ ChildFromParent
The transform describes how to transform into the child entity's space.
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
static Result< ComponentBatch > from_loggable(const rerun::Collection< T > &components, const ComponentDescriptor &descriptor)
Creates a new component batch from a collection of component instances.
Definition component_batch.hpp:46
A ComponentDescriptor fully describes the semantics of a column of data.
Definition component_descriptor.hpp:16
The Loggable trait is used by all built-in implementation of rerun::AsComponents to serialize a colle...
Definition loggable.hpp:11
Utility for representing a single 3D rotation, agnostic to the underlying representation.
Definition rotation3d.hpp:14
Archetype: A transform between two 3D spaces, i.e.
Definition transform3d.hpp:303
static constexpr auto Descriptor_rotation_axis_angle
ComponentDescriptor for the rotation_axis_angle field.
Definition transform3d.hpp:365
static RERUN_SDK_EXPORT const Transform3D IDENTITY
Identity transformation.
Definition transform3d.hpp:408
std::optional< ComponentBatch > parent_frame
The parent frame this transform transforms into.
Definition transform3d.hpp:347
std::optional< ComponentBatch > mat3x3
3x3 transformation matrix.
Definition transform3d.hpp:317
Transform3D with_many_axis_length(const Collection< rerun::components::AxisLength > &_axis_length) &&
This method makes it possible to pack multiple axis_length in a single component batch.
Definition transform3d.hpp:976
Transform3D(const datatypes::Vec3D(&columns)[3], bool from_parent=false)
From 3x3 matrix provided as 3 columns only.
Definition transform3d.hpp:519
Transform3D(const components::Translation3D &translation_, const components::TransformMat3x3 &mat3x3_, bool from_parent=false)
Creates a new 3D transform from translation/matrix.
Definition transform3d.hpp:436
std::optional< ComponentBatch > child_frame
The child frame this transform transforms from.
Definition transform3d.hpp:337
static Transform3D from_translation_scale(const components::Translation3D &translation, const components::Scale3D &scale)
From a translation applied after a scale.
Definition transform3d.hpp:645
Transform3D with_relation(const rerun::components::TransformRelation &_relation) &&
Specifies the relation this transform establishes between this entity and its parent.
Definition transform3d.hpp:885
Transform3D(const components::Translation3D &translation_, const Rotation3D &rotation, float uniform_scale, bool from_parent=false)
Creates a new 3D transform from translation/rotation/uniform-scale.
Definition transform3d.hpp:561
std::optional< ComponentBatch > axis_length
Visual length of the 3 axes.
Definition transform3d.hpp:353
static Transform3D from_mat3x3(const components::TransformMat3x3 &mat3x3)
From 3x3 matrix only.
Definition transform3d.hpp:510
Transform3D(const components::Translation3D &translation_, const Rotation3D &rotation, const components::Scale3D &scale_, bool from_parent=false)
Creates a new 3D transform from translation/rotation/scale.
Definition transform3d.hpp:537
Transform3D(const Rotation3D &rotation, float uniform_scale, bool from_parent=false)
From rotation & uniform scale.
Definition transform3d.hpp:691
Transform3D(const components::Translation3D &translation_, float uniform_scale, bool from_parent=false)
From translation & uniform scale only.
Definition transform3d.hpp:660
Transform3D with_scale(const rerun::components::Scale3D &_scale) &&
Scaling factor.
Definition transform3d.hpp:854
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
static constexpr auto Descriptor_child_frame
ComponentDescriptor for the child_frame field.
Definition transform3d.hpp:389
static RERUN_SDK_EXPORT const Transform3D INVALID
Invalid transformation.
Definition transform3d.hpp:413
Transform3D with_many_child_frame(const Collection< rerun::components::TransformFrameId > &_child_frame) &&
This method makes it possible to pack multiple child_frame in a single component batch.
Definition transform3d.hpp:928
Transform3D with_quaternion(const rerun::components::RotationQuat &_quaternion) &&
Rotation via quaternion.
Definition transform3d.hpp:835
std::optional< ComponentBatch > translation
Translation vector.
Definition transform3d.hpp:305
Transform3D(const components::Translation3D &translation_, const Rotation3D &rotation, bool from_parent=false)
Creates a new rigid transform (translation & rotation only).
Definition transform3d.hpp:600
Transform3D(const components::Translation3D &translation_, const datatypes::Vec3D(&columns)[3], bool from_parent=false)
Creates a new 3D transform from translation and matrix provided as 3 columns.
Definition transform3d.hpp:424
Transform3D with_translation(const rerun::components::Translation3D &_translation) &&
Translation vector.
Definition transform3d.hpp:793
Transform3D(const Rotation3D &rotation, bool from_parent=false)
From rotation only.
Definition transform3d.hpp:719
Transform3D(const components::TransformMat3x3 &mat3x3_, bool from_parent=false)
From 3x3 matrix only.
Definition transform3d.hpp:498
Transform3D with_axis_length(const rerun::components::AxisLength &_axis_length) &&
Visual length of the 3 axes.
Definition transform3d.hpp:966
static Transform3D update_fields()
Update only some specific fields of a Transform3D.
Definition transform3d.hpp:785
static Transform3D from_rotation_scale(const Rotation3D &rotation, float uniform_scale)
From a rotation & uniform scale.
Definition transform3d.hpp:710
static Transform3D from_translation_mat3x3(const components::Translation3D &translation, const components::TransformMat3x3 &mat3x3)
From a translation applied after a 3x3 matrix.
Definition transform3d.hpp:452
static Transform3D from_rotation_scale(const Rotation3D &rotation, const components::Scale3D &scale)
From a rotation & scale.
Definition transform3d.hpp:699
static Transform3D from_translation(const components::Translation3D &translation)
From a translation.
Definition transform3d.hpp:489
static constexpr auto Descriptor_axis_length
ComponentDescriptor for the axis_length field.
Definition transform3d.hpp:399
Transform3D with_rotation(const Rotation3D &rotation) &&
Set the rotation component of the transform using the rerun::Rotation3D utility.
Definition transform3d.hpp:765
static Transform3D from_scale(float uniform_scale)
From scale only.
Definition transform3d.hpp:760
std::optional< ComponentBatch > rotation_axis_angle
Rotation via axis + angle.
Definition transform3d.hpp:308
Transform3D with_many_mat3x3(const Collection< rerun::components::TransformMat3x3 > &_mat3x3) &&
This method makes it possible to pack multiple mat3x3 in a single component batch.
Definition transform3d.hpp:878
static constexpr auto Descriptor_translation
ComponentDescriptor for the translation field.
Definition transform3d.hpp:360
Transform3D with_many_rotation_axis_angle(const Collection< rerun::components::RotationAxisAngle > &_rotation_axis_angle) &&
This method makes it possible to pack multiple rotation_axis_angle in a single component batch.
Definition transform3d.hpp:825
static constexpr auto Descriptor_quaternion
ComponentDescriptor for the quaternion field.
Definition transform3d.hpp:370
static Transform3D from_translation_rotation_scale(const components::Translation3D &translation, const Rotation3D &rotation, const components::Scale3D &scale)
From a translation, applied after a rotation & scale, known as an affine transformation.
Definition transform3d.hpp:574
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition transform3d.hpp:357
static constexpr auto Descriptor_parent_frame
ComponentDescriptor for the parent_frame field.
Definition transform3d.hpp:394
static constexpr auto Descriptor_scale
ComponentDescriptor for the scale field.
Definition transform3d.hpp:375
Transform3D(const components::Scale3D &scale_, bool from_parent=false)
From scale only.
Definition transform3d.hpp:740
static constexpr auto Descriptor_mat3x3
ComponentDescriptor for the mat3x3 field.
Definition transform3d.hpp:379
static Transform3D from_translation_mat3x3(const components::Translation3D &translation, const datatypes::Vec3D(&columns)[3])
From a translation applied after a 3x3 matrix provided as 3 columns.
Definition transform3d.hpp:463
static Transform3D from_translation_rotation(const components::Translation3D &translation, const Rotation3D &rotation)
From a rotation & scale.
Definition transform3d.hpp:617
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
std::optional< ComponentBatch > quaternion
Rotation via quaternion.
Definition transform3d.hpp:311
Transform3D with_child_frame(const rerun::components::TransformFrameId &_child_frame) &&
The child frame this transform transforms from.
Definition transform3d.hpp:918
Transform3D(const Rotation3D &rotation, const components::Scale3D &scale_, bool from_parent=false)
From rotation & scale.
Definition transform3d.hpp:672
Transform3D with_many_relation(const Collection< rerun::components::TransformRelation > &_relation) &&
This method makes it possible to pack multiple relation in a single component batch.
Definition transform3d.hpp:895
Transform3D(const components::Translation3D &translation_, bool from_parent=false)
From translation only.
Definition transform3d.hpp:477
Transform3D with_many_quaternion(const Collection< rerun::components::RotationQuat > &_quaternion) &&
This method makes it possible to pack multiple quaternion in a single component batch.
Definition transform3d.hpp:845
Transform3D with_rotation_axis_angle(const rerun::components::RotationAxisAngle &_rotation_axis_angle) &&
Rotation via axis + angle.
Definition transform3d.hpp:812
Transform3D with_parent_frame(const rerun::components::TransformFrameId &_parent_frame) &&
The parent frame this transform transforms into.
Definition transform3d.hpp:944
Transform3D with_many_translation(const Collection< rerun::components::Translation3D > &_translation) &&
This method makes it possible to pack multiple translation in a single component batch.
Definition transform3d.hpp:803
Transform3D(const components::Translation3D &translation_, const components::Scale3D &scale_, bool from_parent=false)
From translation & scale only.
Definition transform3d.hpp:629
std::optional< ComponentBatch > relation
Specifies the relation this transform establishes between this entity and its parent.
Definition transform3d.hpp:320
static Transform3D clear_fields()
Clear all the fields of a Transform3D.
Transform3D with_many_scale(const Collection< rerun::components::Scale3D > &_scale) &&
This method makes it possible to pack multiple scale in a single component batch.
Definition transform3d.hpp:863
static Transform3D from_translation_rotation_scale(const components::Translation3D &translation, const Rotation3D &rotation, float uniform_scale)
From a translation, applied after a rotation & scale, known as an affine transformation.
Definition transform3d.hpp:587
Transform3D with_mat3x3(const rerun::components::TransformMat3x3 &_mat3x3) &&
3x3 transformation matrix.
Definition transform3d.hpp:869
static constexpr auto Descriptor_relation
ComponentDescriptor for the relation field.
Definition transform3d.hpp:384
static Transform3D from_scale(const components::Scale3D &scale)
From scale only.
Definition transform3d.hpp:752
static Transform3D from_mat3x3(const datatypes::Vec3D(&columns)[3])
From 3x3 matrix provided as 3 columns only.
Definition transform3d.hpp:526
std::optional< ComponentBatch > scale
Scaling factor.
Definition transform3d.hpp:314
static Transform3D from_rotation(const Rotation3D &rotation)
From rotation only.
Definition transform3d.hpp:731
Transform3D with_many_parent_frame(const Collection< rerun::components::TransformFrameId > &_parent_frame) &&
This method makes it possible to pack multiple parent_frame in a single component batch.
Definition transform3d.hpp:954
Component: The length of an axis in local units of the space.
Definition axis_length.hpp:14
Component: 3D rotation represented by a rotation around a given axis.
Definition rotation_axis_angle.hpp:17
Component: A 3D rotation expressed as a quaternion.
Definition rotation_quat.hpp:18
Component: A 3D scale factor.
Definition scale3d.hpp:19
Component: A string identifier for a transform frame.
Definition transform_frame_id.hpp:27
Component: A 3x3 transformation matrix Matrix.
Definition transform_mat3x3.hpp:27
Component: A translation vector in 3D space.
Definition translation3d.hpp:15
Datatype: A vector in 3D space.
Definition vec3d.hpp:20