|
Blender V4.5
|
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.
Computes the distance from a point P to a segment AB
Definition at line 32 of file GeomUtils.h.
References A, B, b, distPointSegment(), and P.
Referenced by Freestyle::GridHelpers::distancePointToPolygon(), distPointSegment(), 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 fromCameraToRetina(), and fromCoordAToCoordB().
Referenced by Freestyle::SilhouetteGeomEngine::CameraToImage(), fromCameraToRetina(), 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.
References fromCameraToWorld(), and i.
Referenced by fromCameraToWorld().
|
inline |
Definition at line 819 of file GeomUtils.cpp.
References fromCoordAToCoordB(), i, and transform().
Referenced by fromCameraToRetina(), fromCoordAToCoordB(), 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.
References fromImageToRetina().
Referenced by fromImageToRetina(), and 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.
References fromRetinaToCamera().
Referenced by fromRetinaToCamera().
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.
References fromRetinaToImage().
Referenced by Freestyle::SilhouetteGeomEngine::CameraToImage(), fromRetinaToImage(), 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(), and fromWorldToCamera().
Referenced by fromWorldToCamera(), 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(), fromWorldToCamera(), and fromWorldToImage().
Referenced by fromWorldToImage(), fromWorldToImage(), 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(), fromWorldToImage(), and transform().
| 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.
References A, B, include2dSeg2dArea(), max, and min.
Referenced by include2dSeg2dArea(), and Freestyle::ViewEdge::include_in_2d_area().
| bool Freestyle::GeomUtils::includePointTriangle | ( | const Vec3r & | P, |
| const Vec3r & | A, | ||
| const Vec3r & | B, | ||
| const Vec3r & | C ) |
Checks whether 3D point P lies inside or outside of the triangle ABC
Definition at line 580 of file GeomUtils.cpp.
References A, B, includePointTriangle(), K, L, N, and P.
Referenced by includePointTriangle().
| 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(), intersect2dLine2dLine(), and num.
Referenced by Freestyle::Strip::createStrip(), and intersect2dLine2dLine().
| 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, intersect2dSeg2dArea(), intersect2dSegPoly(), max, and min.
Referenced by Freestyle::crossesProscenium(), intersect2dSeg2dArea(), 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(), intersect2dSeg2dSeg(), and num.
Referenced by intersect2dSeg2dSeg().
| 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, fabs(), intersect2dSeg2dSegParametric(), and num.
Referenced by Freestyle::SweepLine< T, Point >::add(), and intersect2dSeg2dSegParametric().
Definition at line 749 of file GeomUtils.cpp.
References D, e, fabs(), i, intersect2dSegPoly(), N, and PERP.
Referenced by intersect2dSeg2dArea(), and intersect2dSegPoly().
| 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 intersectRayBBox(), sign(), Freestyle::VecMat::Vec3< T >::x(), Freestyle::VecMat::Vec3< T >::y(), and Freestyle::VecMat::Vec3< T >::z().
Referenced by Freestyle::Grid::initInfiniteRay(), and intersectRayBBox().
| 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(), intersectRayPlane(), and norm().
Referenced by Freestyle::ViewMapBuilder::ComputeRayCastingVisibility(), Freestyle::computeVisibility(), Freestyle::ViewMapBuilder::FindOccludee(), Freestyle::findOccludee(), intersectRayPlane(), 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.
References intersectRayTriangle(), v, and v2.
Referenced by intersectRayTriangle(), and Freestyle::Geometry::Polygon3r::rayIntersect().
|
inline |
Definition at line 796 of file GeomUtils.cpp.
References overlapPlaneBox(), X, and Z.
Referenced by overlapPlaneBox(), and 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(), overlapTriangleBox(), v2, X, Y, and Z.
Referenced by Freestyle::Grid::insertOccluder(), Freestyle::GridHelpers::insideProscenium(), and overlapTriangleBox().
Definition at line 638 of file GeomUtils.cpp.
References i, Freestyle::VecMat::Vec< T, N >::normalize(), rotateVector(), and v.
Referenced by rotateVector().
| void Freestyle::GeomUtils::transformVertex | ( | const Vec3r & | vert, |
| const Matrix44r & | matrix, | ||
| Vec3r & | res ) |
Definition at line 613 of file GeomUtils.cpp.
References i, transformVertex(), Freestyle::VecMat::HVec3< T >::x(), Freestyle::VecMat::HVec3< T >::y(), and Freestyle::VecMat::HVec3< T >::z().
Referenced by transformVertex(), and transformVertices().
| void Freestyle::GeomUtils::transformVertices | ( | const vector< Vec3r > & | vertices, |
| const Matrix44r & | trans, | ||
| vector< Vec3r > & | res ) |
Definition at line 629 of file GeomUtils.cpp.
References i, transformVertex(), and transformVertices().
Referenced by transformVertices().