Photon Engine 2.0.0-beta
A physically based renderer.
|
Represents a line segment in space. More...
#include <TLineSegment.h>
Public Member Functions | |
TLineSegment ()=default | |
A line which state is unspecified. | |
TLineSegment (const TVector3< T > &origin, const TVector3< T > &direction) | |
A line extending form origin to the furthest point possible along direction . | |
TLineSegment (const TVector3< T > &origin, const TVector3< T > &dir, T minT, T maxT) | |
A line that covers the parametric range [minT, maxT). | |
TLineSegment & | flip () |
Point the line in opposite direction. | |
void | setMinT (T t) |
Set the parametric distance where the segment starts. | |
void | setMaxT (T t) |
Set the parametric distance where the segment ends. | |
void | setRange (T minT, T maxT) |
Set the parametric range where the segment extends. The range is [minT, maxT). This is equivalent to calling setMinT(T) and setMaxT(T) together. | |
void | setRange (const std::pair< T, T > &minMaxT) |
Same as setRange(T,T). | |
void | setOrigin (const TVector3< T > &pos) |
Set the origin of the line. | |
void | setDir (const TVector3< T > &dir) |
Set the direction vector of the line. | |
Getters | |
Basic getters for line attributes. See corresponding setters (if present) for more info. | |
const TVector3< T > & | getOrigin () const |
const TVector3< T > & | getDir () const |
T | getMinT () const |
T | getMaxT () const |
std::pair< T, T > | getRange () const |
TVector3< T > | getTail () const |
Get the coordinates on minimum parametric distance. | |
TVector3< T > | getHead () const |
Get the coordinates on maximum parametric distance. | |
TVector3< T > | getPoint (T t) const |
Get the coordinates referred to by the parametric distance t . | |
T | getProjectedT (const TVector3< T > &point) const |
Get the parametric distance of a point when it is projected on the line. | |
T | getFoldedT (const TVector3< T > &point) const |
Get the parametric distance of a point when it is rotated to the line. | |
T | getDeltaT () const |
Get the length of line in terms of parametric distance. | |
Represents a line segment in space.
Points \overrightarrow{P} on a line are modeled using the equation
\overrightarrow{P} = \overrightarrow{O} + t\overrightarrow{D}
where \overrightarrow{O} is the line origin and \overrightarrow{D} is the line direction, and t is a parameter in [t_{min}, t_{max}) . Note the direction vector of the line does not need to be normalized.
|
default |
A line which state is unspecified.
|
inline |
A line extending form origin
to the furthest point possible along direction
.
|
inline |
A line that covers the parametric range [minT, maxT).
dir | Line direction. Does not need to be normalized. |
|
inline |
Point the line in opposite direction.
This method essentially mirrored the line with respect to its origin, with other attributes remain the same.
|
inline |
Get the length of line in terms of parametric distance.
|
inline |
|
inline |
Get the parametric distance of a point when it is rotated to the line.
|
inline |
Get the coordinates on maximum parametric distance.
|
inline |
|
inline |
|
inline |
|
inline |
Get the coordinates referred to by the parametric distance t
.
|
inline |
Get the parametric distance of a point when it is projected on the line.
|
inline |
|
inline |
Get the coordinates on minimum parametric distance.
|
inline |
Set the direction vector of the line.
Note that the vector does not need to be normalized.
|
inline |
Set the parametric distance where the segment ends.
|
inline |
Set the parametric distance where the segment starts.
|
inline |
Set the origin of the line.
|
inline |
Same as setRange(T,T).
|
inline |
Set the parametric range where the segment extends. The range is [minT, maxT). This is equivalent to calling setMinT(T) and setMaxT(T) together.