Support Forum G3D Web Page |
An finite segment of an infinite 3D line.
More...
Public Member Functions | |
LineSegment () | |
LineSegment (class BinaryInput &b) | |
virtual | ~LineSegment () |
Point3 | closestPoint (const Point3 &point) const |
Returns the closest point on the line segment to point. More... | |
void | deserialize (class BinaryInput &b) |
double | distance (const Point3 &p) const |
Returns the distance between point and the line More... | |
double | distanceSquared (const Point3 &p) const |
bool | intersectsSolidSphere (const class Sphere &s) const |
Returns true if some part of this segment is inside the sphere. More... | |
float | length () const |
Point3 | midpoint () const |
Point3 | point (int i) const |
Call with 0 or 1. More... | |
Point3 | randomPoint () const |
void | serialize (class BinaryOutput &b) const |
Static Public Member Functions | |
static LineSegment | fromTwoPoints (const Point3 &point1, const Point3 &point2) |
Constructs a line from two (not equal) points. More... | |
Protected Member Functions | |
LineSegment (const Point3 &__point, const Vector3 &_direction) | |
Protected Attributes | |
Point3 | _point |
Vector3 | direction |
Not normalized. More... | |
An finite segment of an infinite 3D line.
|
inlineprotected |
|
inline |
Referenced by fromTwoPoints().
G3D::LineSegment::LineSegment | ( | class BinaryInput & | b | ) |
|
inlinevirtual |
Returns the closest point on the line segment to point.
Referenced by distance(), and distanceSquared().
void G3D::LineSegment::deserialize | ( | class BinaryInput & | b | ) |
|
inline |
Returns the distance between point and the line
|
inline |
|
inlinestatic |
Constructs a line from two (not equal) points.
bool G3D::LineSegment::intersectsSolidSphere | ( | const class Sphere & | s | ) | const |
Returns true if some part of this segment is inside the sphere.
|
inline |
|
inline |
Point3 G3D::LineSegment::point | ( | int | i | ) | const |
Call with 0 or 1.
Point3 G3D::LineSegment::randomPoint | ( | ) | const |
void G3D::LineSegment::serialize | ( | class BinaryOutput & | b | ) | const |
|
protected |
Referenced by midpoint().
|
protected |
Not normalized.
Referenced by length(), and midpoint().