CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
LibCarla
source
carla
geom
RightHandedVector3D.h
Go to the documentation of this file.
1
// Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma
2
// de Barcelona (UAB).
3
//
4
// This work is licensed under the terms of the MIT license.
5
// For a copy, see <https://opensource.org/licenses/MIT>.
6
7
#pragma once
8
9
#include "
carla/geom/Vector3D.h
"
10
11
namespace
carla
{
12
namespace
geom
{
13
14
/// Internal adapter that holds a `Vector3D` in a right-handed coordinate
15
/// frame. CARLA / Unreal expose vectors in a left-handed frame; `Quaternion`
16
/// and `Rotation` work in right-handed math internally. The Y axis is
17
/// negated on construction and re-negated on conversion back, so the
18
/// handedness flip happens exactly once at the boundary.
19
struct
RightHandedVector3D
{
20
21
float
x
= 0.0f;
22
float
y
= 0.0f;
23
float
z
= 0.0f;
24
25
RightHandedVector3D
() =
default
;
26
27
constexpr
RightHandedVector3D
(
float
ix,
float
iy,
float
iz)
28
:
x
(ix),
29
y
(iy),
30
z
(iz) {
31
}
32
33
/// Implicit boundary conversion from a left-handed `Vector3D`. Negates
34
/// the Y component so internal math runs right-handed.
35
constexpr
RightHandedVector3D
(
const
Vector3D
&v)
36
:
x
(v.
x
),
37
y
(-v.
y
),
38
z
(v.
z
) {
39
}
40
41
/// Implicit boundary conversion back to a left-handed `Vector3D`.
42
constexpr
operator
Vector3D
()
const
{
43
return
Vector3D
(
x
, -
y
,
z
);
44
}
45
};
46
47
}
// namespace geom
48
}
// namespace carla
Vector3D.h
carla::geom
Definition
Misc.h:24
carla
This file contains definitions of common data structures used in traffic manager.
Definition
SignComponent.h:21
carla::geom::RightHandedVector3D::RightHandedVector3D
constexpr RightHandedVector3D(float ix, float iy, float iz)
Definition
RightHandedVector3D.h:27
carla::geom::RightHandedVector3D::y
float y
Definition
RightHandedVector3D.h:22
carla::geom::RightHandedVector3D::RightHandedVector3D
constexpr RightHandedVector3D(const Vector3D &v)
Implicit boundary conversion from a left-handed Vector3D.
Definition
RightHandedVector3D.h:35
carla::geom::RightHandedVector3D::x
float x
Definition
RightHandedVector3D.h:21
carla::geom::RightHandedVector3D::RightHandedVector3D
RightHandedVector3D()=default
carla::geom::RightHandedVector3D::z
float z
Definition
RightHandedVector3D.h:23
carla::geom::Vector3D
Definition
geom/Vector3D.h:17
carla::geom::Vector3D::Vector3D
Vector3D()=default
Generated by
1.18.0