OpenLB 1.7
|
#include <stlReader.h>
Public Member Functions | |
bool | testRayIntersect (const Vector< T, 3 > &pt, const Vector< T, 3 > &dir, Vector< T, 3 > &q, T &alpha, const T &rad=T(), bool print=false) |
Test intersection between ray and triangle. | |
Vector< T, 3 > | closestPtPointTriangle (const Vector< T, 3 > &pt) const |
computes closest Point in a triangle to another point. | |
STLtriangle () | |
Constructor constructs. | |
STLtriangle (STLtriangle< T > const &tri) | |
CopyConstructor copies. | |
STLtriangle< T > & | operator= (STLtriangle< T > const &tri) |
Operator= equals. | |
~STLtriangle () | |
void | init () |
Initializes triangle and precomputes member variables. | |
Vector< T, 3 > & | getNormal () |
Return write access to normal. | |
const Vector< T, 3 > & | getNormal () const |
Return read access to normal. | |
Vector< T, 3 > | getCenter () |
Returns center. | |
std::vector< T > | getE0 () |
Returns Pt0-Pt1. | |
std::vector< T > | getE1 () |
Returns Pt0-Pt2. | |
bool | isPointInside (const PhysR< T, 3 > &pt) const |
Check whether a point is inside a triangle. | |
Public Attributes | |
std::vector< Vertex< T, 3 > > | point |
A triangle contains 3 Points. | |
Vector< T, 3 > | normal |
normal of triangle | |
Vector< T, 3 > | uBeta |
variables explained in http://www.uninformativ.de/bin/RaytracingSchnitttests-76a577a-CC-BY.pdf page 7-12 precomputed for speedup | |
Vector< T, 3 > | uGamma |
T | d |
T | kBeta |
T | kGamma |
Definition at line 79 of file stlReader.h.
|
inline |
Constructor constructs.
Definition at line 104 of file stlReader.h.
|
inline |
|
inline |
Definition at line 120 of file stlReader.h.
Vector< T, 3 > olb::STLtriangle< T >::closestPtPointTriangle | ( | const Vector< T, 3 > & | pt | ) | const |
computes closest Point in a triangle to another point.
source: Real-Time Collision Detection. Christer Ericson. ISBN-10: 1558607323
Definition at line 261 of file stlReader.hh.
References olb::crossProduct3D().
Vector< T, 3 > olb::STLtriangle< T >::getCenter | ( | ) |
Returns center.
Definition at line 91 of file stlReader.hh.
std::vector< T > olb::STLtriangle< T >::getE0 | ( | ) |
std::vector< T > olb::STLtriangle< T >::getE1 | ( | ) |
|
inline |
Return write access to normal.
Definition at line 125 of file stlReader.h.
References olb::STLtriangle< T >::normal.
|
inline |
Return read access to normal.
Definition at line 130 of file stlReader.h.
References olb::STLtriangle< T >::normal.
void olb::STLtriangle< T >::init | ( | ) |
Initializes triangle and precomputes member variables.
Definition at line 46 of file stlReader.hh.
References olb::norm(), olb::util::pow(), and olb::util::sqrt().
bool olb::STLtriangle< T >::isPointInside | ( | const PhysR< T, 3 > & | pt | ) | const |
Check whether a point is inside a triangle.
Definition at line 126 of file stlReader.hh.
References olb::util::nearZero(), and olb::norm().
|
inline |
Operator= equals.
Definition at line 108 of file stlReader.h.
References olb::STLtriangle< T >::d, olb::STLtriangle< T >::kBeta, olb::STLtriangle< T >::kGamma, olb::STLtriangle< T >::normal, olb::STLtriangle< T >::point, olb::STLtriangle< T >::uBeta, and olb::STLtriangle< T >::uGamma.
bool olb::STLtriangle< T >::testRayIntersect | ( | const Vector< T, 3 > & | pt, |
const Vector< T, 3 > & | dir, | ||
Vector< T, 3 > & | q, | ||
T & | alpha, | ||
const T & | rad = T(), | ||
bool | print = false ) |
Test intersection between ray and triangle.
pt | Raypoint |
dir | Direction |
q | Point of intersection (if intersection occurs) |
alpha | Explained in http://www.uninformativ.de/bin/RaytracingSchnitttests-76a577a-CC-BY.pdf page 7-12 q = pt + alpha * dir |
rad | It's complicated. Imagine you have a sphere with radius rad moving a long the ray. Then q becomes the first point of the sphere to touch the triangle. |
Definition at line 154 of file stlReader.hh.
References olb::util::fabs(), olb::util::pow(), and olb::util::sqrt().
T olb::STLtriangle< T >::d |
Definition at line 100 of file stlReader.h.
T olb::STLtriangle< T >::kBeta |
Definition at line 100 of file stlReader.h.
T olb::STLtriangle< T >::kGamma |
Definition at line 100 of file stlReader.h.
Vector<T,3> olb::STLtriangle< T >::normal |
normal of triangle
Definition at line 95 of file stlReader.h.
std::vector<Vertex<T,3> > olb::STLtriangle< T >::point |
A triangle contains 3 Points.
Definition at line 92 of file stlReader.h.
Vector<T,3> olb::STLtriangle< T >::uBeta |
variables explained in http://www.uninformativ.de/bin/RaytracingSchnitttests-76a577a-CC-BY.pdf page 7-12 precomputed for speedup
Definition at line 99 of file stlReader.h.
Vector<T,3> olb::STLtriangle< T >::uGamma |
Definition at line 99 of file stlReader.h.