12#ifndef TT_INCLUDE__LINESEGCLASS_H
13#define TT_INCLUDE__LINESEGCLASS_H
18class SCRIPTS_API LineSegClass
24 LineSegClass(
const Vector3 & p0,
const Vector3 & p1) : P0(p0), P1(p1)
28 LineSegClass(
const Vector3& p0,
const Vector3& dir,
float l) : P0(p0), Dir(dir), Length(l)
33 LineSegClass(
const LineSegClass & that,
const Matrix3D & tm)
37 void Set(
const Vector3 & p0,
const Vector3 & p1)
43 void Set(
const Vector3& p0,
const Vector3& dir,
float l)
51 void Set(
const LineSegClass & that,
const Matrix3D & tm);
52 void Set_Random(
const Vector3 & min,
const Vector3 & max);
53 const Vector3 & Get_P0()
const
57 const Vector3 & Get_P1()
const
61 const Vector3 & Get_DP()
const
65 const Vector3 & Get_Dir()
const
69 float Get_Length()
const
73 void Compute_Point(
float t,Vector3 * set)
const
75 Vector3::Add(P0,t*DP,set);
77 Vector3 Find_Point_Closest_To(
const Vector3 &pos)
const;
78 bool Find_Intersection (
const LineSegClass &other_line, Vector3 *p1,
float *fraction1, Vector3 *p2,
float *fraction2)
const;
80 void recalculate(
void)