Rerun C++ SDK
Loading...
Searching...
No Matches
rerun::archetypes::Transform3D Struct Reference

Archetype: A transform between two 3D spaces, i.e. More...

#include <rerun/archetypes/transform3d.hpp>

Public Types

using IndicatorComponent = rerun::components::IndicatorComponent< IndicatorComponentName >
 Indicator component, used to identify the archetype when converting to a list of components.
 

Public Member Functions

 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.
 
 Transform3D (const components::Translation3D &translation_, const components::TransformMat3x3 &mat3x3_, bool from_parent=false)
 Creates a new 3D transform from translation/matrix.
 
 Transform3D (const components::Translation3D &translation_, bool from_parent=false)
 From translation only.
 
 Transform3D (const components::TransformMat3x3 &mat3x3_, bool from_parent=false)
 From 3x3 matrix only.
 
 Transform3D (const datatypes::Vec3D(&columns)[3], bool from_parent=false)
 From 3x3 matrix provided as 3 columns only.
 
 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.
 
 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.
 
 Transform3D (const components::Translation3D &translation_, const Rotation3D &rotation, bool from_parent=false)
 Creates a new rigid transform (translation & rotation only).
 
 Transform3D (const components::Translation3D &translation_, const components::Scale3D &scale_, bool from_parent=false)
 From translation & scale only.
 
 Transform3D (const components::Translation3D &translation_, float uniform_scale, bool from_parent=false)
 From translation & uniform scale only.
 
 Transform3D (const Rotation3D &rotation, const components::Scale3D &scale_, bool from_parent=false)
 From rotation & scale.
 
 Transform3D (const Rotation3D &rotation, float uniform_scale, bool from_parent=false)
 From rotation & uniform scale.
 
 Transform3D (const Rotation3D &rotation, bool from_parent=false)
 From rotation only.
 
 Transform3D (const components::Scale3D &scale_, bool from_parent=false)
 From scale only.
 
Transform3D with_rotation (const Rotation3D &rotation) &&
 Set the rotation component of the transform using the rerun::Rotation3D utility.
 
 Transform3D (Transform3D &&other)=default
 
 Transform3D (const Transform3D &other)=default
 
Transform3Doperator= (const Transform3D &other)=default
 
Transform3Doperator= (Transform3D &&other)=default
 
Transform3D with_translation (const rerun::components::Translation3D &_translation) &&
 Translation vector.
 
Transform3D with_many_translation (const Collection< rerun::components::Translation3D > &_translation) &&
 This method makes it possible to pack multiple translation in a single component batch.
 
Transform3D with_rotation_axis_angle (const rerun::components::RotationAxisAngle &_rotation_axis_angle) &&
 Rotation via axis + angle.
 
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.
 
Transform3D with_quaternion (const rerun::components::RotationQuat &_quaternion) &&
 Rotation via quaternion.
 
Transform3D with_many_quaternion (const Collection< rerun::components::RotationQuat > &_quaternion) &&
 This method makes it possible to pack multiple quaternion in a single component batch.
 
Transform3D with_scale (const rerun::components::Scale3D &_scale) &&
 Scaling factor.
 
Transform3D with_many_scale (const Collection< rerun::components::Scale3D > &_scale) &&
 This method makes it possible to pack multiple scale in a single component batch.
 
Transform3D with_mat3x3 (const rerun::components::TransformMat3x3 &_mat3x3) &&
 3x3 transformation matrix.
 
Transform3D with_many_mat3x3 (const Collection< rerun::components::TransformMat3x3 > &_mat3x3) &&
 This method makes it possible to pack multiple mat3x3 in a single component batch.
 
Transform3D with_relation (const rerun::components::TransformRelation &_relation) &&
 Specifies the relation this transform establishes between this entity and its parent.
 
Transform3D with_many_relation (const Collection< rerun::components::TransformRelation > &_relation) &&
 This method makes it possible to pack multiple relation in a single component batch.
 
Transform3D with_axis_length (const rerun::components::AxisLength &_axis_length) &&
 Visual length of the 3 axes.
 
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.
 
Collection< ComponentColumncolumns (const Collection< uint32_t > &lengths_)
 Partitions the component data into multiple sub-batches.
 
Collection< ComponentColumncolumns ()
 Partitions the component data into unit-length sub-batches.
 

Static Public Member Functions

static Transform3D from_translation_mat3x3 (const components::Translation3D &translation, const components::TransformMat3x3 &mat3x3)
 From a translation applied after a 3x3 matrix.
 
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.
 
