|
Blender V4.3
|
Enumerations | |
| enum | intersection_test { DONT_INTERSECT , DO_INTERSECT , COLINEAR , COINCIDENT } |
Functions | |
| bool | intersect2dSegPoly (Vec2r *seg, Vec2r *poly, uint n) |
| bool | intersect2dSeg2dArea (const Vec2r &min, const Vec2r &max, const Vec2r &A, const Vec2r &B) |
| bool | include2dSeg2dArea (const Vec2r &min, const Vec2r &max, const Vec2r &A, const Vec2r &B) |
| intersection_test | intersect2dSeg2dSeg (const Vec2r &p1, const Vec2r &p2, const Vec2r &p3, const Vec2r &p4, Vec2r &res) |
| intersection_test | intersect2dLine2dLine (const Vec2r &p1, const Vec2r &p2, const Vec2r &p3, const Vec2r &p4, Vec2r &res) |
| intersection_test | intersect2dSeg2dSegParametric (const Vec2r &p1, const Vec2r &p2, const Vec2r &p3, const Vec2r &p4, real &t, real &u, real epsilon) |
| bool | overlapPlaneBox (const Vec3r &normal, const real d, const Vec3r &maxbox) |
| bool | overlapTriangleBox (const Vec3r &boxcenter, const Vec3r &boxhalfsize, const Vec3r triverts[3]) |
| bool | intersectRayTriangle (const Vec3r &orig, const Vec3r &dir, const Vec3r &v0, const Vec3r &v1, const Vec3r &v2, real &t, real &u, real &v, const real epsilon) |
| intersection_test | intersectRayPlane (const Vec3r &orig, const Vec3r &dir, const Vec3r &norm, const real d, real &t, const real epsilon) |
| bool | intersectRayBBox (const Vec3r &orig, const Vec3r &dir, const Vec3r &boxMin, const Vec3r &boxMax, real t0, real t1, real &tmin, real &tmax, real) |
| bool | includePointTriangle (const Vec3r &P, const Vec3r &A, const Vec3r &B, const Vec3r &C) |
| void | transformVertex (const Vec3r &vert, const Matrix44r &matrix, Vec3r &res) |
| void | transformVertices (const vector< Vec3r > &vertices, const Matrix44r &trans, vector< Vec3r > &res) |
| Vec3r | rotateVector (const Matrix44r &mat, const Vec3r &v) |
| void | fromCoordAToCoordB (const Vec3r &p, Vec3r &q, const real transform[4][4]) |
| void | fromWorldToCamera (const Vec3r &p, Vec3r &q, const real model_view_matrix[4][4]) |
| void | fromCameraToRetina (const Vec3r &p, Vec3r &q, const real projection_matrix[4][4]) |
| void | fromRetinaToImage (const Vec3r &p, Vec3r &q, const int viewport[4]) |
| void | fromWorldToImage (const Vec3r &p, Vec3r &q, const real model_view_matrix[4][4], const real projection_matrix[4][4], const int viewport[4]) |
| void | fromWorldToImage (const Vec3r &p, Vec3r &q, const real transform[4][4], const int viewport[4]) |
| void | fromImageToRetina (const Vec3r &p, Vec3r &q, const int viewport[4]) |
| void | fromRetinaToCamera (const Vec3r &p, Vec3r &q, real focal, const real projection_matrix[4][4]) |
| void | fromCameraToWorld (const Vec3r &p, Vec3r &q, const real model_view_matrix[4][4]) |
| template<class T > | |
| real | distPointSegment (const T &P, const T &A, const T &B) |
| Enumerator | |
|---|---|
| DONT_INTERSECT | |
| DO_INTERSECT | |
| COLINEAR | |
| COINCIDENT | |
Definition at line 61 of file GeomUtils.h.
| real Freestyle::GeomUtils::distPointSegment | ( | const T & | P, |
| const T & | A, | ||
| const T & | B ) |
Computes the distance from a point P to a segment AB
Definition at line 32 of file GeomUtils.h.
Referenced by Freestyle::GridHelpers::distancePointToPolygon(), Freestyle::StrokeShaders::CurvePiece::error(), Freestyle::ViewMap::getClosestFEdge(), Freestyle::ViewMap::getClosestViewEdge(), and Freestyle::BlenderFileLoader::insertShapeNode().
| void Freestyle::GeomUtils::fromCameraToRetina | ( | const Vec3r & | p, |
| Vec3r & | q, | ||
| const real | projection_matrix[4][4] ) |
Projects from World Coordinates to retina coordinates Returns the point's coordinates expressed in Retina system. p point's coordinates expressed in camera system q vector in which the result will be stored projection_matrix The projection matrix expressed in line major order (OpenGL matrices are column major ordered)
Definition at line 659 of file GeomUtils.cpp.
References fromCoordAToCoordB().
Referenced by Freestyle::SilhouetteGeomEngine::CameraToImage(), fromWorldToImage(), and Freestyle::SilhouetteGeomEngine::ImageToWorldParameter().
| void Freestyle::GeomUtils::fromCameraToWorld | ( | const Vec3r & | p, |
| Vec3r & | q, | ||
| const real | model_view_matrix[4][4] ) |
Projects from camera coordinates to world coordinates Returns the point's coordinates expressed in the world's coordinates system. p point's coordinates expressed in the camera coordinates system q vector in which the result will be stored model_view_matrix The model view matrix expressed in line major order (OpenGL matrices are column major ordered)
Definition at line 721 of file GeomUtils.cpp.
|
inline |
Definition at line 819 of file GeomUtils.cpp.
Referenced by fromCameraToRetina(), fromWorldToCamera(), and fromWorldToImage().
From image to retina p point's coordinates expressed in image system q vector in which the result will be stored viewport The viewport: x,y coordinates followed by width and height (OpenGL like viewport).
Definition at line 700 of file GeomUtils.cpp.
Referenced by Freestyle::SilhouetteGeomEngine::ImageToWorldParameter().
| void Freestyle::GeomUtils::fromRetinaToCamera | ( | const Vec3r & | p, |
| Vec3r & | q, | ||
| real | focal, | ||
| const real | projection_matrix[4][4] ) |
computes the coordinates of q in the camera coordinates system, using the known z coordinates of the 3D point. That means that this method does not inverse any matrices, it only computes X and Y from x,y and Z) p point's coordinates expressed in retina system q vector in which the result will be stored projection_matrix The projection matrix expressed in line major order (OpenGL matrices are column major ordered)
Definition at line 707 of file GeomUtils.cpp.
From retina to image. Returns the coordinates expressed in Image coordinates system. p point's coordinates expressed in retina system q vector in which the result will be stored viewport The viewport: x,y coordinates followed by width and height (OpenGL like viewport).
Definition at line 664 of file GeomUtils.cpp.
Referenced by Freestyle::SilhouetteGeomEngine::CameraToImage(), fromWorldToImage(), and Freestyle::SilhouetteGeomEngine::ImageToWorldParameter().
| void Freestyle::GeomUtils::fromWorldToCamera | ( | const Vec3r & | p, |
| Vec3r & | q, | ||
| const real | model_view_matrix[4][4] ) |
Projects from world coordinates to camera coordinates Returns the point's coordinates expressed in the camera's coordinates system. p point's coordinates expressed in world coordinates system q vector in which the result will be stored model_view_matrix The model view matrix expressed in line major order (OpenGL matrices are column major ordered)
Definition at line 654 of file GeomUtils.cpp.
References fromCoordAToCoordB().
Referenced by fromWorldToImage(), and Freestyle::SilhouetteGeomEngine::ImageToWorldParameter().
| void Freestyle::GeomUtils::fromWorldToImage | ( | const Vec3r & | p, |
| Vec3r & | q, | ||
| const real | model_view_matrix[4][4], | ||
| const real | projection_matrix[4][4], | ||
| const int | viewport[4] ) |
From world to image p point's coordinates expressed in world coordinates system q vector in which the result will be stored model_view_matrix The model view matrix expressed in line major order (OpenGL matrices are column major ordered) projection_matrix The projection matrix expressed in line major order (OpenGL matrices are column major ordered) viewport The viewport: x,y coordinates followed by width and height (OpenGL like viewport)
Definition at line 676 of file GeomUtils.cpp.
References fromCameraToRetina(), fromRetinaToImage(), and fromWorldToCamera().
Referenced by Freestyle::SilhouetteGeomEngine::ProjectSilhouette(), and Freestyle::SilhouetteGeomEngine::WorldToImage().
| void Freestyle::GeomUtils::fromWorldToImage | ( | const Vec3r & | p, |
| Vec3r & | q, | ||
| const real | transform[4][4], | ||
| const int | viewport[4] ) |
From world to image p point's coordinates expressed in world coordinates system q vector in which the result will be stored transform The transformation matrix (gathering model view and projection), expressed in line major order (OpenGL matrices are column major ordered) viewport The viewport: x,y coordinates followed by width and height (OpenGL like viewport)
Definition at line 689 of file GeomUtils.cpp.
References fromCoordAToCoordB().
| bool Freestyle::GeomUtils::include2dSeg2dArea | ( | const Vec2r & | min, |
| const Vec2r & | max, | ||
| const Vec2r & | A, | ||
| const Vec2r & | B ) |
check whether a 2D segment is included in a 2D region or not
Definition at line 40 of file GeomUtils.cpp.
Referenced by Freestyle::ViewEdge::include_in_2d_area().
| intersection_test Freestyle::GeomUtils::intersect2dLine2dLine | ( | const Vec2r & | p1, |
| const Vec2r & | p2, | ||
| const Vec2r & | p3, | ||
| const Vec2r & | p4, | ||
| Vec2r & | res ) |
Definition at line 102 of file GeomUtils.cpp.
References COLINEAR, DO_INTERSECT, fabs(), and Freestyle::M_EPSILON.
Referenced by Freestyle::Strip::createStrip().
| bool Freestyle::GeomUtils::intersect2dSeg2dArea | ( | const Vec2r & | min, |
| const Vec2r & | max, | ||
| const Vec2r & | A, | ||
| const Vec2r & | B ) |
check whether a 2D segment intersect a 2D region or not
Definition at line 19 of file GeomUtils.cpp.
References A, B, intersect2dSegPoly(), and min.
Referenced by Freestyle::crossesProscenium(), Freestyle::ViewEdge::intersect_2d_area(), and Freestyle::Predicates1D::WithinImageBoundaryUP1D::operator()().
| intersection_test Freestyle::GeomUtils::intersect2dSeg2dSeg | ( | const Vec2r & | p1, |
| const Vec2r & | p2, | ||
| const Vec2r & | p3, | ||
| const Vec2r & | p4, | ||
| Vec2r & | res ) |
Definition at line 50 of file GeomUtils.cpp.
References COLINEAR, DO_INTERSECT, DONT_INTERSECT, fabs(), and Freestyle::M_EPSILON.
| intersection_test Freestyle::GeomUtils::intersect2dSeg2dSegParametric | ( | const Vec2r & | p1, |
| const Vec2r & | p2, | ||
| const Vec2r & | p3, | ||
| const Vec2r & | p4, | ||
| real & | t, | ||
| real & | u, | ||
| real | epsilon ) |
Definition at line 133 of file GeomUtils.cpp.
References COLINEAR, DO_INTERSECT, DONT_INTERSECT, and fabs().
Referenced by Freestyle::SweepLine< T, Point >::add().
Definition at line 749 of file GeomUtils.cpp.
References D, e, fabs(), Freestyle::M_EPSILON, N, and PERP.
Referenced by intersect2dSeg2dArea().
| bool Freestyle::GeomUtils::intersectRayBBox | ( | const Vec3r & | orig, |
| const Vec3r & | dir, | ||
| const Vec3r & | boxMin, | ||
| const Vec3r & | boxMax, | ||
| real | t0, | ||
| real | t1, | ||
| real & | tmin, | ||
| real & | tmax, | ||
| real | epsilon = M_EPSILON ) |
Intersection Ray-Bounding box (axis aligned). Adapted from Williams et al, "An Efficient Robust Ray-Box Intersection Algorithm", JGT 10:1 (2005), pp. 49-54.
Definition at line 531 of file GeomUtils.cpp.
References bounds(), Freestyle::VecMat::Vec3< T >::x(), Freestyle::VecMat::Vec3< T >::y(), and Freestyle::VecMat::Vec3< T >::z().
Referenced by Freestyle::Grid::initInfiniteRay().
| intersection_test Freestyle::GeomUtils::intersectRayPlane | ( | const Vec3r & | orig, |
| const Vec3r & | dir, | ||
| const Vec3r & | norm, | ||
| const real | d, | ||
| real & | t, | ||
| const real | epsilon = M_EPSILON ) |
Intersection between plane and ray.
Definition at line 501 of file GeomUtils.cpp.
References COINCIDENT, COLINEAR, DO_INTERSECT, DONT_INTERSECT, fabs(), and norm().
Referenced by Freestyle::ViewMapBuilder::ComputeRayCastingVisibility(), Freestyle::computeVisibility(), Freestyle::ViewMapBuilder::FindOccludee(), Freestyle::findOccludee(), and Freestyle::FEdgeXDetector::postProcessSuggestiveContourFace().
| bool Freestyle::GeomUtils::intersectRayTriangle | ( | const Vec3r & | orig, |
| const Vec3r & | dir, | ||
| const Vec3r & | v0, | ||
| const Vec3r & | v1, | ||
| const Vec3r & | v2, | ||
| real & | t, | ||
| real & | u, | ||
| real & | v, | ||
| const real | epsilon = M_EPSILON ) |
Fast, Minimum Storage Ray-Triangle Intersection.
Definition at line 430 of file GeomUtils.cpp.
Referenced by Freestyle::Geometry::Polygon3r::rayIntersect().
|
inline |
Definition at line 796 of file GeomUtils.cpp.
Referenced by overlapTriangleBox().
| bool Freestyle::GeomUtils::overlapTriangleBox | ( | const Vec3r & | boxcenter, |
| const Vec3r & | boxhalfsize, | ||
| const Vec3r | triverts[3] ) |
Box-triangle overlap test.
Definition at line 346 of file GeomUtils.cpp.
References AXISTEST_X01, AXISTEST_X2, AXISTEST_Y02, AXISTEST_Y1, AXISTEST_Z0, AXISTEST_Z12, fabs(), FINDMINMAX, max, min, overlapPlaneBox(), v2, X, and Y.
Referenced by Freestyle::Grid::insertOccluder(), and Freestyle::GridHelpers::insideProscenium().
Definition at line 638 of file GeomUtils.cpp.
References Freestyle::VecMat::Vec< T, N >::normalize(), and v.
| void Freestyle::GeomUtils::transformVertex | ( | const Vec3r & | vert, |
| const Matrix44r & | matrix, | ||
| Vec3r & | res ) |
Definition at line 613 of file GeomUtils.cpp.
References Freestyle::VecMat::HVec3< T >::x(), Freestyle::VecMat::HVec3< T >::y(), and Freestyle::VecMat::HVec3< T >::z().
Referenced by transformVertices().
| void Freestyle::GeomUtils::transformVertices | ( | const vector< Vec3r > & | vertices, |
| const Matrix44r & | trans, | ||
| vector< Vec3r > & | res ) |
Definition at line 629 of file GeomUtils.cpp.
References transformVertex().