Line3¶
The Line3 class template represents a line in 3D space, with
predefined typedefs for lines of type float and double.
There are also various utility functions that operate on Line3
objects defined in ImathLineAlgo.h and described in Line
Functions.
Example:
#include <Imath/ImathLine.h>
void
line3_example()
{
Imath::V3f a (0.0f, 0.0f, 0.0f);
Imath::V3f b (1.0f, 1.0f, 1.0f);
Imath::Line3f line (a, b);
assert (line.pos == a);
assert (line.dir == (b-a).normalized());
Imath::V3f c (0.5f, 0.5f, 0.5f);
float f = line.distanceTo (c);
assert (Imath::equalWithAbsError (f, 0.0f, 0.0001f));
Imath::V3f p = line (0.5f); // midpoint, i.e. 0.5 units from a along (b-a)
assert (p.equalWithAbsError (Imath::V3f (0.288675f, 0.288675f, 0.288675f), 0.0001f));
}
-
template <class T>
classLine3¶ The
Line3class represents a 3D line, defined by a point and a direction vector.Direct access to member fields
Constructors
-
constexpr
Line3()¶ Uninitialized by default.
Manipulation
-
constexpr
Warning
doxygenfunction: Unable to resolve multiple matches for function “operator<<” with arguments (std::ostream& s, const Line3<T>& line) in doxygen xml output for project “Imath” from directory: doxyxml/. Potential matches:
- std::ostream &operator<<(std::ostream&, Imath::half)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Color4<T>&)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Euler<T>&)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Interval<T>&)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Line3<T>&)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Matrix22<T>&)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Matrix33<T>&)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Matrix44<T>&)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Plane3<T>&)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Quat<T>&)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Shear6<T>&)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Vec2<T>&)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Vec3<T>&)
- template <class T>
std::ostream &Imath::operator<<(std::ostream&, const Vec4<T>&)