static Transform3D from_translation (const components::Translation3D &translation)
 From a translation.
 
static Transform3D from_mat3x3 (const components::TransformMat3x3 &mat3x3)
 From 3x3 matrix only.
 
static Transform3D from_mat3x3 (const datatypes::Vec3D(&columns)[3])
 From 3x3 matrix provided as 3 columns only.
 
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.
 
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.
 
static Transform3D from_translation_rotation (const components::Translation3D &translation, const Rotation3D &rotation)
 From a rotation & scale.
 
static Transform3D from_translation_scale (const components::Translation3D &translation, const components::Scale3D &scale)
 From a translation applied after a scale.
 
static Transform3D from_rotation_scale (const Rotation3D &rotation, const components::Scale3D &scale)
 From a rotation & scale.
 
static Transform3D from_rotation_scale (const Rotation3D &rotation, float uniform_scale)
 From a rotation & uniform scale.
 
static Transform3D from_rotation (const Rotation3D &rotation)
 From rotation only.
 
static Transform3D from_scale (const components::Scale3D &scale)
 From scale only.
 
static Transform3D from_scale (float uniform_scale)
 From scale only.
 
static Transform3D update_fields ()
 Update only some specific fields of a Transform3D.
 
static Transform3D clear_fields ()
 Clear all the fields of a Transform3D.
 

Public Attributes

std::optional< ComponentBatchtranslation
 Translation vector.
 
std::optional< ComponentBatchrotation_axis_angle
 Rotation via axis + angle.
 
std::optional< ComponentBatchquaternion
 Rotation via quaternion.
 
std::optional< ComponentBatchscale
 Scaling factor.
 
std::optional< ComponentBatchmat3x3
 3x3 transformation matrix.
 
std::optional< ComponentBatchrelation
 Specifies the relation this transform establishes between this entity and its parent.
 
std::optional< ComponentBatchaxis_length
 Visual length of the 3 axes.
 

Static Public Attributes

static constexpr const char IndicatorComponentName []
 
static constexpr const char ArchetypeName [] = "rerun.archetypes.Transform3D"
 The name of the archetype as used in ComponentDescriptors.
 
static constexpr auto Descriptor_translation
 ComponentDescriptor for the translation field.
 
static constexpr auto Descriptor_rotation_axis_angle
 ComponentDescriptor for the rotation_axis_angle field.
 
static constexpr auto Descriptor_quaternion
 ComponentDescriptor for the quaternion field.
 
static constexpr auto Descriptor_scale
 ComponentDescriptor for the scale field.
 
static constexpr auto Descriptor_mat3x3
 ComponentDescriptor for the mat3x3 field.
 
static constexpr auto Descriptor_relation
 ComponentDescriptor for the relation field.
 
static constexpr auto Descriptor_axis_length
 ComponentDescriptor for the axis_length field.
 
static RERUN_SDK_EXPORT const Transform3D IDENTITY
 Identity transformation.
 
static RERUN_SDK_EXPORT const Transform3D INVALID
 Invalid transformation.
 

Detailed Description

Archetype: A transform between two 3D spaces, i.e.

a pose.

From the point of view of the entity's coordinate system, all components are applied in the inverse order they are listed here. E.g. if both a translation and a max3x3 transform are present, the 3x3 matrix is applied first, followed by the translation.

Whenever you log this archetype, it will write all components, even if you do not explicitly set them. This means that if you first log a transform with only a translation, and then log one with only a rotation, it will be resolved to a transform with only a rotation.

For transforms that affect only a single entity and do not propagate along the entity tree refer to archetypes::InstancePoses3D.

Examples

Variety of 3D transforms

image

#include <rerun.hpp>
constexpr float TAU = 6.28318530717958647692528676655900577f;
int main() {
const auto rec = rerun::RecordingStream("rerun_example_transform3d");
rec.spawn().exit_on_failure();
auto arrow =
rerun::Arrows3D::from_vectors({{0.0f, 1.0f, 0.0f}}).with_origins({{0.0f, 0.0f, 0.0f}});
rec.log("base", arrow);
rec.log("base/translated", rerun::Transform3D::from_translation({1.0f, 0.0f, 0.0f}));
rec.log("base/translated", arrow);
rec.log(
"base/rotated_scaled",
rerun::Transform3D::from_rotation_scale(
rerun::RotationAxisAngle({0.0f, 0.0f, 1.0f}, rerun::Angle::radians(TAU / 8.0f)),
2.0f
)
);
rec.log("base/rotated_scaled", arrow);
}
A RecordingStream handles everything related to logging data into Rerun.
Definition recording_stream.hpp:60
static Angle radians(float radians_)
New angle in radians.
Definition angle.hpp:31
Datatype: 3D rotation represented by a rotation around a given axis.
Definition rotation_axis_angle.hpp:22

