CARLA
Loading...
Searching...
No Matches
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
10
11namespace carla {
12namespace 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.
20
21 float x = 0.0f;
22 float y = 0.0f;
23 float z = 0.0f;
24
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
This file contains definitions of common data structures used in traffic manager.
Internal adapter that holds a Vector3D in a right-handed coordinate frame.
constexpr RightHandedVector3D(float ix, float iy, float iz)
constexpr RightHandedVector3D(const Vector3D &v)
Implicit boundary conversion from a left-handed Vector3D.