CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
LibCarla
source
carla
geom
Velocity.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
/// Linear velocity in metres per second. Inherits the storage and arithmetic
15
/// of `Vector3D` while carrying unit semantics so consumers do not
16
/// accidentally mix `cm/s` and `m/s` payloads at API boundaries.
17
struct
Velocity
:
Vector3D
{
18
19
Velocity
() =
default
;
20
21
constexpr
Velocity
(
float
ix,
float
iy,
float
iz)
22
:
Vector3D
(ix, iy, iz) {
23
}
24
25
explicit
constexpr
Velocity
(
const
Vector3D
&v)
26
:
Vector3D
(v) {
27
}
28
29
#ifdef LIBCARLA_INCLUDED_FROM_UE4
30
31
/// Build a `Velocity` (m/s) from an Unreal `FVector` expressed in
32
/// centimetres per second.
33
explicit
Velocity
(
const
FVector &v_cm_per_s)
34
:
Vector3D
(
35
static_cast<float>(v_cm_per_s.X) * 1e-2f,
36
static_cast<float>(v_cm_per_s.Y) * 1e-2f,
37
static_cast<float>(v_cm_per_s.Z) * 1e-2f) {
38
}
39
40
/// Return this `Velocity` as an Unreal `FVector` in centimetres per
41
/// second.
42
FVector
ToFVectorCmPerSecond
()
const
{
43
return
FVector{
x
* 1e2f,
y
* 1e2f,
z
* 1e2f};
44
}
45
46
#endif
// LIBCARLA_INCLUDED_FROM_UE4
47
};
48
49
}
// namespace geom
50
}
// 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::Vector3D::y
float y
Definition
geom/Vector3D.h:27
carla::geom::Vector3D::x
float x
Definition
geom/Vector3D.h:25
carla::geom::Vector3D::z
float z
Definition
geom/Vector3D.h:29
carla::geom::Vector3D::Vector3D
Vector3D()=default
carla::geom::Velocity::Velocity
constexpr Velocity(const Vector3D &v)
Definition
Velocity.h:25
carla::geom::Velocity::Velocity
Velocity(const FVector &v_cm_per_s)
Build a Velocity (m/s) from an Unreal FVector expressed in centimetres per second.
Definition
Velocity.h:33
carla::geom::Velocity::Velocity
Velocity()=default
carla::geom::Velocity::Velocity
constexpr Velocity(float ix, float iy, float iz)
Definition
Velocity.h:21
carla::geom::Velocity::ToFVectorCmPerSecond
FVector ToFVectorCmPerSecond() const
Return this Velocity as an Unreal FVector in centimetres per second.
Definition
Velocity.h:42
Generated by
1.18.0