Transform hierarchy

image

#include <rerun.hpp>
constexpr float TAU = 6.28318530717958647692528676655900577f;
int main() {
const auto rec = rerun::RecordingStream("rerun_example_transform3d_hierarchy");
rec.spawn().exit_on_failure();
// TODO(#5521): log two views as in the python example
rec.set_time_duration_secs("sim_time", 0.0);
// Planetary motion is typically in the XY plane.
rec.log_static("/", rerun::ViewCoordinates::RIGHT_HAND_Z_UP);
// Setup points, all are in the center of their own space:
rec.log(
"sun",
rerun::Points3D({{0.0f, 0.0f, 0.0f}})
.with_radii({1.0f})
.with_colors({rerun::Color(255, 200, 10)})
);
rec.log(
"sun/planet",
rerun::Points3D({{0.0f, 0.0f, 0.0f}})
.with_radii({0.4f})
.with_colors({rerun::Color(40, 80, 200)})
);
rec.log(
"sun/planet/moon",
rerun::Points3D({{0.0f, 0.0f, 0.0f}})
.with_radii({0.15f})
.with_colors({rerun::Color(180, 180, 180)})
);
// Draw fixed paths where the planet & moon move.
float d_planet = 6.0f;
float d_moon = 3.0f;
std::vector<std::array<float, 3>> planet_path, moon_path;
for (int i = 0; i <= 100; i++) {
float angle = static_cast<float>(i) * 0.01f * TAU;
float circle_x = std::sin(angle);
float circle_y = std::cos(angle);
planet_path.push_back({circle_x * d_planet, circle_y * d_planet, 0.0f});
moon_path.push_back({circle_x * d_moon, circle_y * d_moon, 0.0f});
}
rec.log("sun/planet_path", rerun::LineStrips3D(rerun::LineStrip3D(planet_path)));
rec.log("sun/planet/moon_path", rerun::LineStrips3D(rerun::LineStrip3D(moon_path)));
// Movement via transforms.
for (int i = 0; i <6 * 120; i++) {
float time = static_cast<float>(i) / 120.0f;
rec.set_time_duration_secs("sim_time", time);
float r_moon = time * 5.0f;
float r_planet = time * 2.0f;
rec.log(
"sun/planet",
rerun::Transform3D::from_translation_rotation(
{std::sin(r_planet) * d_planet, std::cos(r_planet) * d_planet, 0.0f},
{1.0, 0.0f, 0.0f},
}
)
);
rec.log(
"sun/planet/moon",
rerun::Transform3D::from_translation(
{std::cos(r_moon) * d_moon, std::sin(r_moon) * d_moon, 0.0f}
)
);
}
}
@ ChildFromParent
The transform describes how to transform into the child entity's space.
Archetype: 3D line strips with positions and optional colors, radii, labels, etc.
Definition line_strips3d.hpp:103
Archetype: A 3D point cloud with positions and optional colors, radii, labels, etc.
Definition points3d.hpp:175
Transform3D with_relation(const rerun::components::TransformRelation &_relation) &&
Specifies the relation this transform establishes between this entity and its parent.
Definition transform3d.hpp:853
Component: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition color.hpp:18
Component: A line strip in 3D space.
Definition line_strip3d.hpp:34
static Angle degrees(float degrees_)
New angle in degrees.
Definition angle.hpp:40

Update a transform over time

image

#include <rerun.hpp>
float truncated_radians(int deg) {
auto degf = static_cast<float>(deg);
const auto pi = 3.14159265358979323846f;
return static_cast<float>(static_cast<int>(degf * pi / 180.0f * 1000.0f)) / 1000.0f;
}
int main() {
const auto rec = rerun::RecordingStream("rerun_example_transform3d_row_updates");
rec.spawn().exit_on_failure();
rec.set_time_sequence("tick", 0);
rec.log(
"box",
rerun::Boxes3D::from_half_sizes({{4.f, 2.f, 1.0f}}).with_fill_mode(rerun::FillMode::Solid),
);
for (int t = 0; t <100; t++) {
rec.set_time_sequence("tick", t + 1);
rec.log(
"box",
.with_translation({0.0f, 0.0f, static_cast<float>(t) / 10.0f})
{0.0f, 1.0f, 0.0f},
rerun::Angle::radians(truncated_radians(t * 4))
))
);
}
}
Archetype: A transform between two 3D spaces, i.e.
Definition transform3d.hpp:303
Transform3D with_translation(const rerun::components::Translation3D &_translation) &&
Translation vector.
Definition transform3d.hpp:761
Transform3D with_axis_length(const rerun::components::AxisLength &_axis_length) &&
Visual length of the 3 axes.
Definition transform3d.hpp:875
Transform3D with_rotation_axis_angle(const rerun::components::RotationAxisAngle &_rotation_axis_angle) &&
Rotation via axis + angle.
Definition transform3d.hpp:780

Update a transform over time, in a single operation

image

#include <cmath>
#include <numeric>
#include <vector>
#include <rerun.hpp>
float truncated_radians(int deg) {
auto degf = static_cast<float>(deg);
const auto pi = 3.14159265358979323846f;
return static_cast<float>(static_cast<int>(degf * pi / 180.0f * 1000.0f)) / 1000.0f;
}
int main() {
const auto rec = rerun::RecordingStream("rerun_example_transform3d_column_updates");
rec.spawn().exit_on_failure();
rec.set_time_sequence("tick", 0);
rec.log(
"box",
rerun::Boxes3D::from_half_sizes({{4.f, 2.f, 1.0f}}).with_fill_mode(rerun::FillMode::Solid),
);
std::vector<std::array<float, 3>> translations;
std::vector<rerun::RotationAxisAngle> rotations;
for (int t = 0; t <100; t++) {
translations.push_back({0.0f, 0.0f, static_cast<float>(t) / 10.0f});
rotations.push_back(rerun::RotationAxisAngle(
{0.0f, 1.0f, 0.0f},
rerun::Angle::radians(truncated_radians(t * 4))
));
}
std::vector<int64_t> ticks(100);
std::iota(ticks.begin(), ticks.end(), 1);
rec.send_columns(
"box",
.with_many_translation(translations)
);
}
static TimeColumn from_sequence(std::string timeline_name, Collection< int64_t > sequence_points, SortingStatus sorting_status=SortingStatus::Unknown)
Creates a column from an array of sequence points, e.g.
Definition time_column.hpp:92
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:793
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
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:771

Update specific properties of a transform over time

image

#include <rerun.hpp>
float truncated_radians(int deg) {
auto degf = static_cast<float>(deg);
const auto pi = 3.14159265358979323846f;
return static_cast<float>(static_cast<int>(degf * pi / 180.0f * 1000.0f)) / 1000.0f;
}
int main() {
const auto rec = rerun::RecordingStream("rerun_example_transform3d_partial_updates");
rec.spawn().exit_on_failure();
// Set up a 3D box.
rec.log(
"box",
rerun::Boxes3D::from_half_sizes({{4.f, 2.f, 1.0f}}).with_fill_mode(rerun::FillMode::Solid),
);
// Update only the rotation of the box.
for (int deg = 0; deg <= 45; deg++) {
auto rad = truncated_radians(deg * 4);
rec.log(
"box",
rerun::Transform3D::update_fields().with_rotation_axis_angle(
)
);
}
// Update only the position of the box.
for (int t = 0; t <= 50; t++) {
rec.log(
"box",
rerun::Transform3D::update_fields().with_translation(
{0.0f, 0.0f, static_cast<float>(t) / 10.0f}
)
);
}
// Update only the rotation of the box.
for (int deg = 0; deg <= 45; deg++) {
auto rad = truncated_radians((deg + 45) * 4);
rec.log(
"box",
rerun::Transform3D::update_fields().with_rotation_axis_angle(
)
);
}
// Clear all of the box's attributes, and reset its axis length.
rec.log("box", rerun::Transform3D::clear_fields().with_axis_length(15.0));
}

Constructor & Destructor Documentation

◆ Transform3D() [1/14]

rerun::archetypes::Transform3D::Transform3D ( const components::Translation3D translation_,
const datatypes::Vec3D(&)  columns[3],
bool  from_parent = false 
)
inline

Creates a new 3D transform from translation and matrix provided as 3 columns.

Clears out all other components like Transform3D::clear_fields.

Parameters
translation_\çopydoc Transform3D::translation
columnsColumn vectors of 3x3 matrix.
from_parentIf true, the transform relation to TransformRelation::ChildFromParent.

Implementation note: This overload is necessary, otherwise the array may be interpreted as bool and call the wrong overload.

◆ Transform3D() [2/14]

rerun::archetypes::Transform3D::Transform3D ( const components::Translation3D translation_,
const components::TransformMat3x3 mat3x3_,
bool  from_parent = false 
)
inline

Creates a new 3D transform from translation/matrix.

Clears out all other components like Transform3D::clear_fields.

Parameters
translation_\çopydoc Transform3D::translation
mat3x3_3x3 transformation matrix.
from_parentIf true, the transform relation to TransformRelation::ChildFromParent.

◆ Transform3D() [3/14]

rerun::archetypes::Transform3D::Transform3D ( const components::Translation3D translation_,
bool  from_parent = false 
)
inline

From translation only.

Clears out all other components like Transform3D::clear_fields.

Parameters
translation_\çopydoc Transform3D::translation
from_parentIf true, the transform relation to TransformRelation::ChildFromParent.

◆ Transform3D() [4/14]

rerun::archetypes::Transform3D::Transform3D ( const components::TransformMat3x3 mat3x3_,
bool  from_parent = false 
)
inline

From 3x3 matrix only.

Clears out all other components like Transform3D::clear_fields.

Parameters
mat3x3_3x3 transformation matrix.
from_parentIf true, the transform relation to TransformRelation::ChildFromParent.

◆ Transform3D() [5/14]

rerun::archetypes::Transform3D::Transform3D ( const datatypes::Vec3D(&)  columns[3],
bool  from_parent = false 
)
inline

From 3x3 matrix provided as 3 columns only.

Clears out all other components like Transform3D::clear_fields.

Parameters
columnsColumn vectors of 3x3 matrix.
from_parentIf true, the transform relation to TransformRelation::ChildFromParent.

◆ Transform3D() [6/14]

rerun::archetypes::Transform3D::Transform3D ( const components::Translation3D translation_,
const Rotation3D rotation,
const components::Scale3D scale_,
bool  from_parent = false 
)
inline

Creates a new 3D transform from translation/rotation/scale.

Clears out all other components like Transform3D::clear_fields.

Parameters
translation_Translation vector.
rotationRotation represented either as a quaternion or axis + angle rotation.
scale_Scaling factor.
from_parentIf true, the transform relation to TransformRelation::ChildFromParent.

◆ Transform3D() [7/14]

rerun::archetypes::Transform3D::Transform3D ( const components::Translation3D translation_,
const Rotation3D rotation,
float  uniform_scale,
bool  from_parent = false 
)
inline

Creates a new 3D transform from translation/rotation/uniform-scale.

Clears out all other components like Transform3D::clear_fields.

Parameters
translation_Translation vector.
rotationRotation represented either as a quaternion or axis + angle rotation.
uniform_scaleUniform scale factor that is applied to all axis equally.
from_parentIf true, the transform relation to TransformRelation::ChildFromParent.

Implementation note: This explicit overload prevents interpretation of the float as bool, leading to a call to the wrong overload.

◆ Transform3D() [8/14]

rerun::archetypes::Transform3D::Transform3D ( const components::Translation3D translation_,
const Rotation3D rotation,
bool  from_parent = false 
)
inline

Creates a new rigid transform (translation & rotation only).

Clears out all other components like Transform3D::clear_fields.

Parameters
translation_Translation vector.
rotationRotation represented either as a quaternion or axis + angle rotation.
from_parentIf true, the transform relation to TransformRelation::ChildFromParent.

◆ Transform3D() [9/14]

rerun::archetypes::Transform3D::Transform3D ( const components::Translation3D translation_,
const components::Scale3D scale_,
bool  from_parent = false 
)
inline

From translation & scale only.

Clears out all other components like Transform3D::clear_fields.

Parameters
translation_Translation vector.
scale_Transform3D::scale
from_parentIf true, the transform relation to TransformRelation::ChildFromParent.

◆ Transform3D() [10/14]

rerun::archetypes::Transform3D::Transform3D ( const components::Translation3D translation_,
float  uniform_scale,
bool  from_parent = false 
)
inline

From translation & uniform scale only.

Clears out all other components like Transform3D::clear_fields.

Parameters
translation_Translation vector.
uniform_scaleUniform scale factor that is applied to all axis equally.
from_parentIf true, the transform relation to TransformRelation::ChildFromParent.

