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 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 /// Invalid transformation.
192 ///
193 /// Applying this transform will cause this entity and the entire subtree not to be visualized.
194 RERUN_SDK_EXPORT static const Transform3D INVALID;
195
196 /// Creates a new 3D transform from translation and matrix provided as 3 columns.
197 ///
198 /// \param translation_ \çopydoc Transform3D::translation
199 /// \param columns Column vectors of 3x3 matrix.
200 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
201 ///
202 /// _Implementation note:_ This overload is necessary, otherwise the array may be
203 /// interpreted as bool and call the wrong overload.
205 const components::Translation3D& translation_, const datatypes::Vec3D (&columns)[3],
206 bool from_parent = false
207 )
208 : Transform3D(translation_, components::TransformMat3x3(columns), from_parent) {}
209
210 /// Creates a new 3D transform from translation/matrix.
211 ///
212 /// \param translation_ \çopydoc Transform3D::translation
213 /// \param mat3x3_ \copydoc Transform3D::mat3x3
214 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
216 const components::Translation3D& translation_,
217 const components::TransformMat3x3& mat3x3_, bool from_parent = false
218 )
219 : translation(translation_), mat3x3(mat3x3_) {
220 if (from_parent) {
222 }
223 }
224
225 /// From a translation applied after a 3x3 matrix.
226 ///
227 /// \param translation \çopydoc Transform3D::translation
228 /// \param mat3x3 \copydoc Transform3D::mat3x3
231 ) {
232 return Transform3D(translation, mat3x3, false);
233 }
234
235 /// From a translation applied after a 3x3 matrix provided as 3 columns.
236 ///
237 /// \param translation \çopydoc Transform3D::translation
238 /// \param columns Column vectors of 3x3 matrix.
240 const components::Translation3D& translation, const datatypes::Vec3D (&columns)[3]
241 ) {
245 );
246 }
247
248 /// From translation only.
249 ///
250 /// \param translation_ \çopydoc Transform3D::translation
251 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
252 Transform3D(const components::Translation3D& translation_, bool from_parent = false)
253 : translation(translation_) {
254 if (from_parent) {
256 }
257 }
258
259 /// From a translation.
260 ///
261 /// \param translation \çopydoc Transform3D::translation
263 return Transform3D(translation, false);
264 }
265
266 /// From 3x3 matrix only.
267 ///
268 /// \param mat3x3_ \copydoc Transform3D::mat3x3
269 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
270 Transform3D(const components::TransformMat3x3& mat3x3_, bool from_parent = false)
271 : mat3x3(mat3x3_) {
272 if (from_parent) {
274 }
275 }
276
277 /// From 3x3 matrix only.
278 ///
279 /// \param mat3x3 \copydoc Transform3D::mat3x3
281 return Transform3D(mat3x3, false);
282 }
283
284 /// From 3x3 matrix provided as 3 columns only.
285 ///
286 /// \param columns Column vectors of 3x3 matrix.
287 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
288 Transform3D(const datatypes::Vec3D (&columns)[3], bool from_parent = false)
289 : Transform3D(components::TransformMat3x3(columns), from_parent) {}
290
291 /// From 3x3 matrix provided as 3 columns only.
292 ///
293 /// \param columns Column vectors of 3x3 matrix.
294 static Transform3D from_mat3x3(const datatypes::Vec3D (&columns)[3]) {
295 return Transform3D(components::TransformMat3x3(columns), false);
296 }
297
298 /// Creates a new 3D transform from translation/rotation/scale.
299 ///
300 /// \param translation_ \copydoc Transform3D::translation
301 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
302 /// \param scale_ \copydoc Transform3D::scale
303 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
305 const components::Translation3D& translation_, const Rotation3D& rotation,
306 const components::Scale3D& scale_, bool from_parent = false
307 )
308 : translation(translation_), scale(scale_) {
309 if (from_parent) {
311 }
312 set_rotation(rotation);
313 }
314
315 /// Creates a new 3D transform from translation/rotation/uniform-scale.
316 ///
317 /// \param translation_ \copydoc Transform3D::translation
318 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
319 /// \param uniform_scale Uniform scale factor that is applied to all axis equally.
320 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
321 ///
322 /// _Implementation note:_ This explicit overload prevents interpretation of the float as
323 /// bool, leading to a call to the wrong overload.
325 const components::Translation3D& translation_, const Rotation3D& rotation,
326 float uniform_scale, bool from_parent = false
327 )
328 : Transform3D(translation_, rotation, components::Scale3D(uniform_scale), from_parent) {
329 }
330
331 /// From a translation, applied after a rotation & scale, known as an affine transformation.
332 ///
333 /// \param translation \copydoc Transform3D::translation
334 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
335 /// \param scale \copydoc Transform3D::scale
337 const components::Translation3D& translation, const Rotation3D& rotation,
339 ) {
340 return Transform3D(translation, rotation, scale, false);
341 }
342
343 /// From a translation, applied after a rotation & scale, known as an affine transformation.
344 ///
345 /// \param translation \copydoc Transform3D::translation
346 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
347 /// \param uniform_scale Uniform scale factor that is applied to all axis equally.
349 const components::Translation3D& translation, const Rotation3D& rotation,
350 float uniform_scale
351 ) {
352 return Transform3D(translation, rotation, components::Scale3D(uniform_scale), false);
353 }
354
355 /// Creates a new rigid transform (translation & rotation only).
356 ///
357 /// \param translation_ \copydoc Transform3D::translation
358 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
359 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
361 const components::Translation3D& translation_, const Rotation3D& rotation,
362 bool from_parent = false
363 )
364 : translation(translation_) {
365 if (from_parent) {
367 }
368 set_rotation(rotation);
369 }
370
371 /// From a rotation & scale.
372 ///
373 /// \param translation \copydoc Transform3D::translation
374 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
376 const components::Translation3D& translation, const Rotation3D& rotation
377 ) {
378 return Transform3D(translation, rotation, false);
379 }
380
381 /// From translation & scale only.
382 ///
383 /// \param translation_ \copydoc Transform3D::translation
384 /// \param scale_ Transform3D::scale
385 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
387 const components::Translation3D& translation_, const components::Scale3D& scale_,
388 bool from_parent = false
389 )
390 : translation(translation_), scale(scale_) {
391 if (from_parent) {
393 }
394 }
395
396 /// From a translation applied after a scale.
397 ///
398 /// \param translation \copydoc Transform3D::translation
399 /// \param scale Transform3D::scale
402 ) {
403 return Transform3D(translation, scale, false);
404 }
405
406 /// From translation & uniform scale only.
407 ///
408 /// \param translation_ \copydoc Transform3D::translation
409 /// \param uniform_scale Uniform scale factor that is applied to all axis equally.
410 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
411 ///
412 /// _Implementation note:_ This explicit overload prevents interpretation of the float as
413 /// bool, leading to a call to the wrong overload.
415 const components::Translation3D& translation_, float uniform_scale,
416 bool from_parent = false
417 )
418 : Transform3D(translation_, components::Scale3D(uniform_scale), from_parent) {}
419
420 /// From rotation & scale.
421 ///
422 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
423 /// \param scale_ Transform3D::scale
424 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
426 const Rotation3D& rotation, const components::Scale3D& scale_, bool from_parent = false
427 )
428 : scale(scale_) {
429 if (from_parent) {
431 }
432 set_rotation(rotation);
433 }
434
435 /// From rotation & uniform scale.
436 ///
437 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
438 /// \param uniform_scale Uniform scale factor that is applied to all axis equally.
439 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
440 ///
441 /// _Implementation note:_ This explicit overload prevents interpretation of the float as
442 /// bool, leading to a call to the wrong overload.
443 Transform3D(const Rotation3D& rotation, float uniform_scale, bool from_parent = false)
444 : Transform3D(rotation, components::Scale3D(uniform_scale), from_parent) {}
445
446 /// From a rotation & scale.
447 ///
448 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
449 /// \param scale Transform3D::scale
451 const Rotation3D& rotation, const components::Scale3D& scale
452 ) {
453 return Transform3D(rotation, scale, false);
454 }
455
456 /// From a rotation & uniform scale.
457 ///
458 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
459 /// \param uniform_scale Uniform scale factor that is applied to all axis equally.
460 static Transform3D from_rotation_scale(const Rotation3D& rotation, float uniform_scale) {
461 return Transform3D(rotation, components::Scale3D(uniform_scale), false);
462 }
463
464 /// From rotation only.
465 ///
466 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
467 /// \param from_parent If true, the transform relation to `TransformRelation::ChildFromParent`.
468 Transform3D(const Rotation3D& rotation, bool from_parent = false) {
469 if (from_parent) {
471 }
472 set_rotation(rotation);
473 }
474
475 /// From rotation only.
476 ///
477 /// \param rotation Rotation represented either as a quaternion or axis + angle rotation.
478 static Transform3D from_rotation(const Rotation3D& rotation) {
479 return Transform3D(rotation, false);
480 }
481
482 /// From scale only.
483 ///
484 /// \param scale_ If true, the transform relation to `TransformRelation::ChildFromParent`.
485 /// \param from_parent \copydoc Transform3D::scale
486 Transform3D(const components::Scale3D& scale_, bool from_parent = false) : scale(scale_) {
487 if (from_parent) {
489 }
490 }
491
492 /// From scale only.
493 ///
494 /// \param scale Transform3D::scale
496 return Transform3D(scale, false);
497 }
498
499 /// From scale only.
500 ///
501 /// \param uniform_scale Uniform scale factor that is applied to all axis equally.
502 static Transform3D from_scale(float uniform_scale) {
503 return Transform3D(components::Scale3D(uniform_scale), false);
504 }
505
506 private:
507 /// Set the rotation component of the transform using the `rerun::Rotation3D` utility.
508 void set_rotation(const Rotation3D& rotation) {
509 if (rotation.axis_angle.has_value()) {
510 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(rotation_axis_angle =
511 rotation.axis_angle.value();)
512 }
513 if (rotation.quaternion.has_value()) {
514 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(quaternion = rotation.quaternion.value();)
515 }
516 }
517
518 // END of extensions from transform3d_ext.cpp, start of generated code:
519
520 public:
521 Transform3D() = default;
522 Transform3D(Transform3D&& other) = default;
523
524 /// Translation vector.
526 translation = std::move(_translation);
527 // See: https://github.com/rerun-io/rerun/issues/4027
528 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
529 }
530
531 /// Rotation via axis + angle.
533 rerun::components::RotationAxisAngle _rotation_axis_angle
534 ) && {
535 rotation_axis_angle = std::move(_rotation_axis_angle);
536 // See: https://github.com/rerun-io/rerun/issues/4027
537 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
538 }
539
540 /// Rotation via quaternion.
542 quaternion = std::move(_quaternion);
543 // See: https://github.com/rerun-io/rerun/issues/4027
544 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
545 }
546
547 /// Scaling factor.
549 scale = std::move(_scale);
550 // See: https://github.com/rerun-io/rerun/issues/4027
551 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
552 }
553
554 /// 3x3 transformation matrix.
556 mat3x3 = std::move(_mat3x3);
557 // See: https://github.com/rerun-io/rerun/issues/4027
558 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
559 }
560
561 /// Specifies the relation this transform establishes between this entity and its parent.
563 relation = std::move(_relation);
564 // See: https://github.com/rerun-io/rerun/issues/4027
565 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
566 }
567
568 /// Visual length of the 3 axes.
569 ///
570 /// The length is interpreted in the local coordinate system of the transform.
571 /// If the transform is scaled, the axes will be scaled accordingly.
573 axis_length = std::move(_axis_length);
574 // See: https://github.com/rerun-io/rerun/issues/4027
575 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
576 }
577 };
578
579} // namespace rerun::archetypes
580
581namespace rerun {
582 /// \private
583 template <typename T>
584 struct AsComponents;
585
586 /// \private
587 template <>
588 struct AsComponents<archetypes::Transform3D> {
589 /// Serialize all set component batches.
590 static Result<std::vector<ComponentBatch>> serialize(
591 const archetypes::Transform3D& archetype
592 );
593 };
594} // namespace rerun
All built-in archetypes. See Types in the Rerun manual.
Definition rerun.hpp:77
TransformRelation
Component: Specifies relation a spatial transform describes.
Definition transform_relation.hpp:25
@ 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
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:288
Transform3D(const components::Translation3D &translation_, const components::TransformMat3x3 &mat3x3_, bool from_parent=false)
Creates a new 3D transform from translation/matrix.
Definition transform3d.hpp:215
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:400
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:324
Transform3D with_quaternion(rerun::components::RotationQuat _quaternion) &&
Rotation via quaternion.
Definition transform3d.hpp:541
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:280
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:304
Transform3D(const Rotation3D &rotation, float uniform_scale, bool from_parent=false)
From rotation & uniform scale.
Definition transform3d.hpp:443
Transform3D with_mat3x3(rerun::components::TransformMat3x3 _mat3x3) &&
3x3 transformation matrix.
Definition transform3d.hpp:555
Transform3D(const components::Translation3D &translation_, float uniform_scale, bool from_parent=false)
From translation & uniform scale only.
Definition transform3d.hpp:414
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:572
Transform3D with_relation(rerun::components::TransformRelation _relation) &&
Specifies the relation this transform establishes between this entity and its parent.
Definition transform3d.hpp:562
std::optional< rerun::components::Translation3D > translation
Translation vector.
Definition transform3d.hpp:155
static RERUN_SDK_EXPORT const Transform3D INVALID
Invalid transformation.
Definition transform3d.hpp:194
Transform3D(const components::Translation3D &translation_, const Rotation3D &rotation, bool from_parent=false)
Creates a new rigid transform (translation & rotation only).
Definition transform3d.hpp:360
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:204
Transform3D(const Rotation3D &rotation, bool from_parent=false)
From rotation only.
Definition transform3d.hpp:468
Transform3D(const components::TransformMat3x3 &mat3x3_, bool from_parent=false)
From 3x3 matrix only.
Definition transform3d.hpp:270
static Transform3D from_rotation_scale(const Rotation3D &rotation, float uniform_scale)
From a rotation & uniform scale.
Definition transform3d.hpp:460
static Transform3D from_translation_mat3x3(const components::Translation3D &translation, const components::TransformMat3x3 &mat3x3)
From a translation applied after a 3x3 matrix.
Definition transform3d.hpp:229
static Transform3D from_rotation_scale(const Rotation3D &rotation, const components::Scale3D &scale)
From a rotation & scale.
Definition transform3d.hpp:450
static Transform3D from_translation(const components::Translation3D &translation)
From a translation.
Definition transform3d.hpp:262
static Transform3D from_scale(float uniform_scale)
From scale only.
Definition transform3d.hpp:502
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:336
Transform3D with_rotation_axis_angle(rerun::components::RotationAxisAngle _rotation_axis_angle) &&
Rotation via axis + angle.
Definition transform3d.hpp:532
Transform3D(const components::Scale3D &scale_, bool from_parent=false)
From scale only.
Definition transform3d.hpp:486
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:239
static Transform3D from_translation_rotation(const components::Translation3D &translation, const Rotation3D &rotation)
From a rotation & scale.
Definition transform3d.hpp:375
Transform3D(const Rotation3D &rotation, const components::Scale3D &scale_, bool from_parent=false)
From rotation & scale.
Definition transform3d.hpp:425
Transform3D with_scale(rerun::components::Scale3D _scale) &&
Scaling factor.
Definition transform3d.hpp:548
Transform3D(const components::Translation3D &translation_, bool from_parent=false)
From translation only.
Definition transform3d.hpp:252
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:386
Transform3D with_translation(rerun::components::Translation3D _translation) &&
Translation vector.
Definition transform3d.hpp:525
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:348
static Transform3D from_scale(const components::Scale3D &scale)
From scale only.
Definition transform3d.hpp:495
static Transform3D from_mat3x3(const datatypes::Vec3D(&columns)[3])
From 3x3 matrix provided as 3 columns only.
Definition transform3d.hpp:294
static Transform3D from_rotation(const Rotation3D &rotation)
From rotation only.
Definition transform3d.hpp:478
Component: The length of an axis in local units of the space.
Definition axis_length.hpp:15
Indicator component used by archetypes when converting them to component lists.
Definition indicator_component.hpp:32
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:19
Component: A 3D scale factor.
Definition scale3d.hpp:20
Component: A 3x3 transformation matrix Matrix.
Definition transform_mat3x3.hpp:28
Component: A translation vector in 3D space.
Definition translation3d.hpp:16
Datatype: A vector in 3D space.
Definition vec3d.hpp:21