#include <LineSegment.h>
G3D::LineSegment2D::LineSegment2D |
( |
| ) |
|
|
inline |
Vector2 m_direction
Definition: LineSegment.h:92
Point2 m_origin
Definition: LineSegment.h:89
float m_length
Definition: LineSegment.h:95
bool fuzzyEq(double a, double b)
Definition: g3dmath.h:857
uint8 const Q[]
Definition: AuthenticationPackets.cpp:237
float dot(const Vector2 &s) const
Definition: Vector2.h:446
float G3D::LineSegment2D::distance |
( |
const Point2 & |
p | ) |
const |
156 return (closest - p).length();
Point2 closestPoint(const Point2 &Q) const
Definition: LineSegment.cpp:125
109 s.m_direction = p1 - p0;
110 s.m_length = s.m_direction.length();
LineSegment2D()
Definition: LineSegment.h:99
Returns the intersection of these segements (including testing endpoints), or Point2::inf() if they do not intersect.
168 (
m_origin == other.m_origin + other.m_direction)) {
173 return other.m_origin;
180 Vector2 dir2 = other.m_direction;
182 Vector2 origin2 = other.m_origin;
188 origin1 = origin1.
yx();
189 origin2 = origin2.
yx();
209 Vector2 d = origin2 - origin1;
210 float m = dir1.
y / dir1.x;
212 float t2 = (d.x * m - d.y) / (dir2.y - dir2.x * m);
218 if ((t2 < 0.0f) || (t2 > 1.0f)) {
223 float t1 = (d.x + dir2.x * t2) / dir1.x;
224 if ((t1 < 0.0f) || (t1 > 1.0f)) {
Vector2 yx() const
Definition: Vector2.cpp:182
Vector2 m_direction
Definition: LineSegment.h:92
Point2 m_origin
Definition: LineSegment.h:89
float y
Definition: Vector2.h:50
bool isFinite(double x)
Definition: g3dmath.h:525
static const Vector2 & inf()
Definition: Vector2.cpp:82
float G3D::LineSegment2D::length |
( |
| ) |
const |
float m_length
Definition: LineSegment.h:95
Vector2 G3D::LineSegment2D::point |
( |
int |
i | ) |
const |
Vector2 m_direction
Definition: LineSegment.h:92
Point2 m_origin
Definition: LineSegment.h:89
#define debugAssert(exp)
Definition: debugAssert.h:160
Vector2 G3D::LineSegment2D::m_direction |
|
private |
float G3D::LineSegment2D::m_length |
|
private |
Point2 G3D::LineSegment2D::m_origin |
|
private |
The documentation for this class was generated from the following files: