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

Archetype: One or more transforms applied on the current entity's transform frame. More...

#include <rerun/archetypes/instance_poses3d.hpp>

Public Member Functions

 InstancePoses3D (InstancePoses3D &&other)=default
 
 InstancePoses3D (const InstancePoses3D &other)=default
 
InstancePoses3Doperator= (const InstancePoses3D &other)=default
 
InstancePoses3Doperator= (InstancePoses3D &&other)=default
 
InstancePoses3D with_translations (const Collection< rerun::components::Translation3D > &_translations) &&
 Translation vectors.
 
InstancePoses3D with_rotation_axis_angles (const Collection< rerun::components::RotationAxisAngle > &_rotation_axis_angles) &&
 Rotations via axis + angle.
 
InstancePoses3D with_quaternions (const Collection< rerun::components::RotationQuat > &_quaternions) &&
 Rotations via quaternion.
 
InstancePoses3D with_scales (const Collection< rerun::components::Scale3D > &_scales) &&
 Scaling factors.
 
InstancePoses3D with_mat3x3 (const Collection< rerun::components::TransformMat3x3 > &_mat3x3) &&
 3x3 transformation matrices.
 
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 InstancePoses3D update_fields ()
 Update only some specific fields of a InstancePoses3D.
 
static InstancePoses3D clear_fields ()
 Clear all the fields of a InstancePoses3D.
 

Public Attributes

std::optional< ComponentBatchtranslations
 Translation vectors.
 
std::optional< ComponentBatchrotation_axis_angles
 Rotations via axis + angle.
 
std::optional< ComponentBatchquaternions
 Rotations via quaternion.
 
std::optional< ComponentBatchscales
 Scaling factors.
 
std::optional< ComponentBatchmat3x3
 3x3 transformation matrices.
 

Static Public Attributes

static constexpr const char ArchetypeName [] = "rerun.archetypes.InstancePoses3D"
 The name of the archetype as used in ComponentDescriptors.
 
static constexpr auto Descriptor_translations
 ComponentDescriptor for the translations field.
 
static constexpr auto Descriptor_rotation_axis_angles
 ComponentDescriptor for the rotation_axis_angles field.
 
static constexpr auto Descriptor_quaternions
 ComponentDescriptor for the quaternions field.
 
static constexpr auto Descriptor_scales
 ComponentDescriptor for the scales field.
 
static constexpr auto Descriptor_mat3x3
 ComponentDescriptor for the mat3x3 field.
 

Detailed Description

Archetype: One or more transforms applied on the current entity's transform frame.

Unlike archetypes::Transform3D, it is not propagated in the transform hierarchy. If archetypes::CoordinateFrame is specified, it acts relative to that coordinate frame, otherwise it is relative to the entity's implicit coordinate frame.

Whenever you log this archetype, the state of the resulting overall pose is fully reset to the new archetype. This means that if you first log a pose with only a translation, and then log one with only a rotation, it will be resolved to a pose with only a rotation. (This is unlike how we usually apply latest-at semantics on an archetype where we take the latest state of any component independently)

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 mat3x3 transform are present, the 3x3 matrix is applied first, followed by the translation.

Currently, many visualizers support only a single instance transform per entity. Check archetype documentations for details - if not otherwise specified, only the first instance transform is applied. Some visualizers like the mesh visualizer used for archetypes::Mesh3D, will draw an object for every pose, a behavior also known as "instancing".

Example

Regular & instance transforms in tandem

image

#include <rerun.hpp>
#include <rerun/demo_utils.hpp>
int main() {
const auto rec = rerun::RecordingStream("rerun_example_instance_pose3d_combined");
rec.set_time_sequence("frame", 0);
// Log a box and points further down in the hierarchy.
rec.log("world/box", rerun::Boxes3D::from_half_sizes({{1.0, 1.0, 1.0}}));
rec.log(
"world/box/points",
rerun::Points3D(rerun::demo::grid3d<rerun::Position3D, float>(-10.0f, 10.0f, 10))
);
for (int i = 0; i <180; ++i) {
rec.set_time_sequence("frame", i);
// Log a regular transform which affects both the box and the points.
rec.log(
"world/box",
rerun::Transform3D::from_rotation(rerun::RotationAxisAngle{
{0.0f, 0.0f, 1.0f},
rerun::Angle::degrees(static_cast<float>(i) * 2.0f)})
);
// Log an instance pose which affects only the box.
rec.log(
"world/box",
{{0.0f, 0.0f, std::abs(static_cast<float>(i) * 0.1f - 5.0f) - 5.0f}}
)
);
}
}
A RecordingStream handles everything related to logging data into Rerun.
Definition recording_stream.hpp:73
Archetype: One or more transforms applied on the current entity's transform frame.
Definition instance_poses3d.hpp:84
InstancePoses3D with_translations(const Collection< rerun::components::Translation3D > &_translations) &&
Translation vectors.
Definition instance_poses3d.hpp:146
Archetype: A 3D point cloud with positions and optional colors, radii, labels, etc.
Definition points3d.hpp:176
static Angle degrees(float degrees_)
New angle in degrees.
Definition angle.hpp:39
Datatype: 3D rotation represented by a rotation around a given axis.
Definition rotation_axis_angle.hpp:21

Member Function Documentation

◆ columns() [1/2]

Collection< ComponentColumn > rerun::archetypes::InstancePoses3D::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::InstancePoses3D::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

◆ Descriptor_translations

constexpr auto rerun::archetypes::InstancePoses3D::Descriptor_translations
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "InstancePoses3D:translations",
Loggable<rerun::components::Translation3D>::ComponentType
)
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition instance_poses3d.hpp:102

ComponentDescriptor for the translations field.

◆ Descriptor_rotation_axis_angles

constexpr auto rerun::archetypes::InstancePoses3D::Descriptor_rotation_axis_angles
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "InstancePoses3D:rotation_axis_angles",
Loggable<rerun::components::RotationAxisAngle>::ComponentType
)

ComponentDescriptor for the rotation_axis_angles field.

◆ Descriptor_quaternions

constexpr auto rerun::archetypes::InstancePoses3D::Descriptor_quaternions
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "InstancePoses3D:quaternions",
Loggable<rerun::components::RotationQuat>::ComponentType
)

ComponentDescriptor for the quaternions field.

◆ Descriptor_scales

constexpr auto rerun::archetypes::InstancePoses3D::Descriptor_scales
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "InstancePoses3D:scales",
Loggable<rerun::components::Scale3D>::ComponentType
)

ComponentDescriptor for the scales field.

◆ Descriptor_mat3x3

constexpr auto rerun::archetypes::InstancePoses3D::Descriptor_mat3x3
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "InstancePoses3D:mat3x3",
Loggable<rerun::components::TransformMat3x3>::ComponentType
)

ComponentDescriptor for the mat3x3 field.


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