From a patch and UV coordinate in [0,OrderS], [0,OrderT], retrieve the appropriate coordinate in neighborhood. More...
#include <patchuv_locator.h>
Classes | |
| struct | CUVBasis |
Public Member Functions | |
| void | build (const CPatch *patchCenter, sint edgeCenter, CPatch::CBindInfo &bindInfo) |
| uint | selectPatch (const NLMISC::CVector2f &uvIn) |
| void | locateUV (const NLMISC::CVector2f &uvIn, uint patch, CPatch *&patchOut, NLMISC::CVector2f &uvOut) |
| bool | sameEdgeOrder () const |
| return true only if the 2 edges have same number of tiles. | |
Private Attributes | |
| CPatch * | _CenterPatch |
| sint | _CenterPatchEdge |
| sint | _NPatchs |
| CPatch * | _NeighborPatch [4] |
| CUVBasis | _NeighborBasis [4] |
| bool | _SameEdgeOrder |
From a patch and UV coordinate in [0,OrderS], [0,OrderT], retrieve the appropriate coordinate in neighborhood.
Definition at line 43 of file patchuv_locator.h.
| void NL3D::CPatchUVLocator::build | ( | const CPatch * | patchCenter, | |
| sint | edgeCenter, | |||
| CPatch::CBindInfo & | bindInfo | |||
| ) |
Definition at line 36 of file patchuv_locator.cpp.
References _CenterPatch, _CenterPatchEdge, _NeighborBasis, _NeighborPatch, _NPatchs, _SameEdgeOrder, NL3D::CPatch::CBindInfo::Edge, NL3D::CPatch::getOrderForEdge(), NL3D::CPatch::getOrderS(), NL3D::CPatch::getOrderT(), NL3D::CPatch::CBindInfo::MultipleBindId, NL3D::CPatch::CBindInfo::MultipleBindNum, NL3D::CPatch::CBindInfo::Next, nlassert, NL3D::CPatch::CBindInfo::NPatchs, NLMISC::CVector2f::set(), NL3D::CPatchUVLocator::CUVBasis::UvI, NL3D::CPatchUVLocator::CUVBasis::UvJ, NL3D::CPatchUVLocator::CUVBasis::UvP, NLMISC::CVector2f::x, NLMISC::CVector2f::y, and NL3D::CPatch::CBindInfo::Zone.
Referenced by NL3D::CPatch::bind(), NL3D::CZoneCornerSmoother::buildPatchBindInfo(), NL3D::CPatch::computeContinousVertex(), NL3D::CPatch::computeDisplaceCornerSmooth(), NL3D::CPatch::computeDisplaceEdgeSmooth(), NL3D::CPatch::computeDisplaceRawOnNeighbor(), NL3D::CPatch::computeNearBlockLightmap(), NL3D::CPatch::computeNormalCornerSmooth(), NL3D::CPatch::computeNormalEdgeSmooth(), NL3D::CPatch::computeNormalOnNeighbor(), and NL3D::CPatch::computeTileLightmapPixelAroundCorner().
| void NL3D::CPatchUVLocator::locateUV | ( | const NLMISC::CVector2f & | uvIn, | |
| uint | patch, | |||
| CPatch *& | patchOut, | |||
| NLMISC::CVector2f & | uvOut | |||
| ) |
Definition at line 200 of file patchuv_locator.cpp.
References _NeighborBasis, _NeighborPatch, _NPatchs, and NL3D::CPatchUVLocator::CUVBasis::mulPoint().
Referenced by NL3D::CPatch::bind(), NL3D::CPatch::computeContinousVertex(), NL3D::CPatch::computeDisplaceCornerSmooth(), NL3D::CPatch::computeDisplaceEdgeSmooth(), NL3D::CPatch::computeDisplaceRawOnNeighbor(), NL3D::CPatch::computeNearBlockLightmap(), NL3D::CPatch::computeNormalCornerSmooth(), NL3D::CPatch::computeNormalEdgeSmooth(), NL3D::CPatch::computeNormalOnNeighbor(), and NL3D::CPatch::computeTileLightmapPixelAroundCorner().
| bool NL3D::CPatchUVLocator::sameEdgeOrder | ( | ) | const [inline] |
return true only if the 2 edges have same number of tiles.
bind 1/X case: return true only if ALL the adjacents patchs respect this rule. So you are sure that for all the src patch, one tile has exaclty one neighbor tile near him.
Definition at line 64 of file patchuv_locator.h.
References _SameEdgeOrder.
Referenced by NL3D::CZoneCornerSmoother::buildPatchBindInfo(), and NL3D::CPatch::computeNearBlockLightmap().
| uint NL3D::CPatchUVLocator::selectPatch | ( | const NLMISC::CVector2f & | uvIn | ) |
Definition at line 173 of file patchuv_locator.cpp.
References _CenterPatch, _CenterPatchEdge, _NPatchs, NLMISC::clamp(), NL3D::CPatch::getOrderS(), NL3D::CPatch::getOrderT(), NLMISC::CVector2f::x, and NLMISC::CVector2f::y.
Referenced by NL3D::CPatch::bind(), NL3D::CPatch::computeContinousVertex(), NL3D::CPatch::computeDisplaceCornerSmooth(), NL3D::CPatch::computeDisplaceEdgeSmooth(), NL3D::CPatch::computeDisplaceRawOnNeighbor(), NL3D::CPatch::computeNearBlockLightmap(), NL3D::CPatch::computeNormalCornerSmooth(), NL3D::CPatch::computeNormalEdgeSmooth(), NL3D::CPatch::computeNormalOnNeighbor(), and NL3D::CPatch::computeTileLightmapPixelAroundCorner().
CPatch* NL3D::CPatchUVLocator::_CenterPatch [private] |
Definition at line 80 of file patchuv_locator.h.
Referenced by build(), and selectPatch().
sint NL3D::CPatchUVLocator::_CenterPatchEdge [private] |
Definition at line 81 of file patchuv_locator.h.
Referenced by build(), and selectPatch().
CUVBasis NL3D::CPatchUVLocator::_NeighborBasis[4] [private] |
Definition at line 84 of file patchuv_locator.h.
Referenced by build(), and locateUV().
CPatch* NL3D::CPatchUVLocator::_NeighborPatch[4] [private] |
Definition at line 83 of file patchuv_locator.h.
Referenced by build(), and locateUV().
sint NL3D::CPatchUVLocator::_NPatchs [private] |
Definition at line 82 of file patchuv_locator.h.
Referenced by build(), locateUV(), and selectPatch().
bool NL3D::CPatchUVLocator::_SameEdgeOrder [private] |
Definition at line 85 of file patchuv_locator.h.
Referenced by build(), and sameEdgeOrder().
1.6.1