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