CARLA
Loading...
Searching...
No Matches
carla::geom::Location Struct Reference

#include <Location.h>

Inheritance diagram for carla::geom::Location:

Public Member Functions

auto Distance (Location loc) const
constexpr auto DistanceSquared (Location loc) const
 Location ()=default
 Location (const FVector &vector)
 Location (Vector3D rhs)
constexpr Location (Vector3DInt rhs)
 operator FVector () const
constexpr Location & operator+= (Location rhs)
constexpr Location & operator-= (Location rhs)
constexpr RightHandedVector3D ToRightHanded () const
 This location expressed in a right-handed, x-forward / y-**left** / z-up frame (ROS REP-103 "FLU"): (x, -y, z).
 Vector3D ()=default
 Vector3D (const FVector &v)=delete
 These 2 methods are explicitly deleted to avoid creating them by other users, unlike locations, some vectors have units and some don't, by removing these methods we found several places were the conversion from cm to m was missing.
constexpr Vector3D (float ix, float iy, float iz)
Public Member Functions inherited from carla::geom::Vector3D
Vector3D Abs () const
float Length () const
float Length2D () const
Vector3D MakeUnitVector (const float epsilon=2.0f *std::numeric_limits< float >::epsilon()) const
 Return a unit-length copy of this vector.
template<typename MSGPACK_OBJECT>
void msgpack_object (MSGPACK_OBJECT *o, clmdep_msgpack::zone &sneaky_variable_that_shadows_z) const
template<typename Packer>
void msgpack_pack (Packer &pk) const
void msgpack_unpack (clmdep_msgpack::object const &o)
constexpr bool operator!= (const Vector3D &rhs) const
constexpr Vector3D & operator*= (float rhs)
constexpr Vector3D & operator+= (const Vector3D &rhs)
constexpr Vector3D & operator-= (const float f)
constexpr Vector3D & operator-= (const Vector3D &rhs)
constexpr Vector3D & operator/= (float rhs)
Vector3D & operator= (const FVector &rhs)=delete
constexpr bool operator== (const Vector3D &rhs) const
constexpr float SquaredLength () const
constexpr float SquaredLength2D () const
Vector3D ToCentimeters () const
 Return a Vector3D converted from meters to centimeters.
FVector ToFVector () const
Vector3D ToMeters () const
 Return a Vector3D converted from centimeters to meters.
 Vector3D ()=default
 Vector3D (const FVector &v)=delete
 These 2 methods are explicitly deleted to avoid creating them by other users, unlike locations, some vectors have units and some don't, by removing these methods we found several places were the conversion from cm to m was missing.
constexpr Vector3D (float ix, float iy, float iz)

Static Public Member Functions

static constexpr Location FromRightHanded (const RightHandedVector3D &rhs)
 Inverse of ToRightHanded().

Friends

constexpr friend Location operator+ (Location lhs, Location rhs)
constexpr friend Location operator- (Location lhs, Location rhs)

Additional Inherited Members

Public Attributes inherited from carla::geom::Vector3D
float x = 0.0f
float y = 0.0f
float z = 0.0f
Static Public Attributes inherited from carla::geom::Vector3D
static constexpr auto Dim = 3

Detailed Description

Definition at line 23 of file geom/Location.h.

Constructor & Destructor Documentation

◆ Location() [1/4]

◆ Location() [2/4]

carla::geom::Location::Location ( Vector3D rhs)
inline

Definition at line 33 of file geom/Location.h.

References Vector3D().

◆ Location() [3/4]

carla::geom::Location::Location ( Vector3DInt rhs)
inlineconstexpr

◆ Location() [4/4]

carla::geom::Location::Location ( const FVector & vector)
inline

Definition at line 99 of file geom/Location.h.

References Location().

Member Function Documentation

◆ Distance()

◆ DistanceSquared()

auto carla::geom::Location::DistanceSquared ( Location loc) const
inlineconstexpr

◆ FromRightHanded()

constexpr Location carla::geom::Location::FromRightHanded ( const RightHandedVector3D & rhs)
inlinestaticconstexpr

Inverse of ToRightHanded().

Mirroring Y is an involution, so this is the same (x, -y, z) map read the other way.

Definition at line 65 of file geom/Location.h.

References Location(), carla::geom::RightHandedVector3D::x, carla::geom::RightHandedVector3D::y, and carla::geom::RightHandedVector3D::z.

Referenced by carla::geom::Transform::FromRightHanded().

◆ operator FVector()

carla::geom::Location::operator FVector ( ) const
inline

◆ operator+=()

Location & carla::geom::Location::operator+= ( Location rhs)
inlineconstexpr

Definition at line 73 of file geom/Location.h.

References Location(), and Vector3D().

◆ operator-=()

Location & carla::geom::Location::operator-= ( Location rhs)
inlineconstexpr

Definition at line 83 of file geom/Location.h.

References Location(), and Vector3D().

◆ ToRightHanded()

RightHandedVector3D carla::geom::Location::ToRightHanded ( ) const
inlineconstexpr

This location expressed in a right-handed, x-forward / y-**left** / z-up frame (ROS REP-103 "FLU"): (x, -y, z).

Definition at line 59 of file geom/Location.h.

References carla::geom::RightHandedVector3D::RightHandedVector3D().

Referenced by TEST(), and carla::geom::Transform::ToRightHanded().

◆ Vector3D() [1/3]

◆ Vector3D() [2/3]

carla::geom::Vector3D::Vector3D ( const FVector & v)
delete

These 2 methods are explicitly deleted to avoid creating them by other users, unlike locations, some vectors have units and some don't, by removing these methods we found several places were the conversion from cm to m was missing.

◆ Vector3D() [3/3]

carla::geom::Vector3D::Vector3D ( float ix,
float iy,
float iz )
inlineconstexpr

Definition at line 37 of file geom/Vector3D.h.

◆ operator+

friend Location operator+ ( Location lhs,
Location rhs )
friend

Definition at line 78 of file geom/Location.h.

References Location().

◆ operator-

friend Location operator- ( Location lhs,
Location rhs )
friend

Definition at line 88 of file geom/Location.h.

References Location().


The documentation for this struct was generated from the following file: