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 "../components/axis_length.hpp"
10#include "../components/rotation_axis_angle.hpp"
11#include "../components/rotation_quat.hpp"
12#include "../components/scale3d.hpp"
13#include "../components/transform_mat3x3.hpp"
14#include "../components/transform_relation.hpp"
15#include "../components/translation3d.hpp"
16#include "../indicator_component.hpp"
17#include "../rerun_sdk_export.hpp"
18#include "../result.hpp"
19#include "../rotation3d.hpp"
20
21#include <cstdint>
22#include <optional>
23#include <utility>
24#include <vector>
25
26namespace rerun::archetypes {
27 /// **Archetype**: A transform between two 3D spaces, i.e. a pose.
28 ///
29 /// From the point of view of the entity's coordinate system,
30 /// all components are applied in the inverse order they are listed here.
31 /// E.g. if both a translation and a max3x3 transform are present,
32 /// the 3x3 matrix is applied first, followed by the translation.
33 ///
34 /// Whenever you log this archetype, it will write all components, even if you do not explicitly set them.
35 /// This means that if you first log a transform with only a translation, and then log one with only a rotation,
36 /// it will be resolved to a transform with only a rotation.
37 ///
38 /// For transforms that affect only a single entity and do not propagate along the entity tree refer to `archetypes::InstancePoses3D`.
39 ///
40 /// ## Examples
41 ///
42 /// ### Variety of 3D transforms
43 /// ![image](https://static.rerun.io/transform3d_simple/141368b07360ce3fcb1553079258ae3f42bdb9ac/full.png)
44 ///
45 /// ```cpp
46 /// #include <rerun.hpp>
47 ///
48 /// constexpr float TAU = 6.28318530717958647692528676655900577f;
49 ///
50 /// int main() {
51 /// const auto rec = rerun::RecordingStream("rerun_example_transform3d");
52 /// rec.spawn().exit_on_failure();
53 ///
54 /// auto arrow =
55 /// rerun::Arrows3D::from_vectors({{0.0f, 1.0f, 0.0f}}).with_origins({{0.0f, 0.0f, 0.0f}});
56 ///
57 /// rec.log("base", arrow);
58 ///
59 /// rec.log("base/translated", rerun::Transform3D::from_translation({1.0f, 0.0f, 0.0f}));
60 /// rec.log("base/translated", arrow);
61 ///
62 /// rec.log(
63 /// "base/rotated_scaled",
64 /// rerun::Transform3D::from_rotation_scale(
65 /// rerun::RotationAxisAngle({0.0f, 0.0f, 1.0f}, rerun::Angle::radians(TAU / 8.0f)),
66 /// 2.0f
67 /// )
68 /// );
69 /// rec.log("base/rotated_scaled", arrow);
70 /// }
71 /// ```
72 ///
73 /// ### Transform hierarchy
74 /// ![image](https://static.rerun.io/transform_hierarchy/cb7be7a5a31fcb2efc02ba38e434849248f87554/full.png)
75 ///
76 /// ```cpp
77 /// #include <rerun.hpp>
78 ///
79 /// constexpr float TAU = 6.28318530717958647692528676655900577f;
80 ///
81 /// int main() {
82 /// const auto rec = rerun::RecordingStream("rerun_example_transform3d_hierarchy");
83 /// rec.spawn().exit_on_failure();
84 ///
85 /// // TODO(#5521): log two space views as in the python example
86 ///
87 /// rec.set_time_seconds("sim_time", 0.0);
88 ///
89 /// // Planetary motion is typically in the XY plane.
90 /// rec.log_static("/", rerun::ViewCoordinates::RIGHT_HAND_Z_UP);
91 ///
92 /// // Setup points, all are in the center of their own space:
93 /// rec.log(
94 /// "sun",
95 /// rerun::Points3D({{0.0f, 0.0f, 0.0f}})
96 /// .with_radii({1.0f})
97 /// .with_colors({rerun::Color(255, 200, 10)})
98 /// );
99 /// rec.log(
100 /// "sun/planet",
101 /// rerun::Points3D({{0.0f, 0.0f, 0.0f}})
102 /// .with_radii({0.4f})
103 /// .with_colors({rerun::Color(40, 80, 200)})
104 /// );
105 /// rec.log(
106 /// "sun/planet/moon",
107 /// rerun::Points3D({{0.0f, 0.0f, 0.0f}})
108 /// .with_radii({0.15f})
109 /// .with_colors({rerun::Color(180, 180, 180)})
110 /// );
111 ///
112 /// // Draw fixed paths where the planet & moon move.
113 /// float d_planet = 6.0f;
114 /// float d_moon = 3.0f;
115 /// std::vector<std::array<float, 3>> planet_path, moon_path;
116 /// for (int i = 0; i <= 100; i++) {
117 /// float angle = static_cast<float>(i) * 0.01f * TAU;
118 /// float circle_x = std::sin(angle);
119 /// float circle_y = std::cos(angle);
120 /// planet_path.push_back({circle_x * d_planet, circle_y * d_planet, 0.0f});
121 /// moon_path.push_back({circle_x * d_moon, circle_y * d_moon, 0.0f});
122 /// }
123 /// rec.log("sun/planet_path", rerun::LineStrips3D(rerun::LineStrip3D(planet_path)));
124 /// rec.log("sun/planet/moon_path", rerun::LineStrips3D(rerun::LineStrip3D(moon_path)));
125 ///
126 /// // Movement via transforms.
127 /// for (int i = 0; i <6 * 120; i++) {
128 /// float time = static_cast<float>(i) / 120.0f;
129 /// rec.set_time_seconds("sim_time", time);
130 /// float r_moon = time * 5.0f;
131 /// float r_planet = time * 2.0f;
132 ///
133 /// rec.log(
134 /// "sun/planet",
135 /// rerun::Transform3D::from_translation_rotation(
136 /// {std::sin(r_planet) * d_planet, std::cos(r_planet) * d_planet, 0.0f},
137 /// rerun::RotationAxisAngle{
138 /// {1.0, 0.0f, 0.0f},
139 /// rerun::Angle::degrees(20.0f),
140 /// }
141 /// )
142 /// );
143 /// rec.log(
144 /// "sun/planet/moon",
145 /// rerun::Transform3D::from_translation(
146 /// {std::cos(r_moon) * d_moon, std::sin(r_moon) * d_moon, 0.0f}
147 /// )
148 /// .with_relation(rerun::components::TransformRelation::ChildFromParent)
149 /// );
150 /// }
151 /// }
152 /// ```
153 struct Transform3D {
154 /// Translation vector.
155 std::optional<rerun::components::Translation3D> translation;
156
157 /// Rotation via axis + angle.
158 std::optional<rerun::components::RotationAxisAngle> rotation_axis_angle;
159
160 /// Rotation via quaternion.
161 std::optional<rerun::components::RotationQuat> quaternion;
162
163 /// Scaling factor.
164 std::optional<rerun::components::Scale3D> scale;
165
166 /// 3x3 transformation matrix.
167 std::optional<rerun::components::TransformMat3x3> mat3x3;
168
169 /// Specifies the relation this transform establishes between this entity and its parent.
170 std::optional<rerun::components::TransformRelation> relation;
171
172 /// Visual length of the 3 axes.
173 ///
174 /// The length is interpreted in the local coordinate system of the transform.
175 /// If the transform is scaled, the axes will be scaled accordingly.
176 std::optional<rerun::components::AxisLength> axis_length;
177
178 public:
179 static constexpr const char IndicatorComponentName[] =
180 "rerun.components.Transform3DIndicator";
181
182 /// Indicator component, used to identify the archetype when converting to a list of components.
184
185 public: // START of extensions from transform3d_ext.cpp:
186 /// Identity transformation.
187 ///
188 /// Applying this transform does not alter an entity's transformation.
189 RERUN_SDK_EXPORT static const Transform3D IDENTITY;
190
191 /// Creates a new 3D transform from translation and matrix provided as 3 columns.
192 ///
193 /// \param translation_ \çopydoc Transform3D::translation
194 /// \param columns Column vectors of 3x3 matrix.
195 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
196 ///
197 /// _Implementation note:_ This overload is necessary, otherwise the array may be
198 /// interpreted as bool and call the wrong overload.
200 const components::Translation3D& translation_, const datatypes::Vec3D (&columns)[3],
201 bool from_parent = false
202 )
203 : Transform3D(translation_, components::TransformMat3x3(columns), from_parent) {}
204
205 /// Creates a new 3D transform from translation/matrix.
206 ///
207 /// \param translation_ \çopydoc Transform3D::translation
208 /// \param mat3x3_ \copydoc Transform3D::mat3x3
209 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
211 const components::Translation3D& translation_,
212 const components::TransformMat3x3& mat3x3_, bool from_parent = false
213 )
214 : translation(translation_), mat3x3(mat3x3_) {
215 if (from_parent) {
217 }
218 }
219
220 /// From a translation applied after a 3x3 matrix.
221 ///
222 /// \param translation \çopydoc Transform3D::translation
223 /// \param mat3x3 \copydoc Transform3D::mat3x3
226 ) {
227 return Transform3D(translation, mat3x3, false);
228 }
229
230 /// From a translation applied after a 3x3 matrix provided as 3 columns.
231 ///
232 /// \param translation \çopydoc Transform3D::translation
233 /// \param columns Column vectors of 3x3 matrix.
235 const components::Translation3D& translation, const datatypes::Vec3D (&columns)[3]
236 ) {
240 );
241 }
242
243 /// From translation only.
244 ///
245 /// \param translation_ \çopydoc Transform3D::translation
246 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
247 Transform3D(const components::Translation3D& translation_, bool from_parent = false)
248 : translation(translation_) {
249 if (from_parent) {
251 }
252 }
253
254 /// From a translation.
255 ///
256 /// \param translation \çopydoc Transform3D::translation
258 return Transform3D(translation, false);
259 }
260
261 /// From 3x3 matrix only.
262 ///
263 /// \param mat3x3_ \copydoc Transform3D::mat3x3
264 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
265 Transform3D(const components::TransformMat3x3& mat3x3_, bool from_parent = false)
266 : mat3x3(mat3x3_) {
267 if (from_parent) {
269 }
270 }
271
272 /// From 3x3 matrix only.
273 ///
274 /// \param mat3x3 \copydoc Transform3D::mat3x3
276 return Transform3D(mat3x3, false);
277 }
278
279 /// From 3x3 matrix provided as 3 columns only.
280 ///
281 /// \param columns Column vectors of 3x3 matrix.
282 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
283 Transform3D(const datatypes::Vec3D (&columns)[3], bool from_parent = false)
284 : Transform3D(components::TransformMat3x3(columns), from_parent) {}
285
286 /// From 3x3 matrix provided as 3 columns only.
287 ///
288 /// \param columns Column vectors of 3x3 matrix.
289 static Transform3D from_mat3x3(const datatypes::Vec3D (&columns)[3]) {
290 return Transform3D(components::TransformMat3x3(columns), false);
291 }
292
293 /// Creates a new 3D transform from translation/rotation/scale.
294 ///
295 /// \param translation_ \copydoc Transform3D::translation
296 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
297 /// \param scale_ \copydoc Transform3D::scale
298 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
300 const components::Translation3D& translation_, const Rotation3D& rotation,
301 const components::Scale3D& scale_, bool from_parent = false
302 )
303 : translation(translation_), scale(scale_) {
304 if (from_parent) {
306 }
307 set_rotation(rotation);
308 }
309
310 /// Creates a new 3D transform from translation/rotation/uniform-scale.
311 ///
312 /// \param translation_ \copydoc Transform3D::translation
313 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
314 /// \param uniform_scale Uniform scale factor that is applied to all axis equally.
315 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
316 ///
317 /// _Implementation note:_ This explicit overload prevents interpretation of the float as
318 /// bool, leading to a call to the wrong overload.
320 const components::Translation3D& translation_, const Rotation3D& rotation,
321 float uniform_scale, bool from_parent = false
322 )
323 : Transform3D(translation_, rotation, components::Scale3D(uniform_scale), from_parent) {
324 }
325
326 /// From a translation, applied after a rotation & scale, known as an affine transformation.
327 ///
328 /// \param translation \copydoc Transform3D::translation
329 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
330 /// \param scale \copydoc Transform3D::scale
332 const components::Translation3D& translation, const Rotation3D& rotation,
334 ) {
335 return Transform3D(translation, rotation, scale, false);
336 }
337
338 /// From a translation, applied after a rotation & scale, known as an affine transformation.
339 ///
340 /// \param translation \copydoc Transform3D::translation
341 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
342 /// \param uniform_scale Uniform scale factor that is applied to all axis equally.
344 const components::Translation3D& translation, const Rotation3D& rotation,
345 float uniform_scale
346 ) {
347 return Transform3D(translation, rotation, components::Scale3D(uniform_scale), false);
348 }
349
350 /// Creates a new rigid transform (translation & rotation only).
351 ///
352 /// \param translation_ \copydoc Transform3D::translation
353 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
354 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
356 const components::Translation3D& translation_, const Rotation3D& rotation,
357 bool from_parent = false
358 )
359 : translation(translation_) {
360 if (from_parent) {
362 }
363 set_rotation(rotation);
364 }
365
366 /// From a rotation & scale.
367 ///
368 /// \param translation \copydoc Transform3D::translation
369 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
371 const components::Translation3D& translation, const Rotation3D& rotation
372 ) {
373 return Transform3D(translation, rotation, false);
374 }
375
376 /// From translation & scale only.
377 ///
378 /// \param translation_ \copydoc Transform3D::translation
379 /// \param scale_ Transform3D::scale
380 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
382 const components::Translation3D& translation_, const components::Scale3D& scale_,
383 bool from_parent = false
384 )
385 : translation(translation_), scale(scale_) {
386 if (from_parent) {
388 }
389 }
390
391 /// From a translation applied after a scale.
392 ///
393 /// \param translation \copydoc Transform3D::translation
394 /// \param scale Transform3D::scale
397 ) {
398 return Transform3D(translation, scale, false);
399 }
400
401 /// From translation & uniform scale only.
402 ///
403 /// \param translation_ \copydoc Transform3D::translation
404 /// \param uniform_scale Uniform scale factor that is applied to all axis equally.
405 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
406 ///
407 /// _Implementation note:_ This explicit overload prevents interpretation of the float as
408 /// bool, leading to a call to the wrong overload.
410 const components::Translation3D& translation_, float uniform_scale,
411 bool from_parent = false
412 )
413 : Transform3D(translation_, components::Scale3D(uniform_scale), from_parent) {}
414
415 /// From rotation & scale.
416 ///
417 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
418 /// \param scale_ Transform3D::scale
419 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
421 const Rotation3D& rotation, const components::Scale3D& scale_, bool from_parent = false
422 )
423 : scale(scale_) {
424 if (from_parent) {
426 }
427 set_rotation(rotation);
428 }
429
430 /// From rotation & uniform scale.
431 ///
432 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
433 /// \param uniform_scale Uniform scale factor that is applied to all axis equally.
434 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
435 ///
436 /// _Implementation note:_ This explicit overload prevents interpretation of the float as
437 /// bool, leading to a call to the wrong overload.
438 Transform3D(const Rotation3D& rotation, float uniform_scale, bool from_parent = false)
439 : Transform3D(rotation, components::Scale3D(uniform_scale), from_parent) {}
440
441 /// From a rotation & scale.
442 ///
443 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
444 /// \param scale Transform3D::scale
446 const Rotation3D& rotation, const components::Scale3D& scale
447 ) {
448 return Transform3D(rotation, scale, false);
449 }
450
451 /// From a rotation & uniform scale.
452 ///
453 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
454 /// \param uniform_scale Uniform scale factor that is applied to all axis equally.
455 static Transform3D from_rotation_scale(const Rotation3D& rotation, float uniform_scale) {
456 return Transform3D(rotation, components::Scale3D(uniform_scale), false);
457 }
458
459 /// From rotation only.
460 ///
461 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
462 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
463 Transform3D(const Rotation3D& rotation, bool from_parent = false) {
464 if (from_parent) {
466 }
467 set_rotation(rotation);
468 }
469
470 /// From rotation only.
471 ///
472 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
473 static Transform3D from_rotation(const Rotation3D& rotation) {
474 return Transform3D(rotation, false);
475 }
476
477 /// From scale only.
478 ///
479 /// \param scale_ If true, the transform relation to `TransformRelation::ChildFromParent`.
480 /// \param from_parent \copydoc Transform3D::scale
481 Transform3D(const components::Scale3D& scale_, bool from_parent = false) : scale(scale_) {
482 if (from_parent) {
484 }
485 }
486
487 /// From scale only.
488 ///
489 /// \param scale Transform3D::scale
491 return Transform3D(scale, false);
492 }
493
494 /// From scale only.
495 ///
496 /// \param uniform_scale Uniform scale factor that is applied to all axis equally.
497 static Transform3D from_scale(float uniform_scale) {
498 return Transform3D(components::Scale3D(uniform_scale), false);
499 }
500
501 private:
502 /// Set the rotation component of the transform using the `rerun::Rotation3D` utility.
503 void set_rotation(const Rotation3D& rotation) {
504 if (rotation.axis_angle.has_value()) {
505 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(rotation_axis_angle =
506 rotation.axis_angle.value();)
507 }
508 if (rotation.quaternion.has_value()) {
509 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(quaternion = rotation.quaternion.value();)
510 }
511 }
512
513 // END of extensions from transform3d_ext.cpp, start of generated code:
514
515 public:
516 Transform3D() = default;
517 Transform3D(Transform3D&& other) = default;
518
519 /// Translation vector.
521 translation = std::move(_translation);
522 // See: https://github.com/rerun-io/rerun/issues/4027
523 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
524 }
525
526 /// Rotation via axis + angle.
528 rerun::components::RotationAxisAngle _rotation_axis_angle
529 ) && {
530 rotation_axis_angle = std::move(_rotation_axis_angle);
531 // See: https://github.com/rerun-io/rerun/issues/4027
532 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
533 }
534
535 /// Rotation via quaternion.
537 quaternion = std::move(_quaternion);
538 // See: https://github.com/rerun-io/rerun/issues/4027
539 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
540 }
541
542 /// Scaling factor.
544 scale = std::move(_scale);
545 // See: https://github.com/rerun-io/rerun/issues/4027
546 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
547 }
548
549 /// 3x3 transformation matrix.
551 mat3x3 = std::move(_mat3x3);
552 // See: https://github.com/rerun-io/rerun/issues/4027
553 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
554 }
555
556 /// Specifies the relation this transform establishes between this entity and its parent.
558 relation = std::move(_relation);
559 // See: https://github.com/rerun-io/rerun/issues/4027
560 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
561 }
562
563 /// Visual length of the 3 axes.
564 ///
565 /// The length is interpreted in the local coordinate system of the transform.
566 /// If the transform is scaled, the axes will be scaled accordingly.
568 axis_length = std::move(_axis_length);
569 // See: https://github.com/rerun-io/rerun/issues/4027
570 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
571 }
572 };
573
574} // namespace rerun::archetypes
575
576namespace rerun {
577 /// \private
578 template <typename T>
579 struct AsComponents;
580
581 /// \private
582 template <>
583 struct AsComponents<archetypes::Transform3D> {
584 /// Serialize all set component batches.
585 static Result<std::vector<ComponentBatch>> serialize(
586 const archetypes::Transform3D& archetype
587 );
588 };
589} // namespace rerun
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:22
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:153
static RERUN_SDK_EXPORT const Transform3D IDENTITY
Identity transformation.
Definition transform3d.hpp:189
std::optional< rerun::components::AxisLength > axis_length
Visual length of the 3 axes.
Definition transform3d.hpp:176
Transform3D(const datatypes::Vec3D(&columns)[3], bool from_parent=false)
From 3x3 matrix provided as 3 columns only.
Definition transform3d.hpp:283
Transform3D(const components::Translation3D &translation_, const components::TransformMat3x3 &mat3x3_, bool from_parent=false)
Creates a new 3D transform from translation/matrix.
Definition transform3d.hpp:210
std::optional< rerun::components::TransformMat3x3 > mat3x3
3x3 transformation matrix.
Definition transform3d.hpp:167
static Transform3D from_translation_scale(const components::Translation3D &translation, const components::Scale3D &scale)
From a translation applied after a scale.
Definition transform3d.hpp:395
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:319
Transform3D with_quaternion(rerun::components::RotationQuat _quaternion) &&
Rotation via quaternion.
Definition transform3d.hpp:536
std::optional< rerun::components::RotationQuat > quaternion
Rotation via quaternion.
Definition transform3d.hpp:161
static Transform3D from_mat3x3(const components::TransformMat3x3 &mat3x3)
From 3x3 matrix only.
Definition transform3d.hpp:275
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:299
Transform3D(const Rotation3D &rotation, float uniform_scale, bool from_parent=false)
From rotation & uniform scale.
Definition transform3d.hpp:438
Transform3D with_mat3x3(rerun::components::TransformMat3x3 _mat3x3) &&
3x3 transformation matrix.
Definition transform3d.hpp:550
Transform3D(const components::Translation3D &translation_, float uniform_scale, bool from_parent=false)
From translation & uniform scale only.
Definition transform3d.hpp:409
std::optional< rerun::components::TransformRelation > relation
Specifies the relation this transform establishes between this entity and its parent.
Definition transform3d.hpp:170
Transform3D with_axis_length(rerun::components::AxisLength _axis_length) &&
Visual length of the 3 axes.
Definition transform3d.hpp:567
Transform3D with_relation(rerun::components::TransformRelation _relation) &&
Specifies the relation this transform establishes between this entity and its parent.
Definition transform3d.hpp:557
std::optional< rerun::components::Translation3D > translation
Translation vector.
Definition transform3d.hpp:155
Transform3D(const components::Translation3D &translation_, const Rotation3D &rotation, bool from_parent=false)
Creates a new rigid transform (translation & rotation only).
Definition transform3d.hpp:355
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:199
Transform3D(const Rotation3D &rotation, bool from_parent=false)
From rotation only.
Definition transform3d.hpp:463
Transform3D(const components::TransformMat3x3 &mat3x3_, bool from_parent=false)
From 3x3 matrix only.
Definition transform3d.hpp:265
static Transform3D from_rotation_scale(const Rotation3D &rotation, float uniform_scale)
From a rotation & uniform scale.
Definition transform3d.hpp:455
static Transform3D from_translation_mat3x3(const components::Translation3D &translation, const components::TransformMat3x3 &mat3x3)
From a translation applied after a 3x3 matrix.
Definition transform3d.hpp:224
static Transform3D from_rotation_scale(const Rotation3D &rotation, const components::Scale3D &scale)
From a rotation & scale.
Definition transform3d.hpp:445
static Transform3D from_translation(const components::Translation3D &translation)
From a translation.
Definition transform3d.hpp:257
static Transform3D from_scale(float uniform_scale)
From scale only.
Definition transform3d.hpp:497
std::optional< rerun::components::Scale3D > scale
Scaling factor.
Definition transform3d.hpp:164
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:331
Transform3D with_rotation_axis_angle(rerun::components::RotationAxisAngle _rotation_axis_angle) &&
Rotation via axis + angle.
Definition transform3d.hpp:527
Transform3D(const components::Scale3D &scale_, bool from_parent=false)
From scale only.
Definition transform3d.hpp:481
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:234
static Transform3D from_translation_rotation(const components::Translation3D &translation, const Rotation3D &rotation)
From a rotation & scale.
Definition transform3d.hpp:370
Transform3D(const Rotation3D &rotation, const components::Scale3D &scale_, bool from_parent=false)
From rotation & scale.
Definition transform3d.hpp:420
Transform3D with_scale(rerun::components::Scale3D _scale) &&
Scaling factor.
Definition transform3d.hpp:543
Transform3D(const components::Translation3D &translation_, bool from_parent=false)
From translation only.
Definition transform3d.hpp:247
std::optional< rerun::components::RotationAxisAngle > rotation_axis_angle
Rotation via axis + angle.
Definition transform3d.hpp:158
Transform3D(const components::Translation3D &translation_, const components::Scale3D &scale_, bool from_parent=false)
From translation & scale only.
Definition transform3d.hpp:381
Transform3D with_translation(rerun::components::Translation3D _translation) &&
Translation vector.
Definition transform3d.hpp:520
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:343
static Transform3D from_scale(const components::Scale3D &scale)
From scale only.
Definition transform3d.hpp:490
static Transform3D from_mat3x3(const datatypes::Vec3D(&columns)[3])
From 3x3 matrix provided as 3 columns only.
Definition transform3d.hpp:289
static Transform3D from_rotation(const Rotation3D &rotation)
From rotation only.
Definition transform3d.hpp:473
Component: The length of an axis in local units of the space.
Definition axis_length.hpp:14
Indicator component used by archetypes when converting them to component lists.
Definition indicator_component.hpp:30
Component: 3D rotation represented by a rotation around a given axis.
Definition rotation_axis_angle.hpp:14
Component: A 3D rotation expressed as a quaternion.
Definition rotation_quat.hpp:17
Component: A 3D scale factor.
Definition scale3d.hpp:19
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