CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
LibCarla
source
carla
geom
Acceleration.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 acceleration in metres per second squared. Inherits `Vector3D`
15
/// storage and arithmetic and carries unit semantics so consumers do not
16
/// silently mix `cm/s^2` and `m/s^2` payloads at API boundaries.
17
struct
Acceleration
:
Vector3D
{
18
19
Acceleration
() =
default
;
20
21
constexpr
Acceleration
(
float
ix,
float
iy,
float
iz)
22
:
Vector3D
(ix, iy, iz) {
23
}
24
25
explicit
constexpr
Acceleration
(
const
Vector3D
&v)
26
:
Vector3D
(v) {
27
}
28
29
#ifdef LIBCARLA_INCLUDED_FROM_UE4
30
31
/// Build an `Acceleration` (m/s^2) from an Unreal `FVector` expressed in
32
/// centimetres per second squared.
33
explicit
Acceleration
(
const
FVector &a_cm_per_s2)
34
:
Vector3D
(
35
static_cast<float>(a_cm_per_s2.X) * 1e-2f,
36
static_cast<float>(a_cm_per_s2.Y) * 1e-2f,
37
static_cast<float>(a_cm_per_s2.Z) * 1e-2f) {
38
}
39
40
/// Return this `Acceleration` as an Unreal `FVector` in centimetres per
41
/// second squared.
42
FVector
ToFVectorCmPerSecondSquared
()
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::Acceleration::Acceleration
constexpr Acceleration(const Vector3D &v)
Definition
Acceleration.h:25
carla::geom::Acceleration::Acceleration
Acceleration(const FVector &a_cm_per_s2)
Build an Acceleration (m/s^2) from an Unreal FVector expressed in centimetres per second squared.
Definition
Acceleration.h:33
carla::geom::Acceleration::Acceleration
constexpr Acceleration(float ix, float iy, float iz)
Definition
Acceleration.h:21
carla::geom::Acceleration::ToFVectorCmPerSecondSquared
FVector ToFVectorCmPerSecondSquared() const
Return this Acceleration as an Unreal FVector in centimetres per second squared.
Definition
Acceleration.h:42
carla::geom::Acceleration::Acceleration
Acceleration()=default
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
Generated by
1.18.0