The struct for building a patch. More...
#include <zone.h>
Classes | |
| struct | CBindInfo |
| A bind Info on a edge of a patch. More... | |
Public Member Functions | |
| CPatchInfo () | |
Public Attributes | |
Patch texture. | |
| std::vector< CTileElement > | Tiles |
| The Tiles for this patch. | |
| std::vector< CTileColor > | TileColors |
| The Tile colors for this patch. | |
| std::vector< uint8 > | Lumels |
| The Tile lumels for this patch. | |
| std::vector< CTileLightInfluence > | TileLightInfluences |
| There is (OrderS/2+1) * (OrderT/2+1) tiles light influence. | |
Patch Binding. | |
| CBindInfo | BindEdges [4] |
Private Attributes | |
| uint8 | _CornerSmoothFlag |
Patch geometry. | |
|
| |
| CBezierPatch | Patch |
| The patch coordinates. | |
| uint8 | OrderS |
| Tile Order for the patch. | |
| uint8 | OrderT |
| float | ErrorSize |
| The Base Size*bumpiness of the patch (/2 at each subdivide). Set to 0, if you want CZone to compute it for you. | |
| uint16 | BaseVertices [4] |
| The base corner vertices indices in the current zone. Used for patch connectivity. | |
| uint8 | Flags |
| "The don't smooth" flags. | |
| uint8 | NoiseRotation |
| The orientation of the NoiseMap. 0,1,2,3. This represent a CCW rotation of the NoiseMap. | |
| void | setCornerSmoothFlag (uint corner, bool smooth) |
| setup NoiseSmooth flags: used for Noise geometry and lighting. NB: convention: corner0==A, corner1==B ... | |
| bool | getCornerSmoothFlag (uint corner) const |
Smooth flags methods | |
|
| |
| void | setSmoothFlag (uint edge, bool flag) |
| Set the smooth flag for the n-th edge. | |
| bool | getSmoothFlag (uint edge) |
| Get the smooth flag for the n-th edge. | |
| bool | getNeighborTile (uint patchId, uint edge, sint position, uint &patchOut, sint &sOut, sint &tOut, const std::vector< CPatchInfo > &patchInfos) const |
| Get neighbor tile across a edge. | |
| static bool | transform (std::vector< CPatchInfo > &patchInfo, NL3D::CZoneSymmetrisation &zoneSymmetry, const NL3D::CTileBank &bank, bool symmetry, uint rotate, float snapCell, float weldThreshold, const NLMISC::CMatrix &toOriginalSpace) |
| Adjusts a CPatchInfo array to get a symmetrized / rotated zone with matching oriented tiles. | |
| static bool | getTileSymmetryRotate (const NL3D::CTileBank &bank, uint tile, bool &symmetry, uint &rotate) |
| static bool | transformTile (const NL3D::CTileBank &bank, uint &tile, uint &tileRotation, bool symmetry, uint rotate, bool goofy) |
| static void | transform256Case (const NL3D::CTileBank &bank, uint8 &case256, uint tileRotation, bool symmetry, uint rotate, bool goofy) |
The struct for building a patch.
NB: Different from the one which is stored.
Definition at line 89 of file zone.h.
| NL3D::CPatchInfo::CPatchInfo | ( | ) | [inline] |
Definition at line 248 of file zone.h.
References _CornerSmoothFlag, ErrorSize, and NoiseRotation.
Definition at line 65 of file zone.cpp.
References _CornerSmoothFlag, and nlassert.
Referenced by NL3D::CZone::build().
| bool NL3D::CPatchInfo::getNeighborTile | ( | uint | patchId, | |
| uint | edge, | |||
| sint | position, | |||
| uint & | patchOut, | |||
| sint & | sOut, | |||
| sint & | tOut, | |||
| const std::vector< CPatchInfo > & | patchInfos | |||
| ) | const |
Get neighbor tile across a edge.
| patchid | is the id of this patch | |
| edge | is the edge shared with the neigbor | |
| position | is the position over the edge in CCW across the patch. So if edge == 0, position is oriented like OT So if edge == 1, position is oriented like OS So if edge == 2, position is oriented like -OT So if edge == 3, position is oriented like -OS | |
| patchOut | will be filled with the output patch id | |
| sOut | will be filled with the output patch s coordinate | |
| tOut | will be filled with the output patch t coordinate | |
| patchInfos | is the vector of all patch info |
Definition at line 1549 of file zone.cpp.
References BindEdges, NL3D::CPatchInfo::CBindInfo::Edge, NLMISC::Next(), NL3D::CPatchInfo::CBindInfo::Next, nlassert, NL3D::CPatchInfo::CBindInfo::NPatchs, OrderS, and OrderT.
Get the smooth flag for the n-th edge.
Return true if this edge must by smoothed, false else.
Definition at line 199 of file zone.h.
References Flags.
Referenced by NL3D::CZoneTgtSmoother::makeVerticesCoplanar(), NL3D::CZoneSmoother::smoothTangents(), and transform().
| bool NL3D::CPatchInfo::getTileSymmetryRotate | ( | const NL3D::CTileBank & | bank, | |
| uint | tile, | |||
| bool & | symmetry, | |||
| uint & | rotate | |||
| ) | [static] |
Definition at line 1665 of file zone.cpp.
References NL3D::CTileSet::getOriented(), NL3D::CTileBank::getTileCount(), NL3D::CTileBank::getTileSet(), NL3D::CTileBank::getTileSetCount(), NL3D::CTileBank::getTileXRef(), and nlwarning.
Referenced by transform().
setup NoiseSmooth flags: used for Noise geometry and lighting. NB: convention: corner0==A, corner1==B ...
Definition at line 54 of file zone.cpp.
References _CornerSmoothFlag, and nlassert.
Referenced by NL3D::CZone::retrieve().
| bool NL3D::CPatchInfo::transform | ( | std::vector< CPatchInfo > & | patchInfo, | |
| NL3D::CZoneSymmetrisation & | zoneSymmetry, | |||
| const NL3D::CTileBank & | bank, | |||
| bool | symmetry, | |||
| uint | rotate, | |||
| float | snapCell, | |||
| float | weldThreshold, | |||
| const NLMISC::CMatrix & | toOriginalSpace | |||
| ) | [static] |
Adjusts a CPatchInfo array to get a symmetrized / rotated zone with matching oriented tiles.
This method only adjuste tile and vertex color array, does'nt transform vertices.
Transform an array of patchInfo by a symmetry on OY axis followed by a 90deg CCW rotation (0, 1, 2, 3).
The method doesn't transform vertices. If symmetry, the method invert 0-3 and 1-2 vertices indexes to get CCW oriented patches. It will fix bind informations. The method fixes tile and color vertex arrays. The method fixes tile rotation, 256 cases and tile transistions.
Return false if something wrong.
Definition at line 1823 of file zone.cpp.
References BaseVertices, BindEdges, NL3D::CZoneSymmetrisation::build(), NL3D::CPatchInfo::CBindInfo::Edge, Flags, getSmoothFlag(), NL3D::CZoneSymmetrisation::getTileState(), getTileSymmetryRotate(), NL3D::CZoneSymmetrisation::Goofy, NL3D::CBezierPatch::Interiors, NL3D::CPatchInfo::CBindInfo::Next, nlwarning, NL3D::CPatchInfo::CBindInfo::NPatchs, OrderS, OrderT, Patch, NL3D::CBezierPatch::Tangents, TileColors, Tiles, transform256Case(), transformTile(), and NL3D::CBezierPatch::Vertices.
| void NL3D::CPatchInfo::transform256Case | ( | const NL3D::CTileBank & | bank, | |
| uint8 & | case256, | |||
| uint | tileRotation, | |||
| bool | symmetry, | |||
| uint | rotate, | |||
| bool | goofy | |||
| ) | [static] |
Definition at line 1797 of file zone.cpp.
Referenced by transform().
| bool NL3D::CPatchInfo::transformTile | ( | const NL3D::CTileBank & | bank, | |
| uint & | tile, | |||
| uint & | tileRotation, | |||
| bool | symmetry, | |||
| uint | rotate, | |||
| bool | goofy | |||
| ) | [static] |
Definition at line 1706 of file zone.cpp.
References NL3D::CTileSet::bottom, NL3D::CTileSet::count, NL3D::CTileSet::getEdgeType(), NL3D::CTileSet::getInvertBorder(), NL3D::CTileSet::getOrientedBorder(), NL3D::CTileSetTransition::getTile(), NL3D::CTileBank::getTileCount(), NL3D::CTileBank::getTileSet(), NL3D::CTileBank::getTileXRef(), NL3D::CTileSet::getTransition(), NL3D::CTileSet::getTransitionTile(), NL3D::CTileSet::left, nlassert, NL3D::CTileSet::notfound, NL3D::CTileSet::right, NL3D::CTileSet::top, and NL3D::CTileBank::transition.
Referenced by transform().
uint8 NL3D::CPatchInfo::_CornerSmoothFlag [private] |
Definition at line 258 of file zone.h.
Referenced by CPatchInfo(), getCornerSmoothFlag(), and setCornerSmoothFlag().
The base corner vertices indices in the current zone. Used for patch connectivity.
Definition at line 133 of file zone.h.
Referenced by NL3D::CZone::build(), NL3D::CZoneTgtSmoother::makeVerticesCoplanar(), NL3D::CZone::retrieve(), and transform().
Definition at line 243 of file zone.h.
Referenced by NL3D::CZone::build(), getNeighborTile(), NL3D::CZoneTgtSmoother::makeVerticesCoplanar(), NL3D::CZone::retrieve(), NL3D::CZoneSmoother::smoothTangents(), and transform().
The Base Size*bumpiness of the patch (/2 at each subdivide). Set to 0, if you want CZone to compute it for you.
Definition at line 131 of file zone.h.
Referenced by NL3D::CZone::build(), CPatchInfo(), and NL3D::CZone::retrieve().
"The don't smooth" flags.
For each edge of the patch (0~3), the flag means that this patch mustn't be smoothed with its neightbor. The n-th edge links the vertices "n" and "(n+1)%4". The flag for the n-th edge is (1<<n).
Definition at line 137 of file zone.h.
Referenced by NL3D::CZone::build(), getSmoothFlag(), NL3D::CZone::retrieve(), setSmoothFlag(), and transform().
| std::vector<uint8> NL3D::CPatchInfo::Lumels |
The Tile lumels for this patch.
There must be (OrderS*4+1)*(OrderT*4+1) tile lumels. Those are lumel value in tiles. There is 4x4 lumels by tiles plus last lumels. They are stored in line first order, from S=0 to 1, and T=0 to 1.
Definition at line 168 of file zone.h.
Referenced by NL3D::CZone::build(), NL3D::CZoneLighter::processCalc(), and NL3D::CZone::retrieve().
The orientation of the NoiseMap. 0,1,2,3. This represent a CCW rotation of the NoiseMap.
Definition at line 141 of file zone.h.
Referenced by NL3D::CZone::build(), CPatchInfo(), and NL3D::CZone::retrieve().
Tile Order for the patch.
Definition at line 129 of file zone.h.
Referenced by NL3D::CZoneSymmetrisation::build(), NL3D::CZone::build(), getNeighborTile(), NL3D::CZoneSymmetrisation::propagateTileState(), NL3D::CZone::retrieve(), NL3D::CZoneSymmetrisation::setOrientedTileState(), NL3D::CZoneSymmetrisation::setTileState(), NL3D::st2uv(), transform(), and NL3D::uv2st().
Definition at line 129 of file zone.h.
Referenced by NL3D::CZoneSymmetrisation::build(), NL3D::CZone::build(), getNeighborTile(), NL3D::CZone::retrieve(), NL3D::CZoneSymmetrisation::setOrientedTileState(), NL3D::CZoneSymmetrisation::setTileState(), NL3D::st2uv(), transform(), and NL3D::uv2st().
The patch coordinates.
Definition at line 127 of file zone.h.
Referenced by NL3D::CZone::build(), NL3D::CZoneTgtSmoother::makeVerticesCoplanar(), NL3D::CZone::retrieve(), NL3D::CZoneSymmetrisation::setOrientedTileState(), NL3D::CZoneSymmetrisation::setTileState(), NL3D::CZoneSmoother::smoothTangents(), and transform().
| std::vector<CTileColor> NL3D::CPatchInfo::TileColors |
The Tile colors for this patch.
There must be (OrderS+1)*(OrderT+1) tile colors. Those are the colors at the corners of the tiles. They are stored in line first order, from S=0 to 1, and T=0 to 1.
Definition at line 162 of file zone.h.
Referenced by NL3D::CZone::build(), NL3D::CZone::retrieve(), and transform().
| std::vector<CTileLightInfluence> NL3D::CPatchInfo::TileLightInfluences |
There is (OrderS/2+1) * (OrderT/2+1) tiles light influence.
It indicates which static pointLight influence each corner of a TessBlock (block of 2*2 tiles).
If size()==0, suppose no light influence. but CZone::retrieve() always return a size() == (OrderS/2+1) * (OrderT/2+1).
They are stored in line first order, from S=0 to 1, and T=0 to 1.
Definition at line 178 of file zone.h.
Referenced by NL3D::CZone::build(), NL3D::CZoneLighter::processZonePointLightRT(), and NL3D::CZone::retrieve().
| std::vector<CTileElement> NL3D::CPatchInfo::Tiles |
The Tiles for this patch.
There must be OrderS*OrderT tiles. They are stored in line first order, from S=0 to 1, and T=0 to 1.
Definition at line 156 of file zone.h.
Referenced by NL3D::CZone::build(), NL3D::CZoneSymmetrisation::propagateTileState(), NL3D::CZone::retrieve(), NL3D::CZoneSymmetrisation::setOrientedTileState(), NL3D::CZoneSymmetrisation::setTileState(), and transform().
1.6.1