#include <W3DRoadBuffer.h>
Public Member Functions | |
| W3DRoadBuffer (void) | |
| ~W3DRoadBuffer (void) | |
| void | loadRoads () |
| Loads the roads from the map objects list. | |
| void | clearAllRoads (void) |
| Empties the road buffer. | |
| void | drawRoads (CameraClass *camera, TextureClass *cloudTexture, TextureClass *noiseTexture, Bool wireframe, Int minX, Int maxX, Int minY, Int maxY, RefRenderObjListIterator *pDynamicLightsIterator) |
| Draws the roads. Uses terrain bounds for culling. | |
| void | setMap (WorldHeightMap *pMap) |
| Sets the map pointer. | |
| void | updateLighting (void) |
| Updates the diffuse lighting in the buffers. | |
| void | updateCenter (void) |
| Notifies that the camera moved. | |
Protected Member Functions | |
| void | addMapObjects (void) |
| void | addMapObject (RoadSegment *pRoad, Bool updateTheCounts) |
| void | adjustStacking (Int topUniqueID, Int bottomUniqueID) |
| Int | findCrossTypeJoinVector (Vector2 loc, Vector2 *joinVector, Int uniqueID) |
| void | flipTheRoad (RoadSegment *pRoad) |
| void | insertCurveSegmentAt (Int ndx1, Int ndx2) |
| Flips the loc1 and loc2 info. | |
| void | insertCrossTypeJoins (void) |
| void | insertJoinAt (Int ndx) |
| void | miter (Int ndx1, Int ndx2) |
| void | moveRoadSegTo (Int fromNdx, Int toNdx) |
| void | checkLinkAfter (Int ndx) |
| void | checkLinkBefore (Int ndx) |
| void | updateCounts (RoadSegment *pRoad) |
| void | updateCountsAndFlags (void) |
| void | insertCurveSegments (void) |
| void | insertTeeIntersections (void) |
| void | insertTee (Vector2 loc, Int index1, Real scale) |
| Bool | insertY (Vector2 loc, Int index1, Real scale) |
| void | insert4Way (Vector2 loc, Int index1, Real scale) |
| void | offset4Way (TRoadPt *pc1, TRoadPt *pc2, TRoadPt *pc3, TRoadPt *pr3, TRoadPt *pc4, Vector2 loc, Vector2 alignVector, Real widthInTexture) |
| void | offset3Way (TRoadPt *pc1, TRoadPt *pc2, TRoadPt *pc3, Vector2 loc, Vector2 upVector, Vector2 teeVector, Real widthInTexture) |
| void | offsetY (TRoadPt *pc1, TRoadPt *pc2, TRoadPt *pc3, Vector2 loc, Vector2 upVector, Real widthInTexture) |
| void | offsetH (TRoadPt *pc1, TRoadPt *pc2, TRoadPt *pc3, Vector2 loc, Vector2 upVector, Vector2 teeVector, Bool flip, Bool mirror, Real widthInTexture) |
| void | preloadRoadsInVertexAndIndexBuffers (void) |
| Fills the index and vertex buffers for drawing. | |
| void | preloadRoadSegment (RoadSegment *pRoad) |
| Fills the index and vertex buffers for drawing 1 segment. | |
| void | loadCurve (RoadSegment *pRoad, Vector2 loc1, Vector2 loc2, Real scale) |
| Fills the index and vertex buffers for drawing 1 fade. | |
| void | loadTee (RoadSegment *pRoad, Vector2 loc1, Vector2 loc2, Bool is4way, Real scale) |
| Fills the index and vertex buffers for drawing 1 tee intersection. | |
| void | loadY (RoadSegment *pRoad, Vector2 loc1, Vector2 loc2, Real scale) |
| Fills the index and vertex buffers for drawing 1 Y intersection. | |
| void | loadAlphaJoin (RoadSegment *pRoad, Vector2 loc1, Vector2 loc2, Real scale) |
| Fills the index and vertex buffers for drawing 1 alpha blend cap. | |
| void | loadH (RoadSegment *pRoad, Vector2 loc1, Vector2 loc2, Bool flip, Real scale) |
| Fills the index and vertex buffers for drawing 1 h tee intersection. | |
| void | loadFloatSection (RoadSegment *pRoad, Vector2 loc, Vector2 roadVector, Real height, Real left, Real right, Real uOffset, Real vOffset, Real scale) |
| void | loadFloat4PtSection (RoadSegment *pRoad, Vector2 loc, Vector2 roadNormal, Vector2 roadVector, Vector2 *cornersP, Real uOffset, Real vOffset, Real uScale, Real vScale) |
| void | loadLit4PtSection (RoadSegment *pRoad, UnsignedShort *ib, VertexFormatXYZDUV1 *vb, RefRenderObjListIterator *pDynamicLightsIterator) |
| void | loadRoadsInVertexAndIndexBuffers (void) |
| Fills the index and vertex buffers for drawing. | |
| void | loadLitRoadsInVertexAndIndexBuffers (RefRenderObjListIterator *pDynamicLightsIterator) |
| Fills the index and vertex buffers for drawing. | |
| void | loadRoadSegment (UnsignedShort *ib, VertexFormatXYZDUV1 *vb, RoadSegment *pRoad) |
| Fills the index and vertex buffers for drawing 1 segment. | |
| void | allocateRoadBuffers (void) |
| Allocates the buffers. | |
| void | freeRoadBuffers (void) |
| Frees the index and vertex buffers. | |
| Bool | visibilityChanged (const IRegion2D &bounds) |
| Returns true if some roads are now visible that weren't, or vice versa. | |
| void | rotateAbout (Vector2 *ptP, Vector2 center, Real angle) |
Protected Attributes | |
| RoadType * | m_roadTypes |
| Roads texture. | |
| RoadSegment * | m_roads |
| The road buffer. All roads are stored here. | |
| Int | m_numRoads |
| Number of roads used in m_roads. | |
| Bool | m_initialized |
| True if the subsystem initialized. | |
| WorldHeightMap * | m_map |
| Pointer to the height map data. | |
| RefRenderObjListIterator * | m_lightsIterator |
| Lighting iterator. | |
| Int | m_curUniqueID |
| Road type we are rendering at this pass. | |
| Int | m_curRoadType |
| Int | m_maxRoadSegments |
| Size of m_roads. | |
| Int | m_maxRoadVertex |
| Size of m_vertexRoad. | |
| Int | m_maxRoadIndex |
| Size of m_indexRoad. | |
| Int | m_maxRoadTypes |
| Size of m_roadTypes. | |
| Int | m_curNumRoadVertices |
| Number of vertices used in current road type. | |
| Int | m_curNumRoadIndices |
| Number of indices used in current road type;. | |
| Bool | m_updateBuffers |
| If true, update the vertex buffers. | |
Friends | |
| class | BaseHeightMapRenderObjClass |
Definition at line 195 of file W3DRoadBuffer.h.
| W3DRoadBuffer::W3DRoadBuffer | ( | void | ) |
Constructor.
Definition at line 3081 of file W3DRoadBuffer.cpp.
| W3DRoadBuffer::~W3DRoadBuffer | ( | void | ) |
Destructor. Releases w3d assets.
Definition at line 3070 of file W3DRoadBuffer.cpp.
|
protected |
Loads the roads from the map objects.
Definition at line 1519 of file W3DRoadBuffer.cpp.
|
protected |
Loads the roads from the map objects.
Definition at line 1606 of file W3DRoadBuffer.cpp.
Adjusts the stacking order.
Definition at line 2712 of file W3DRoadBuffer.cpp.
|
protected |
Allocates the buffers.
Allocates the index and vertex buffers.
Definition at line 3123 of file W3DRoadBuffer.cpp.
|
protected |
Checks to see if any segments need to link after this one.
Definition at line 1467 of file W3DRoadBuffer.cpp.
|
protected |
Checks to see if any segments need to link before this one.
Definition at line 1408 of file W3DRoadBuffer.cpp.
| void W3DRoadBuffer::clearAllRoads | ( | void | ) |
| void W3DRoadBuffer::drawRoads | ( | CameraClass * | camera, |
| TextureClass * | cloudTexture, | ||
| TextureClass * | noiseTexture, | ||
| Bool | wireframe, | ||
| Int | minX, | ||
| Int | maxX, | ||
| Int | minY, | ||
| Int | maxY, | ||
| RefRenderObjListIterator * | pDynamicLightsIterator ) |
Draws the roads. Uses terrain bounds for culling.
Draws the roads.
Definition at line 3287 of file W3DRoadBuffer.cpp.
|
protected |
Finds a road segment of different type && sets the join vector.
Definition at line 2656 of file W3DRoadBuffer.cpp.
|
inlineprotected |
Definition at line 243 of file W3DRoadBuffer.h.
|
protected |
Frees the index and vertex buffers.
Frees the index and vertex buffers.
Definition at line 3106 of file W3DRoadBuffer.cpp.
Inserts a 4 way intersection.
Definition at line 2427 of file W3DRoadBuffer.cpp.
|
protected |
Inserts alpha blend type joins at open ends.
Definition at line 2746 of file W3DRoadBuffer.cpp.
Flips the loc1 and loc2 info.
Insertes curves at the corner of 2 segments.
Definition at line 2881 of file W3DRoadBuffer.cpp.
|
protected |
Inserts curved segments along connected segments.
Definition at line 2627 of file W3DRoadBuffer.cpp.
|
protected |
Inserts a Tee intersection.
Definition at line 1780 of file W3DRoadBuffer.cpp.
|
protected |
Inserts Tee intersections at 3 way intersections.
Definition at line 2597 of file W3DRoadBuffer.cpp.
Inserts a Y intersection if the corner meets "Y" criteria.
Definition at line 1979 of file W3DRoadBuffer.cpp.
|
protected |
Fills the index and vertex buffers for drawing 1 alpha blend cap.
Loads an alpha join into the vertex buffer for a road join.
Definition at line 396 of file W3DRoadBuffer.cpp.
|
protected |
Fills the index and vertex buffers for drawing 1 fade.
Loads a curve segment into the vertex buffer for a road end cap or join.
Definition at line 1065 of file W3DRoadBuffer.cpp.
|
protected |
Loads a section of road using a mesh that floats a little above the terrain. The road is loaded into the quadrilateral defined by the 4 corners points. loc specifies the point where u==uOffset && v==vOffset, and the road vector gives the direction of the road, and the road normal is perpendicular to the road normal.
Definition at line 567 of file W3DRoadBuffer.cpp.
|
protected |
Loads a section of road using a mesh that floats a little above the terrain.
Definition at line 521 of file W3DRoadBuffer.cpp.
|
protected |
Fills the index and vertex buffers for drawing 1 h tee intersection.
Loads a h shaped tee into the vertex buffer for a road join.
Definition at line 474 of file W3DRoadBuffer.cpp.
|
protected |
Loads a section of road using a mesh that floats a little above the terrain. The road is loaded into the quadrilateral defined by the 4 corners points. loc specifies the point where u==uOffset && v==vOffset, and the road vector gives the direction of the road, and the road normal is perpendicular to the road normal.
Definition at line 789 of file W3DRoadBuffer.cpp.
|
protected |
Fills the index and vertex buffers for drawing.
Loads the roads into the vertex buffer for drawing.
Definition at line 1316 of file W3DRoadBuffer.cpp.
| void W3DRoadBuffer::loadRoads | ( | ) |
Loads the roads from the map objects list.
Loads the roads from the map objects.
Definition at line 3209 of file W3DRoadBuffer.cpp.
|
protected |
Fills the index and vertex buffers for drawing 1 segment.
Loads a road segment into the vertex buffer for drawing.
Definition at line 1358 of file W3DRoadBuffer.cpp.
|
protected |
Fills the index and vertex buffers for drawing.
Loads the roads into the vertex buffer for drawing.
Definition at line 1227 of file W3DRoadBuffer.cpp.
|
protected |
Fills the index and vertex buffers for drawing 1 tee intersection.
Loads a tee into the vertex buffer for a road join.
Definition at line 366 of file W3DRoadBuffer.cpp.
|
protected |
Fills the index and vertex buffers for drawing 1 Y intersection.
Loads a Y into the vertex buffer for a road join.
Definition at line 435 of file W3DRoadBuffer.cpp.
Adjusts the end points to create a smooth miter join between road segments.
Definition at line 2845 of file W3DRoadBuffer.cpp.
Moves a road segment.
Definition at line 1380 of file W3DRoadBuffer.cpp.
|
protected |
Offsets the points coming into a 3 way intersection so that they move to the join points of the 3 way intersection.
Definition at line 2184 of file W3DRoadBuffer.cpp.
|
protected |
Offsets the points coming into a 4 way intersection so that they move to the join points of the 4 way intersection.
Definition at line 2353 of file W3DRoadBuffer.cpp.
|
protected |
Offsets the points coming into a 3 way intersection so that they move to the join points of the 3 way intersection.
Definition at line 2235 of file W3DRoadBuffer.cpp.
|
protected |
Offsets the points coming into a 3 way intersection so that they move to the join points of the 3 way intersection.
Definition at line 2307 of file W3DRoadBuffer.cpp.
|
protected |
Fills the index and vertex buffers for drawing 1 segment.
Loads a road segment into the vertex buffer for drawing.
Definition at line 1142 of file W3DRoadBuffer.cpp.
|
protected |
Fills the index and vertex buffers for drawing.
Loads the roads into the vertex buffer for drawing.
Definition at line 1171 of file W3DRoadBuffer.cpp.
Rotates ptP about center.
Definition at line 3049 of file W3DRoadBuffer.cpp.
| void W3DRoadBuffer::setMap | ( | WorldHeightMap * | pMap | ) |
| void W3DRoadBuffer::updateCenter | ( | void | ) |
Notifies that the camera moved.
Sets the flag to reload the vertex buffer.
Definition at line 3277 of file W3DRoadBuffer.cpp.
|
protected |
Updates the count and last fields.
Definition at line 1688 of file W3DRoadBuffer.cpp.
|
protected |
Updates the count and last fields.
Definition at line 1733 of file W3DRoadBuffer.cpp.
| void W3DRoadBuffer::updateLighting | ( | void | ) |
Updates the diffuse lighting in the buffers.
Draws the roads. Uses terrain bounds to cull.
Definition at line 3235 of file W3DRoadBuffer.cpp.
Returns true if some roads are now visible that weren't, or vice versa.
Returns true if any road segment's visibility changed.
Definition at line 1273 of file W3DRoadBuffer.cpp.
|
friend |
Definition at line 197 of file W3DRoadBuffer.h.
|
protected |
Number of indices used in current road type;.
Definition at line 235 of file W3DRoadBuffer.h.
|
protected |
Number of vertices used in current road type.
Definition at line 234 of file W3DRoadBuffer.h.
|
protected |
Definition at line 224 of file W3DRoadBuffer.h.
|
protected |
Road type we are rendering at this pass.
Definition at line 223 of file W3DRoadBuffer.h.
|
protected |
True if the subsystem initialized.
Definition at line 220 of file W3DRoadBuffer.h.
|
protected |
Lighting iterator.
Definition at line 222 of file W3DRoadBuffer.h.
|
protected |
Pointer to the height map data.
Definition at line 221 of file W3DRoadBuffer.h.
|
protected |
Size of m_indexRoad.
Definition at line 232 of file W3DRoadBuffer.h.
|
protected |
Size of m_roads.
Definition at line 230 of file W3DRoadBuffer.h.
|
protected |
Size of m_roadTypes.
Definition at line 233 of file W3DRoadBuffer.h.
|
protected |
Size of m_vertexRoad.
Definition at line 231 of file W3DRoadBuffer.h.
|
protected |
Number of roads used in m_roads.
Definition at line 219 of file W3DRoadBuffer.h.
|
protected |
The road buffer. All roads are stored here.
Definition at line 218 of file W3DRoadBuffer.h.
|
protected |
Roads texture.
Definition at line 217 of file W3DRoadBuffer.h.
|
protected |
If true, update the vertex buffers.
Definition at line 237 of file W3DRoadBuffer.h.