jaulib v1.3.8
Jau Support Library (C++, Java, ..)
|
#include <geom2f.hpp>
Public Member Functions | |
constexpr | LineSeg2f () noexcept |
constexpr | LineSeg2f (const Point2f &p0_, const Point2f &p1_) noexcept |
void | add (float length) |
float | angle () const noexcept |
Return the angle of this line segment in radians. | |
float | angle (const LineSeg2f &o) const noexcept |
Return the angle between two line segments in radians. | |
AABBox2f | box () const noexcept override |
Create an AABBox with given lineseg. | |
bool | contains (const Point2f &p2) const noexcept override |
Test intersection between this line segment and the give point. | |
float | distance (Point2f p) const noexcept |
Returns minimum distance between this line segment and given point p. | |
bool | intersection (const AABBox2f &box, Vec2f &reflect_out, Vec2f &cross_normal, Point2f &cross_point) const noexcept |
bool | intersection (Vec2f &reflect_out, Vec2f &cross_normal, Point2f &cross_point, const LineSeg2f &in) const noexcept override |
Return whether this object intersects with the given line segment and if intersecting, the crossing point (intersection), the normalized normal of the crossing surface and the reflection out vector. | |
bool | intersects (const AABBox2f &box) const noexcept override |
bool | intersects (const Geom2f &o) const noexcept override |
bool | intersects (const LineSeg2f &o) const noexcept override |
Return true if this line segment intersect with the given line segment. | |
bool | intersects (Point2f &result, const LineSeg2f &o) const noexcept |
Compute intersection between two lines segments. | |
constexpr float | length () const noexcept |
Return the length of this line segment, i.e. | |
constexpr LineSeg2f & | operator*= (const float s) noexcept |
Scale this line segment with given scale factor. | |
std::string | toString () const noexcept override |
![]() | |
virtual | ~Geom2f ()=default |
Public Attributes | |
Point2f | p0 |
Point2f | p1 |
Definition at line 83 of file geom2f.hpp.
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
Definition at line 91 of file geom2f.hpp.
|
inlineconstexprnoexcept |
Scale this line segment with given scale factor.
s | scale factor |
Definition at line 99 of file geom2f.hpp.
|
inlineconstexprnoexcept |
Return the length of this line segment, i.e.
distance between both points.
Definition at line 108 of file geom2f.hpp.
|
inlinenoexcept |
Return the angle of this line segment in radians.
Definition at line 115 of file geom2f.hpp.
|
inlinenoexcept |
Return the angle between two line segments in radians.
Definition at line 122 of file geom2f.hpp.
|
inline |
Definition at line 128 of file geom2f.hpp.
|
inlineoverridevirtualnoexcept |
Implements jau::math::geom::Geom2f.
Definition at line 136 of file geom2f.hpp.
|
inlineoverridevirtualnoexcept |
Create an AABBox with given lineseg.
Implements jau::math::geom::Geom2f.
Definition at line 141 of file geom2f.hpp.
|
inlineoverridevirtualnoexcept |
Test intersection between this line segment and the give point.
Implements jau::math::geom::Geom2f.
Definition at line 168 of file geom2f.hpp.
|
inlinenoexcept |
Compute intersection between two lines segments.
result | storage for the intersection coordinates if the lines intersect, otherwise unchanged |
o | the other line segment. |
Definition at line 261 of file geom2f.hpp.
|
inlineoverridevirtualnoexcept |
Return true if this line segment intersect with the given line segment.
o | the other line segment. |
Implements jau::math::geom::Geom2f.
Definition at line 270 of file geom2f.hpp.
|
inlinenoexcept |
Returns minimum distance between this line segment and given point p.
See Shortest distance between a point and a line segment
Slightly more expensive than intersects().
Definition at line 326 of file geom2f.hpp.
|
inlineoverridevirtualnoexcept |
Implements jau::math::geom::Geom2f.
Definition at line 343 of file geom2f.hpp.
|
inlineoverridevirtualnoexcept |
Implements jau::math::geom::Geom2f.
Definition at line 371 of file geom2f.hpp.
|
inlineoverridevirtualnoexcept |
Return whether this object intersects with the given line segment and if intersecting, the crossing point (intersection), the normalized normal of the crossing surface and the reflection out vector.
Implements jau::math::geom::Geom2f.
Definition at line 375 of file geom2f.hpp.
|
inlinenoexcept |
Definition at line 385 of file geom2f.hpp.
Point2f jau::math::geom::LineSeg2f::p0 |
Definition at line 85 of file geom2f.hpp.
Point2f jau::math::geom::LineSeg2f::p1 |
Definition at line 86 of file geom2f.hpp.