|
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(), carla::traffic_manager::LocalizationStage::AssignLaneChange(), carla::geom::ComputeVertexWeight(), DistanceSegmentToPoint(), carla::road::Map::GetAllCrosswalkZones(), carla::road::Lane::GetCornerPositions(), carla::road::Road::GetDirectedPointIn(), carla::road::Road::GetDirectedPointInNoLaneOffset(), carla::road::Road::GetLateralShapeZ(), carla::road::element::GeometryArc::PosFromDist(), carla::road::element::GeometryLine::PosFromDist(), carla::road::element::GeometrySpiral::PosFromDist(), carla::traffic_manager::Parameters::SetPercentageIgnoreVehicles(), carla::traffic_manager::Parameters::SetPercentageIgnoreWalkers(), carla::traffic_manager::Parameters::SetPercentageRunningLight(), and carla::traffic_manager::Parameters::SetPercentageRunningSign().
|
inlinestaticconstexpr |
Definition at line 58 of file Math.h.
References carla::geom::Vector3D::Vector3D(), 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(), Pi(), RotatePointOnOrigin2D(), carla::geom::Vector3D::Vector3D(), 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 carla::traffic_manager::LocalizationStage::AssignLaneChange(), carla::traffic_manager::LocalizationStage::ComputeActionBuffer(), carla::traffic_manager::LocalizationStage::ComputeNextAction(), Distance(), carla::geom::Location::DistanceSquared(), carla::traffic_manager::SimpleWaypoint::DistanceSquared(), carla::traffic_manager::SimpleWaypoint::DistanceSquared(), carla::traffic_manager::CollisionStage::NegotiateCollision(), carla::traffic_manager::MotionPlanStage::SafeAfterJunction(), carla::traffic_manager::InMemoryMap::SetUp(), carla::traffic_manager::CollisionStage::Update(), carla::traffic_manager::LocalizationStage::Update(), carla::traffic_manager::VehicleLightStage::Update(), and carla::traffic_manager::ALSM::UpdateData().
|
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 carla::traffic_manager::LocalizationStage::AssignLaneChange(), carla::traffic_manager::MotionPlanStage::CollisionHandling(), carla::traffic_manager::DeviationDotProduct(), carla::traffic_manager::CollisionStage::GetBoundingBoxExtention(), carla::traffic_manager::CollisionStage::GetGeodesicBoundary(), GetVectorAngle(), carla::traffic_manager::CollisionStage::NegotiateCollision(), carla::client::detail::Client::SpawnActorWithParent(), and carla::traffic_manager::LocalizationStage::Update().
|
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(), and carla::traffic_manager::InMemoryMap::SetUp().
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
Definition at line 25 of file Math.h.
Referenced by carla::road::Map::CreateRtree(), carla::geom::DegreesToRadians(), DistanceArcToPoint(), carla::geom::GeoProjection::GeoLocationToTransformLambertConformalConic(), carla::geom::GeoProjection::GeoLocationToTransformWebMercator(), Pi2(), carla::road::element::GeometryArc::PosFromDist(), carla::geom::RadiansToDegrees(), carla::client::Rotate(), ToDegrees(), ToRadians(), carla::geom::GeoProjection::TransformToGeoLocationLambertConformalConic(), and carla::geom::GeoProjection::TransformToGeoLocationWebMercator().
|
inlinestaticconstexpr |
Definition at line 31 of file Math.h.
References Pi().
Referenced by AInertialMeasurementUnit::ComputeCompass(), CaService::GetHeading(), and ARadar::SendLineTraces().
Definition at line 111 of file Math.cpp.
References carla::geom::Vector3D::Vector3D(), carla::geom::Vector3D::x, and carla::geom::Vector3D::y.
Referenced by carla::nav::Navigation::AddOrUpdateVehicle(), and DistanceArcToPoint().
|
inlinestaticconstexpr |
Definition at line 54 of file Math.h.
Referenced by DistanceSquared(), and DistanceSquared2D().
|
inlinestaticconstexpr |
Definition at line 37 of file Math.h.
References Pi().
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(), carla::road::Map::GetAllCrosswalkZones(), CaService::GetHeading(), carla::client::Road::GetTransformAt(), carla::road::Map::GetTreesTransform(), carla::agents::navigation::IsWithinDistance(), carla::geom::Quaternion::Rotator(), ARayCastSemanticLidar::SimulateLidar(), and carla::geom::Quaternion::ToRightHandedRotation().
|
inlinestaticconstexpr |
Definition at line 43 of file Math.h.
References Pi().
Referenced by carla::nav::Navigation::AddOrUpdateVehicle(), 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::Quaternion::Quaternion(), carla::geom::Rotation::RotateVector(), ARayCastSemanticLidar::SimulateLidar(), TEST(), and TEST().