NL3D::CPatchInfo Struct Reference

The struct for building a patch. More...

#include <zone.h>

List of all members.

Classes

struct  CBindInfo
 A bind Info on a edge of a patch. More...

Public Member Functions

 CPatchInfo ()

Public Attributes

Patch texture.



std::vector< CTileElementTiles
 The Tiles for this patch.
std::vector< CTileColorTileColors
 The Tile colors for this patch.
std::vector< uint8Lumels
 The Tile lumels for this patch.
std::vector< CTileLightInfluenceTileLightInfluences
 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)

Detailed Description

The struct for building a patch.

NB: Different from the one which is stored.

Author:
Lionel Berenguier
Nevrax France
Date:
2000

Definition at line 89 of file zone.h.


Constructor & Destructor Documentation

NL3D::CPatchInfo::CPatchInfo (  )  [inline]

Definition at line 248 of file zone.h.

References _CornerSmoothFlag, ErrorSize, and NoiseRotation.


Member Function Documentation

bool NL3D::CPatchInfo::getCornerSmoothFlag ( uint  corner  )  const

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.

Parameters:
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
Returns:
false if no neighbor has been found or tile ratio is not the same than in this patch.

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.

bool NL3D::CPatchInfo::getSmoothFlag ( uint  edge  )  [inline]

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]
void NL3D::CPatchInfo::setCornerSmoothFlag ( uint  corner,
bool  smooth 
)

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().

void NL3D::CPatchInfo::setSmoothFlag ( uint  edge,
bool  flag 
) [inline]

Set the smooth flag for the n-th edge.

flag is false if this edge must by smoothed, true else.

Definition at line 187 of file zone.h.

References Flags.

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]

Member Data Documentation

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().

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().

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().

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().

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().

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().


The documentation for this struct was generated from the following files:

Generated on Thu Jan 7 08:30:14 2010 for NeL by  doxygen 1.6.1