|
CARLA
|
#include <Math.h>
Static Public Member Functions | |
| template<typename T > | |
| static constexpr T | Clamp (T a, T min=T(0), T max=T(1)) |
| static constexpr 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) |
| Returns a pair containing: | |
| static std::pair< float, float > | DistanceSegmentToPoint (const Vector3D &p, const Vector3D &v, const Vector3D &w) |
| Returns a pair containing: | |
| static constexpr auto | DistanceSquared (const Vector3D &a, const Vector3D &b) |
| static constexpr auto | DistanceSquared2D (const Vector3D &a, const Vector3D &b) |
| static constexpr auto | Dot (const Vector3D &a, const Vector3D &b) |
| static constexpr auto | Dot2D (const Vector3D &a, const Vector3D &b) |
| static std::vector< int > | GenerateRange (int a, int b) |
| static Vector3D | GetForwardVector (const Rotation &rotation) |
| Compute the unit vector pointing towards the X-axis of rotation. | |
| static Vector3D | GetRightVector (const Rotation &rotation) |
| Compute the unit vector pointing towards the Y-axis of rotation. | |
| static Vector3D | GetUpVector (const Rotation &rotation) |
| Compute the unit vector pointing towards the Y-axis of rotation. | |
| static double | GetVectorAngle (const Vector3D &a, const Vector3D &b) |
| Returns the angle between 2 vectors in radians. | |
| static constexpr 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 constexpr T | Square (const T &a) |
| template<typename T > | |
| static constexpr T | ToDegrees (T rad) |
| template<typename T > | |
| static constexpr T | ToRadians (T deg) |
|
inlinestaticconstexpr |
Definition at line 49 of file Math.h.
References min().
Referenced by carla::road::MapBuilder::AddSignalReference(), carla::road::MapBuilder::AddStencil(), DistanceSegmentToPoint(), carla::road::Map::GetAllCrosswalkZones(), carla::road::Lane::GetCornerPositions(), carla::road::Road::GetDirectedPointIn(), carla::road::Road::GetDirectedPointInNoLaneOffset(), carla::road::Road::GetLateralShapeZ(), carla::road::element::GeometryLine::PosFromDist(), carla::road::element::GeometryArc::PosFromDist(), and carla::road::element::GeometrySpiral::PosFromDist().
|
inlinestaticconstexpr |
Definition at line 58 of file Math.h.
References carla::geom::Vector3D::x, carla::geom::Vector3D::y, and carla::geom::Vector3D::z.
Definition at line 78 of file Math.h.
References DistanceSquared().
Referenced by carla::geom::ComputeVertexWeight(), carla::geom::Location::Distance(), carla::road::Road::GetNearestLane(), and TEST().
Definition at line 82 of file Math.h.
References DistanceSquared2D().
Referenced by DistanceArcToPoint(), DistanceSegmentToPoint(), and carla::road::Map::GetWaypoint().
|
static |
Returns a pair containing:
Definition at line 33 of file Math.cpp.
References DEBUG_ASSERT, Distance2D(), heading, RotatePointOnOrigin2D(), carla::geom::Vector3D::x, and carla::geom::Vector3D::y.
Referenced by carla::road::element::GeometryArc::DistanceTo(), and TEST().
|
static |
Returns a pair containing:
| p | point to calculate distance |
| v | first point of the segment |
| w | second point of the segment |
Definition at line 18 of file Math.cpp.
References Clamp(), Distance2D(), DistanceSquared2D(), and Dot2D().
Referenced by carla::road::element::GeometryLine::DistanceTo(), carla::road::Map::GetClosestWaypointOnRoad(), and TEST().
|
inlinestaticconstexpr |
Definition at line 70 of file Math.h.
References Square(), carla::geom::Vector3D::x, carla::geom::Vector3D::y, and carla::geom::Vector3D::z.
Referenced by Distance(), and carla::geom::Location::DistanceSquared().
|
inlinestaticconstexpr |
Definition at line 74 of file Math.h.
References Square(), carla::geom::Vector3D::x, and carla::geom::Vector3D::y.
Referenced by Distance2D(), and DistanceSegmentToPoint().
|
inlinestaticconstexpr |
Definition at line 62 of file Math.h.
References carla::geom::Vector3D::x, carla::geom::Vector3D::y, and carla::geom::Vector3D::z.
Referenced by GetVectorAngle(), and carla::client::detail::Client::SpawnActorWithParent().
|
inlinestaticconstexpr |
Definition at line 66 of file Math.h.
References carla::geom::Vector3D::x, and carla::geom::Vector3D::y.
Referenced by DistanceSegmentToPoint().
|
static |
Definition at line 159 of file Math.cpp.
Referenced by ACarlaGameModeBase::DebugShowSignals().
Compute the unit vector pointing towards the X-axis of rotation.
Definition at line 117 of file Math.cpp.
References carla::geom::Rotation::pitch, ToRadians(), and carla::geom::Rotation::yaw.
Referenced by carla::geom::Rotation::GetForwardVector().
Compute the unit vector pointing towards the Y-axis of rotation.
Definition at line 128 of file Math.cpp.
References carla::geom::Rotation::pitch, carla::geom::Rotation::roll, ToRadians(), and carla::geom::Rotation::yaw.
Referenced by carla::geom::Rotation::GetRightVector().
Compute the unit vector pointing towards the Y-axis of rotation.
Definition at line 144 of file Math.cpp.
References carla::geom::Rotation::pitch, carla::geom::Rotation::roll, ToRadians(), and carla::geom::Rotation::yaw.
Referenced by carla::geom::Rotation::GetUpVector().
Returns the angle between 2 vectors in radians.
Definition at line 14 of file Math.cpp.
References Dot(), and carla::geom::Vector3D::Length().
Referenced by carla::road::Map::CreateRtree().
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
Definition at line 111 of file Math.cpp.
References carla::geom::Vector3D::x, and carla::geom::Vector3D::y.
Referenced by DistanceArcToPoint().
|
inlinestaticconstexpr |
Definition at line 54 of file Math.h.
Referenced by DistanceSquared(), and DistanceSquared2D().
|
inlinestaticconstexpr |
Definition at line 37 of file Math.h.
Referenced by CaService::AddBasicVehicleContainerHighFrequency(), carla::road::MapBuilder::AddSignalPositionInertial(), CaService::CheckHeadingDelta(), carla::agents::navigation::ComputeMagnitudeAngle(), carla::road::MapBuilder::ComputeSignalTransform(), carla::road::MapBuilder::ComputeStencilTransform(), carla::road::Lane::ComputeTransform(), CaService::GetHeading(), carla::client::Road::GetTransformAt(), carla::road::Map::GetTreesTransform(), carla::agents::navigation::IsWithinDistance(), and ARayCastSemanticLidar::SimulateLidar().
|
inlinestaticconstexpr |
Definition at line 43 of file Math.h.
Referenced by carla::agents::navigation::ComputeMagnitudeAngle(), carla::agents::navigation::DrawWaypoints(), GetForwardVector(), carla::geom::Transform::GetInverseMatrix(), carla::geom::RightHandedTransform::GetMatrix(), carla::geom::Transform::GetMatrix(), GetRightVector(), carla::agents::navigation::GetTrafficLightTriggerLocation(), GetUpVector(), carla::geom::Rotation::InverseRotateVector(), carla::geom::Rotation::RotateVector(), ARayCastSemanticLidar::SimulateLidar(), TEST(), and TEST().