Implementation note: This explicit overload prevents interpretation of the float as bool, leading to a call to the wrong overload.

◆ Transform3D() [11/14]

rerun::archetypes::Transform3D::Transform3D ( const Rotation3D rotation,
const components::Scale3D scale_,
bool  from_parent = false 
)
inline

From rotation & scale.

Clears out all other components like Transform3D::clear_fields.

Parameters
rotationRotation represented either as a quaternion or axis + angle rotation.
scale_Transform3D::scale
from_parentIf true, the transform relation to TransformRelation::ChildFromParent.

◆ Transform3D() [12/14]

rerun::archetypes::Transform3D::Transform3D ( const Rotation3D rotation,
float  uniform_scale,
bool  from_parent = false 
)
inline

From rotation & uniform scale.

Clears out all other components like Transform3D::clear_fields.

Parameters
rotationRotation represented either as a quaternion or axis + angle rotation.
uniform_scaleUniform scale factor that is applied to all axis equally.
from_parentIf true, the transform relation to TransformRelation::ChildFromParent.

Implementation note: This explicit overload prevents interpretation of the float as bool, leading to a call to the wrong overload.

◆ Transform3D() [13/14]

rerun::archetypes::Transform3D::Transform3D ( const Rotation3D rotation,
bool  from_parent = false 
)
inline

From rotation only.

Clears out all other components like Transform3D::clear_fields.

Parameters
rotationRotation represented either as a quaternion or axis + angle rotation.
from_parentIf true, the transform relation to TransformRelation::ChildFromParent.

◆ Transform3D() [14/14]

rerun::archetypes::Transform3D::Transform3D ( const components::Scale3D scale_,
bool  from_parent = false 
)
inline

From scale only.

Clears out all other components like Transform3D::clear_fields.

Parameters
scale_If true, the transform relation to TransformRelation::ChildFromParent.
from_parentScaling factor.

Member Function Documentation

◆ from_translation_mat3x3() [1/2]

static Transform3D rerun::archetypes::Transform3D::from_translation_mat3x3 ( const components::Translation3D translation,
const components::TransformMat3x3 mat3x3 
)
inlinestatic

From a translation applied after a 3x3 matrix.

Clears out all other components like Transform3D::clear_fields.

Parameters
translation\çopydoc Transform3D::translation
mat3x33x3 transformation matrix.

◆ from_translation_mat3x3() [2/2]

static Transform3D rerun::archetypes::Transform3D::from_translation_mat3x3 ( const components::Translation3D translation,
const datatypes::Vec3D(&)  columns[3] 
)
inlinestatic

From a translation applied after a 3x3 matrix provided as 3 columns.

Clears out all other components like Transform3D::clear_fields.

Parameters
translation\çopydoc Transform3D::translation
columnsColumn vectors of 3x3 matrix.

◆ from_translation()

static Transform3D rerun::archetypes::Transform3D::from_translation ( const components::Translation3D translation)
inlinestatic

From a translation.

Clears out all other components like Transform3D::clear_fields.

Parameters
translation\çopydoc Transform3D::translation

◆ from_mat3x3() [1/2]

static Transform3D rerun::archetypes::Transform3D::from_mat3x3 ( const components::TransformMat3x3 mat3x3)
inlinestatic

From 3x3 matrix only.

Clears out all other components like Transform3D::clear_fields.

Parameters
mat3x33x3 transformation matrix.

◆ from_mat3x3() [2/2]

static Transform3D rerun::archetypes::Transform3D::from_mat3x3 ( const datatypes::Vec3D(&)  columns[3])
inlinestatic

From 3x3 matrix provided as 3 columns only.

Clears out all other components like Transform3D::clear_fields.

Parameters
columnsColumn vectors of 3x3 matrix.

◆ from_translation_rotation_scale() [1/2]

static Transform3D rerun::archetypes::Transform3D::from_translation_rotation_scale ( const components::Translation3D translation,
const Rotation3D rotation,
const components::Scale3D scale 
)
inlinestatic

From a translation, applied after a rotation & scale, known as an affine transformation.

Clears out all other components like Transform3D::clear_fields.

Parameters
translationTranslation vector.
rotationRotation represented either as a quaternion or axis + angle rotation.
scaleScaling factor.

◆ from_translation_rotation_scale() [2/2]

static Transform3D rerun::archetypes::Transform3D::from_translation_rotation_scale ( const components::Translation3D translation,
const Rotation3D rotation,
float  uniform_scale 
)
inlinestatic

From a translation, applied after a rotation & scale, known as an affine transformation.

Clears out all other components like Transform3D::clear_fields.

Parameters
translationTranslation vector.
rotationRotation represented either as a quaternion or axis + angle rotation.
uniform_scaleUniform scale factor that is applied to all axis equally.

◆ from_translation_rotation()

static Transform3D rerun::archetypes::Transform3D::from_translation_rotation ( const components::Translation3D translation,
const Rotation3D rotation 
)
inlinestatic

From a rotation & scale.

Clears out all other components like Transform3D::clear_fields.

Parameters
translationTranslation vector.
rotationRotation represented either as a quaternion or axis + angle rotation.

◆ from_translation_scale()

static Transform3D rerun::archetypes::Transform3D::from_translation_scale ( const components::Translation3D translation,
const components::Scale3D scale 
)
inlinestatic

From a translation applied after a scale.

Clears out all other components like Transform3D::clear_fields.

Parameters
translationTranslation vector.
scaleTransform3D::scale

◆ from_rotation_scale() [1/2]

static Transform3D rerun::archetypes::Transform3D::from_rotation_scale ( const Rotation3D rotation,
const components::Scale3D scale 
)
inlinestatic

From a rotation & scale.

Clears out all other components like Transform3D::clear_fields.

Parameters
rotationRotation represented either as a quaternion or axis + angle rotation.
scaleTransform3D::scale

◆ from_rotation_scale() [2/2]

static Transform3D rerun::archetypes::Transform3D::from_rotation_scale ( const Rotation3D rotation,
float  uniform_scale 
)
inlinestatic

From a rotation & uniform scale.

Clears out all other components like Transform3D::clear_fields.

Parameters
rotationRotation represented either as a quaternion or axis + angle rotation.
uniform_scaleUniform scale factor that is applied to all axis equally.

◆ from_rotation()

static Transform3D rerun::archetypes::Transform3D::from_rotation ( const Rotation3D rotation)
inlinestatic

From rotation only.

Clears out all other components like Transform3D::clear_fields.

Parameters
rotationRotation represented either as a quaternion or axis + angle rotation.

◆ from_scale() [1/2]

static Transform3D rerun::archetypes::Transform3D::from_scale ( const components::Scale3D scale)
inlinestatic

From scale only.

Clears out all other components like Transform3D::clear_fields.

Parameters
scaleTransform3D::scale

◆ from_scale() [2/2]

static Transform3D rerun::archetypes::Transform3D::from_scale ( float  uniform_scale)
inlinestatic

From scale only.

Clears out all other components like Transform3D::clear_fields.

Parameters
uniform_scaleUniform scale factor that is applied to all axis equally.

◆ with_many_translation()

Transform3D rerun::archetypes::Transform3D::with_many_translation ( const Collection< rerun::components::Translation3D > &  _translation) &&
inline

This method makes it possible to pack multiple translation in a single component batch.

This only makes sense when used in conjunction with columns. with_translation should be used when logging a single row's worth of data.

◆ with_many_rotation_axis_angle()

Transform3D rerun::archetypes::Transform3D::with_many_rotation_axis_angle ( const Collection< rerun::components::RotationAxisAngle > &  _rotation_axis_angle) &&
inline

This method makes it possible to pack multiple rotation_axis_angle in a single component batch.

This only makes sense when used in conjunction with columns. with_rotation_axis_angle should be used when logging a single row's worth of data.

◆ with_many_quaternion()

Transform3D rerun::archetypes::Transform3D::with_many_quaternion ( const Collection< rerun::components::RotationQuat > &  _quaternion) &&
inline

This method makes it possible to pack multiple quaternion in a single component batch.

This only makes sense when used in conjunction with columns. with_quaternion should be used when logging a single row's worth of data.

◆ with_many_scale()

Transform3D rerun::archetypes::Transform3D::with_many_scale ( const Collection< rerun::components::Scale3D > &  _scale) &&
inline

This method makes it possible to pack multiple scale in a single component batch.

This only makes sense when used in conjunction with columns. with_scale should be used when logging a single row's worth of data.

◆ with_many_mat3x3()

Transform3D rerun::archetypes::Transform3D::with_many_mat3x3 ( const Collection< rerun::components::TransformMat3x3 > &  _mat3x3) &&
inline

This method makes it possible to pack multiple mat3x3 in a single component batch.

This only makes sense when used in conjunction with columns. with_mat3x3 should be used when logging a single row's worth of data.

◆ with_many_relation()

Transform3D rerun::archetypes::Transform3D::with_many_relation ( const Collection< rerun::components::TransformRelation > &  _relation) &&
inline

This method makes it possible to pack multiple relation in a single component batch.

This only makes sense when used in conjunction with columns. with_relation should be used when logging a single row's worth of data.

◆ with_axis_length()

Transform3D rerun::archetypes::Transform3D::with_axis_length ( const rerun::components::AxisLength _axis_length) &&
inline

Visual length of the 3 axes.

The length is interpreted in the local coordinate system of the transform. If the transform is scaled, the axes will be scaled accordingly.

◆ with_many_axis_length()

Transform3D rerun::archetypes::Transform3D::with_many_axis_length ( const Collection< rerun::components::AxisLength > &  _axis_length) &&
inline

This method makes it possible to pack multiple axis_length in a single component batch.

This only makes sense when used in conjunction with columns. with_axis_length should be used when logging a single row's worth of data.

◆ columns() [1/2]

Collection< ComponentColumn > rerun::archetypes::Transform3D::columns ( const Collection< uint32_t > &  lengths_)

Partitions the component data into multiple sub-batches.

Specifically, this transforms the existing ComponentBatch data into ComponentColumns instead, via ComponentBatch::partitioned.

This makes it possible to use RecordingStream::send_columns to send columnar data directly into Rerun.

The specified lengths must sum to the total length of the component batch.

◆ columns() [2/2]

Collection< ComponentColumn > rerun::archetypes::Transform3D::columns ( )

Partitions the component data into unit-length sub-batches.

This is semantically similar to calling columns with std::vector<uint32_t>(n, 1), where n is automatically guessed.

Member Data Documentation

◆ axis_length

std::optional<ComponentBatch> rerun::archetypes::Transform3D::axis_length

Visual length of the 3 axes.

The length is interpreted in the local coordinate system of the transform. If the transform is scaled, the axes will be scaled accordingly.

◆ IndicatorComponentName

constexpr const char rerun::archetypes::Transform3D::IndicatorComponentName[]
staticconstexpr
Initial value:
=
"rerun.components.Transform3DIndicator"

◆ Descriptor_translation

constexpr auto rerun::archetypes::Transform3D::Descriptor_translation
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "translation",
Loggable<rerun::components::Translation3D>::Descriptor.component_name
)
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition transform3d.hpp:335

ComponentDescriptor for the translation field.

◆ Descriptor_rotation_axis_angle

constexpr auto rerun::archetypes::Transform3D::Descriptor_rotation_axis_angle
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "rotation_axis_angle",
Loggable<rerun::components::RotationAxisAngle>::Descriptor.component_name
)

ComponentDescriptor for the rotation_axis_angle field.

◆ Descriptor_quaternion

constexpr auto rerun::archetypes::Transform3D::Descriptor_quaternion
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "quaternion",
Loggable<rerun::components::RotationQuat>::Descriptor.component_name
)

ComponentDescriptor for the quaternion field.

◆ Descriptor_scale

constexpr auto rerun::archetypes::Transform3D::Descriptor_scale
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "scale", Loggable<rerun::components::Scale3D>::Descriptor.component_name
)

ComponentDescriptor for the scale field.

◆ Descriptor_mat3x3

constexpr auto rerun::archetypes::Transform3D::Descriptor_mat3x3
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "mat3x3",
Loggable<rerun::components::TransformMat3x3>::Descriptor.component_name
)

ComponentDescriptor for the mat3x3 field.

◆ Descriptor_relation

constexpr auto rerun::archetypes::Transform3D::Descriptor_relation
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "relation",
Loggable<rerun::components::TransformRelation>::Descriptor.component_name
)

ComponentDescriptor for the relation field.

◆ Descriptor_axis_length

constexpr auto rerun::archetypes::Transform3D::Descriptor_axis_length
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "axis_length",
Loggable<rerun::components::AxisLength>::Descriptor.component_name
)

ComponentDescriptor for the axis_length field.

◆ IDENTITY

RERUN_SDK_EXPORT const Transform3D rerun::archetypes::Transform3D::IDENTITY
static

Identity transformation.

Applying this transform does not alter an entity's transformation.

◆ INVALID

RERUN_SDK_EXPORT const Transform3D rerun::archetypes::Transform3D::INVALID
static

Invalid transformation.

Applying this transform will cause this entity and the entire subtree not to be visualized.


The documentation for this struct was generated from the following file: