CARLA
 
载入中...
搜索中...
未找到
静态 Public 成员函数 | 所有成员列表
carla::geom::Math类 参考

#include <Math.h>

静态 Public 成员函数

template<typename T >
static T Clamp (T a, T min=T(0), T max=T(1))
 
static auto Cross (const Vector3D &a, const Vector3D &b)
 
static auto Distance (const Vector3D &a, const Vector3D &b)
 
static auto Distance2D (const Vector3D &a, const Vector3D &b)
 
static std::pair< float, float > DistanceArcToPoint (Vector3D p, Vector3D start_pos, float length, float heading, float curvature)
 计算点到弧的距离 返回一个包含:
 
static std::pair< float, float > DistanceSegmentToPoint (const Vector3D &p, const Vector3D &v, const Vector3D &w)
 计算点到线段的距离 返回一个包含:
 
static auto DistanceSquared (const Vector3D &a, const Vector3D &b)
 
static auto DistanceSquared2D (const Vector3D &a, const Vector3D &b)
 
static auto Dot (const Vector3D &a, const Vector3D &b)
 
static auto Dot2D (const Vector3D &a, const Vector3D &b)
 
static std::vector< int > GenerateRange (int a, int b)
 
static Vector3D GetForwardVector (const Rotation &rotation)
 计算指向 rotation 的 X 轴的单位向量
 
static Vector3D GetRightVector (const Rotation &rotation)
 计算指向 rotation 的 Y 轴的单位向量
 
static Vector3D GetUpVector (const Rotation &rotation)
 计算指向 rotation 的 Z 轴的单位向量
 
static double GetVectorAngle (const Vector3D &a, const Vector3D &b)
 返回两个向量之间的夹角(弧度)
 
static float LinearLerp (float a, float b, float f)
 
template<typename T >
static constexpr T Pi ()
 
template<typename T >
static constexpr T Pi2 ()
 
static Vector3D RotatePointOnOrigin2D (Vector3D p, float angle)
 
template<typename T >
static T Square (const T &a)
 
template<typename T >
static constexpr T ToDegrees (T rad)
 
template<typename T >
static constexpr T ToRadians (T deg)
 

详细描述

在文件 Math.h21 行定义.

成员函数说明

◆ Clamp()

template<typename T >
static T carla::geom::Math::Clamp ( T a,
T min = T(0),
T max = T(1) )
inlinestatic

在文件 Math.h54 行定义.

引用了 min().

被这些函数引用 DistanceSegmentToPoint(), carla::road::element::GeometryLine::PosFromDist(), carla::road::element::GeometryArc::PosFromDist() , 以及 carla::road::element::GeometrySpiral::PosFromDist().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ Cross()

static auto carla::geom::Math::Cross ( const Vector3D & a,
const Vector3D & b )
inlinestatic

◆ Distance()

static auto carla::geom::Math::Distance ( const Vector3D & a,
const Vector3D & b )
inlinestatic

在文件 Math.h90 行定义.

引用了 DistanceSquared().

被这些函数引用 carla::geom::ComputeVertexWeight(), carla::geom::Location::Distance() , 以及 TEST().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ Distance2D()

static auto carla::geom::Math::Distance2D ( const Vector3D & a,
const Vector3D & b )
inlinestatic

在文件 Math.h95 行定义.

引用了 DistanceSquared2D().

被这些函数引用 DistanceArcToPoint() , 以及 DistanceSegmentToPoint().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ DistanceArcToPoint()

std::pair< float, float > carla::geom::Math::DistanceArcToPoint ( Vector3D p,
Vector3D start_pos,
float length,
float heading,
float curvature )
static

计算点到弧的距离 返回一个包含:

  • first: 从 start_pos 到 p' 的弧长距离,其中 p' = p 投影到弧上
  • second: 从 p 到 p' 的欧几里得距离
待办事项
: 因为虚幻的坐标,纠正-y的方法是比较老套的,这个以后必须改掉

在文件 Math.cpp50 行定义.

引用了 DEBUG_ASSERT, Distance2D(), RotatePointOnOrigin2D(), carla::geom::Vector3D::x , 以及 carla::geom::Vector3D::y.

被这些函数引用 carla::road::element::GeometryArc::DistanceTo() , 以及 TEST().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ DistanceSegmentToPoint()

std::pair< float, float > carla::geom::Math::DistanceSegmentToPoint ( const Vector3D & p,
const Vector3D & v,
const Vector3D & w )
static

计算点到线段的距离 返回一个包含:

  • first: 从 v 到 p' 的距离,其中 p' = p 投影到线段 (w - v) 上
  • second: 从 p 到 p' 的欧几里得距离
    参数
    p要计算距离的点
    v线段的第一个点
    w线段的第二个点

在文件 Math.cpp24 行定义.

引用了 Clamp(), Distance2D(), DistanceSquared2D() , 以及 Dot2D().

被这些函数引用 carla::road::element::GeometryLine::DistanceTo() , 以及 TEST().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ DistanceSquared()

static auto carla::geom::Math::DistanceSquared ( const Vector3D & a,
const Vector3D & b )
inlinestatic

在文件 Math.h80 行定义.

引用了 Square(), carla::geom::Vector3D::x, carla::geom::Vector3D::y , 以及 carla::geom::Vector3D::z.

被这些函数引用 Distance() , 以及 carla::geom::Location::DistanceSquared().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ DistanceSquared2D()

static auto carla::geom::Math::DistanceSquared2D ( const Vector3D & a,
const Vector3D & b )
inlinestatic

在文件 Math.h85 行定义.

引用了 Square(), carla::geom::Vector3D::x , 以及 carla::geom::Vector3D::y.

被这些函数引用 Distance2D() , 以及 DistanceSegmentToPoint().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ Dot()

static auto carla::geom::Math::Dot ( const Vector3D & a,
const Vector3D & b )
inlinestatic

在文件 Math.h70 行定义.

引用了 carla::geom::Vector3D::x, carla::geom::Vector3D::y , 以及 carla::geom::Vector3D::z.

被这些函数引用 GetVectorAngle() , 以及 carla::client::detail::Client::SpawnActorWithParent().

+ 这是这个函数的调用关系图:

◆ Dot2D()

static auto carla::geom::Math::Dot2D ( const Vector3D & a,
const Vector3D & b )
inlinestatic

在文件 Math.h75 行定义.

引用了 carla::geom::Vector3D::x , 以及 carla::geom::Vector3D::y.

被这些函数引用 DistanceSegmentToPoint().

+ 这是这个函数的调用关系图:

◆ GenerateRange()

std::vector< int > carla::geom::Math::GenerateRange ( int a,
int b )
static

在文件 Math.cpp191 行定义.

被这些函数引用 ACarlaGameModeBase::DebugShowSignals().

+ 这是这个函数的调用关系图:

◆ GetForwardVector()

Vector3D carla::geom::Math::GetForwardVector ( const Rotation & rotation)
static

计算指向 rotation 的 X 轴的单位向量

在文件 Math.cpp147 行定义.

引用了 carla::geom::Rotation::pitch, ToRadians() , 以及 carla::geom::Rotation::yaw.

被这些函数引用 carla::geom::Rotation::GetForwardVector().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ GetRightVector()

Vector3D carla::geom::Math::GetRightVector ( const Rotation & rotation)
static

计算指向 rotation 的 Y 轴的单位向量

在文件 Math.cpp158 行定义.

引用了 carla::geom::Rotation::pitch, carla::geom::Rotation::roll, ToRadians() , 以及 carla::geom::Rotation::yaw.

被这些函数引用 carla::geom::Rotation::GetRightVector().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ GetUpVector()

Vector3D carla::geom::Math::GetUpVector ( const Rotation & rotation)
static

计算指向 rotation 的 Z 轴的单位向量

在文件 Math.cpp173 行定义.

引用了 carla::geom::Rotation::pitch, carla::geom::Rotation::roll, ToRadians() , 以及 carla::geom::Rotation::yaw.

被这些函数引用 carla::geom::Rotation::GetUpVector().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ GetVectorAngle()

double carla::geom::Math::GetVectorAngle ( const Vector3D & a,
const Vector3D & b )
static

返回两个向量之间的夹角(弧度)

在文件 Math.cpp16 行定义.

引用了 Dot() , 以及 carla::geom::Vector3D::Length().

+ 函数调用图:

◆ LinearLerp()

static float carla::geom::Math::LinearLerp ( float a,
float b,
float f )
inlinestatic

在文件 Math.h100 行定义.

◆ Pi()

template<typename T >
static constexpr T carla::geom::Math::Pi ( )
inlinestaticconstexpr

在文件 Math.h26 行定义.

◆ Pi2()

template<typename T >
static constexpr T carla::geom::Math::Pi2 ( )
inlinestaticconstexpr

在文件 Math.h33 行定义.

◆ RotatePointOnOrigin2D()

Vector3D carla::geom::Math::RotatePointOnOrigin2D ( Vector3D p,
float angle )
static

在文件 Math.cpp138 行定义.

引用了 carla::geom::Vector3D::x , 以及 carla::geom::Vector3D::y.

被这些函数引用 DistanceArcToPoint().

+ 这是这个函数的调用关系图:

◆ Square()

template<typename T >
static T carla::geom::Math::Square ( const T & a)
inlinestatic

在文件 Math.h60 行定义.

被这些函数引用 DistanceSquared() , 以及 DistanceSquared2D().

+ 这是这个函数的调用关系图:

◆ ToDegrees()

template<typename T >
static constexpr T carla::geom::Math::ToDegrees ( T rad)
inlinestaticconstexpr

在文件 Math.h40 行定义.

被这些函数引用 CaService::AddBasicVehicleContainerHighFrequency(), CaService::CheckHeadingDelta(), CaService::GetHeading() , 以及 ARayCastSemanticLidar::SimulateLidar().

+ 这是这个函数的调用关系图:

◆ ToRadians()

template<typename T >
static constexpr T carla::geom::Math::ToRadians ( T deg)
inlinestaticconstexpr

在文件 Math.h47 行定义.

被这些函数引用 GetForwardVector(), carla::geom::Transform::GetInverseMatrix(), carla::geom::Transform::GetMatrix(), GetRightVector(), GetUpVector(), carla::geom::Rotation::InverseRotateVector(), carla::geom::LatLonToMercator(), carla::geom::LatToScale(), carla::geom::Rotation::RotateVector() , 以及 ARayCastSemanticLidar::SimulateLidar().

+ 这是这个函数的调用关系图:

该类的文档由以下文件生成: