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

Archetype: A 3D transform. 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 datatypes::TranslationAndMat3x3 &translation_and_mat3x3)
 New 3D transform from translation/matrix datatype.
 
 Transform3D (const datatypes::Vec3D &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 datatypes::Vec3D &translation, const datatypes::Mat3x3 &matrix, bool from_parent=false)
 Creates a new 3D transform from translation/matrix.
 
 Transform3D (const datatypes::Vec3D &translation, bool from_parent=false)
 From translation only.
 
 Transform3D (const datatypes::Mat3x3 &matrix, 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 datatypes::TranslationRotationScale3D &translation_rotation_scale3d)
 New 3D transform from translation/rotation/scale datatype.
 
 Transform3D (const datatypes::Vec3D &translation, const datatypes::Rotation3D &rotation, const datatypes::Scale3D &scale, bool from_parent=false)
 Creates a new 3D transform from translation/rotation/scale.
 
 Transform3D (const datatypes::Vec3D &translation, const datatypes::Rotation3D &rotation, float uniform_scale, bool from_parent=false)
 Creates a new 3D transform from translation/rotation/uniform-scale.
 
 Transform3D (const datatypes::Vec3D &translation, const datatypes::Rotation3D &rotation, bool from_parent=false)
 Creates a new rigid transform (translation & rotation only).
 
 Transform3D (const datatypes::Vec3D &translation, const datatypes::Scale3D &scale, bool from_parent=false)
 From translation & scale only.
 
 Transform3D (const datatypes::Vec3D &translation, float uniform_scale, bool from_parent=false)
 From translation & uniform scale only.
 
 Transform3D (const datatypes::Rotation3D &rotation, const datatypes::Scale3D &scale, bool from_parent=false)
 From rotation & scale.
 
 Transform3D (const datatypes::Rotation3D &rotation, float uniform_scale, bool from_parent=false)
 From rotation & uniform scale.
 
 Transform3D (const datatypes::Rotation3D &rotation, bool from_parent=false)
 From rotation only.
 
 Transform3D (const datatypes::Scale3D &scale, bool from_parent=false)
 From scale only.
 
 Transform3D (Transform3D &&other)=default
 
 Transform3D (rerun::components::Transform3D _transform)
 

Public Attributes

rerun::components::Transform3D transform
 The transform.
 

Static Public Attributes

static constexpr const char IndicatorComponentName []
 
static RERUN_SDK_EXPORT const Transform3D IDENTITY
 Identity transformation.
 

Detailed Description

Archetype: A 3D transform.

Example

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({1.0f, 0.0f, 0.0f}));
rec.log("base/translated", arrow);
rec.log(
"base/rotated_scaled",
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:57
Archetype: A 3D transform.
Definition transform3d.hpp:52
static Angle radians(float radians)
Angle in radians. One turn is equal to 2π (or τ) radians.
Definition angle.hpp:88
Datatype: 3D rotation represented by a rotation around a given axis.
Definition rotation_axis_angle.hpp:21

Constructor & Destructor Documentation

◆ Transform3D() [1/16]

rerun::archetypes::Transform3D::Transform3D ( const datatypes::TranslationAndMat3x3 translation_and_mat3x3)
inline

New 3D transform from translation/matrix datatype.

Parameters
translation_and_mat3x3Combined translation/matrix.

◆ Transform3D() [2/16]

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

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

Parameters
translation\çopydoc datatypes::TranslationAndMat3x3::translation
columnsColumn vectors of 3x3 matrix.
from_parentIf true, this transform is from the parent space to the space where the transform was logged.

If false (default), the transform maps from this space to its parent, i.e. the translation is the position in the parent space.

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

◆ Transform3D() [3/16]

rerun::archetypes::Transform3D::Transform3D ( const datatypes::Vec3D translation,
const datatypes::Mat3x3 matrix,
bool  from_parent = false 
)
inline

Creates a new 3D transform from translation/matrix.

Parameters
translation\çopydoc datatypes::TranslationAndMat3x3::translation
matrix3x3 matrix for scale, rotation & shear.
from_parentIf true, this transform is from the parent space to the space where the transform was logged.

If false (default), the transform maps from this space to its parent, i.e. the translation is the position in the parent space.

◆ Transform3D() [4/16]

rerun::archetypes::Transform3D::Transform3D ( const datatypes::Vec3D translation,
bool  from_parent = false 
)
inline

From translation only.

Parameters
translation\çopydoc datatypes::TranslationRotationScale3D::translation
from_parentIf true, this transform is from the parent space to the space where the transform was logged.

If false (default), the transform maps from this space to its parent, i.e. the translation is the position in the parent space.

◆ Transform3D() [5/16]

rerun::archetypes::Transform3D::Transform3D ( const datatypes::Mat3x3 matrix,
bool  from_parent = false 
)
inline

From 3x3 matrix only.

Parameters
matrix3x3 matrix for scale, rotation & shear.
from_parentIf true, this transform is from the parent space to the space where the transform was logged.

If false (default), the transform maps from this space to its parent, i.e. the translation is the position in the parent space.

◆ Transform3D() [6/16]

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

From 3x3 matrix provided as 3 columns only.

Parameters
columnsColumn vectors of 3x3 matrix.
from_parentIf true, this transform is from the parent space to the space where the transform was logged.

If false (default), the transform maps from this space to its parent, i.e. the translation is the position in the parent space.

◆ Transform3D() [7/16]

rerun::archetypes::Transform3D::Transform3D ( const datatypes::TranslationRotationScale3D translation_rotation_scale3d)
inline

New 3D transform from translation/rotation/scale datatype.

Parameters
translation_rotation_scale3dCombined translation/rotation/scale.

◆ Transform3D() [8/16]

rerun::archetypes::Transform3D::Transform3D ( const datatypes::Vec3D translation,
const datatypes::Rotation3D rotation,
const datatypes::Scale3D scale,
bool  from_parent = false 
)
inline

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

Parameters
translation3D translation vector, applied last.
rotation3D rotation, applied second.
scale3D scale, applied first.
from_parentIf true, this transform is from the parent space to the space where the transform was logged.

If false (default), the transform maps from this space to its parent, i.e. the translation is the position in the parent space.

◆ Transform3D() [9/16]

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

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

Parameters
translation3D translation vector, applied last.
rotation3D rotation, applied second.
uniform_scaleUniform scale factor that is applied to all axis equally.
from_parentIf true, this transform is from the parent space to the space where the transform was logged.

If false (default), the transform maps from this space to its parent, i.e. the translation is the position in the parent space.

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

◆ Transform3D() [10/16]

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

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

Parameters
translation3D translation vector, applied last.
rotation3D rotation, applied second.
from_parentIf true, this transform is from the parent space to the space where the transform was logged.

If false (default), the transform maps from this space to its parent, i.e. the translation is the position in the parent space.

◆ Transform3D() [11/16]

rerun::archetypes::Transform3D::Transform3D ( const datatypes::Vec3D translation,
const datatypes::Scale3D scale,
bool  from_parent = false 
)
inline

From translation & scale only.

Parameters
translation3D translation vector, applied last.
scaledatatypes::TranslationRotationScale3D::scale
from_parentIf true, this transform is from the parent space to the space where the transform was logged.

If false (default), the transform maps from this space to its parent, i.e. the translation is the position in the parent space.

◆ Transform3D() [12/16]

rerun::archetypes::Transform3D::Transform3D ( const datatypes::Vec3D translation,
float  uniform_scale,
bool  from_parent = false 
)
inline

From translation & uniform scale only.

Parameters
translation3D translation vector, applied last.
uniform_scaleUniform scale factor that is applied to all axis equally.
from_parentIf true, this transform is from the parent space to the space where the transform was logged.

If false (default), the transform maps from this space to its parent, i.e. the translation is the position in the parent space.

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

◆ Transform3D() [13/16]

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

From rotation & scale.

Parameters
rotation3D rotation, applied second.
scaledatatypes::TranslationRotationScale3D::scale
from_parentIf true, this transform is from the parent space to the space where the transform was logged.

If false (default), the transform maps from this space to its parent, i.e. the translation is the position in the parent space.

◆ Transform3D() [14/16]

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

From rotation & uniform scale.

Parameters
rotation3D rotation, applied second.
uniform_scaleUniform scale factor that is applied to all axis equally.
from_parentIf true, this transform is from the parent space to the space where the transform was logged.

If false (default), the transform maps from this space to its parent, i.e. the translation is the position in the parent space.

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

◆ Transform3D() [15/16]

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

From rotation only.

Parameters
rotation3D rotation, applied second.
from_parentIf true, this transform is from the parent space to the space where the transform was logged.

If false (default), the transform maps from this space to its parent, i.e. the translation is the position in the parent space.

◆ Transform3D() [16/16]

rerun::archetypes::Transform3D::Transform3D ( const datatypes::Scale3D scale,
bool  from_parent = false 
)
inline

From scale only.

Parameters
scaleIf true, this transform is from the parent space to the space where the transform was logged.

If false (default), the transform maps from this space to its parent, i.e. the translation is the position in the parent space.

Parameters
from_parent3D scale, applied first.

Member Data Documentation

◆ IndicatorComponentName

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

◆ IDENTITY

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

Identity transformation.

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


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