CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
LibCarla
source
test
common
test_vector3D.cpp
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
#include "
test.h
"
8
9
#include <
carla/geom/Vector3D.h
>
10
#include <
carla/geom/Math.h
>
11
12
using namespace
carla::geom
;
13
14
TEST
(vector3D, make_unit_vec) {
15
ASSERT_EQ(
Vector3D
(10,0,0).MakeUnitVector(),
Vector3D
(1,0,0));
16
ASSERT_NE(
Vector3D
(10,0,0).MakeUnitVector(),
Vector3D
(0,1,0));
17
ASSERT_EQ(
Vector3D
(0,10,0).MakeUnitVector(),
Vector3D
(0,1,0));
18
ASSERT_EQ(
Vector3D
(0,0,512).MakeUnitVector(),
Vector3D
(0,0,1));
19
ASSERT_NE(
Vector3D
(0,1,512).MakeUnitVector(),
Vector3D
(0,0,1));
20
21
// The following test is to check that the MakeUnitVector doesn't fail on zero-length vectors
22
ASSERT_EQ(
Vector3D
().MakeUnitVector(),
Vector3D
(0,0,0));
23
}
Math.h
Vector3D.h
carla::geom
Definition
Misc.h:24
carla::geom::Vector3D::Vector3D
Vector3D()=default
test.h
TEST
TEST(agents_types, road_option_values_match_python)
Definition
test_agents.cpp:40
Generated by
1.18.0