Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
W3DBridge Class Reference

The individual data for a bridge. More...

#include <W3DBridgeBuffer.h>

Public Member Functions

 W3DBridge (void)
 
 ~W3DBridge (void)
 
void init (Vector3 fromLoc, Vector3 toLoc, AsciiString name)
 
AsciiString getTemplateName (void)
 
const Vector3 * getStart (void) const
 
const Vector3 * getEnd (void) const
 
Bool load (enum BodyDamageType curDamageState)
 
enum BodyDamageType getDamageState (void)
 
void setDamageState (enum BodyDamageType state)
 
void getIndicesNVertices (UnsignedShort *destination_ib, VertexFormatXYZNDUV1 *destination_vb, Int *curIndexP, Int *curVertexP, RefRenderObjListIterator *pLightsIterator)
 
Bool cullBridge (CameraClass *camera)
 Culls the bridges. Returns true if visibility changed.
 
void clearBridge (void)
 Frees all objects associated with a bridge.
 
Bool isVisible (void)
 
Bool isEnabled (void)
 
void setEnabled (Bool enable)
 
void renderBridge (Bool wireframe)
 
void getBridgeInfo (BridgeInfo *pInfo)
 

Protected Member Functions

Int getModelVerticesFixed (VertexFormatXYZNDUV1 *destination_vb, Int curVertex, const Matrix3D &mtx, MeshClass *pMesh, RefRenderObjListIterator *pLightsIterator)
 
Int getModelIndices (UnsignedShort *destination_ib, Int curIndex, Int vertexOffset, MeshClass *pMesh)
 
Int getModelVertices (VertexFormatXYZNDUV1 *destination_vb, Int curVertex, Real xOffset, Vector3 &vec, Vector3 &vecNormal, Vector3 &vecZ, Vector3 &offset, const Matrix3D &mtx, MeshClass *pMesh, RefRenderObjListIterator *pLightsIterator)
 

Protected Attributes

Vector3 m_start
 Drawing location.
 
Vector3 m_end
 Drawing location.
 
Real m_scale
 Width scale.
 
Real m_length
 
TBridgeType m_bridgeType
 Type of bridge. Currently only 2 supported.
 
SphereClass m_bounds
 Bounding sphere for culling to set the visible flag.
 
TextureClass * m_bridgeTexture
 
MeshClass * m_leftMesh
 W3D mesh models for the bridges.
 
Matrix3D m_leftMtx
 Transform for the left mesh.
 
Real m_minY
 min y vertex.
 
Real m_maxY
 max y vertex.
 
Real m_leftMinX
 m_leftMesh min x vertex.
 
Real m_leftMaxX
 m_leftMesh max x vertex.
 
MeshClass * m_sectionMesh
 W3D mesh models for the bridges.
 
Matrix3D m_sectionMtx
 Transform for the section mesh.
 
Real m_sectionMinX
 m_sectionMesh min x vertex.
 
Real m_sectionMaxX
 m_sectionMesh max x vertex.
 
MeshClass * m_rightMesh
 W3D mesh models for the bridges.
 
Matrix3D m_rightMtx
 Transform for the right mesh.
 
Real m_rightMinX
 m_rightMesh min x vertex.
 
Real m_rightMaxX
 m_rightMesh max x vertex.
 
Int m_firstIndex
 Starting index buffer.
 
Int m_numVertex
 Number of vertex used.
 
Int m_firstVertex
 First vertex.
 
Int m_numPolygons
 Number of polygons to draw.
 
Bool m_visible
 
AsciiString m_templateName
 Name of the bridge type.
 
enum BodyDamageType m_curDamageState
 
Bool m_enabled
 

Detailed Description

The individual data for a bridge.

Definition at line 84 of file W3DBridgeBuffer.h.

Constructor & Destructor Documentation

◆ W3DBridge()

W3DBridge::W3DBridge ( void )

Initializes pointers & values.

Definition at line 110 of file W3DBridgeBuffer.cpp.

◆ ~W3DBridge()

W3DBridge::~W3DBridge ( void )

Frees objects.

Definition at line 126 of file W3DBridgeBuffer.cpp.

Member Function Documentation

◆ clearBridge()

void W3DBridge::clearBridge ( void )

Frees all objects associated with a bridge.

Frees all bridge objects (meshes & texture).

Definition at line 151 of file W3DBridgeBuffer.cpp.

◆ cullBridge()

Bool W3DBridge::cullBridge ( CameraClass * camera)

Culls the bridges. Returns true if visibility changed.

Culls bridge to camera.

Todo
  • cull bridges.

Definition at line 165 of file W3DBridgeBuffer.cpp.

◆ getBridgeInfo()

void W3DBridge::getBridgeInfo ( BridgeInfo * pInfo)

Gets the location info for the bridge.

Definition at line 363 of file W3DBridgeBuffer.cpp.

◆ getDamageState()

enum BodyDamageType W3DBridge::getDamageState ( void )
inline

Definition at line 134 of file W3DBridgeBuffer.h.

◆ getEnd()

const Vector3 * W3DBridge::getEnd ( void ) const
inline

Definition at line 132 of file W3DBridgeBuffer.h.

◆ getIndicesNVertices()

void W3DBridge::getIndicesNVertices ( UnsignedShort * destination_ib,
VertexFormatXYZNDUV1 * destination_vb,
Int * curIndexP,
Int * curVertexP,
RefRenderObjListIterator * pLightsIterator )

Gets the index values and vertex values for a bridge.

Definition at line 515 of file W3DBridgeBuffer.cpp.

◆ getModelIndices()

Int W3DBridge::getModelIndices ( UnsignedShort * destination_ib,
Int curIndex,
Int vertexOffset,
MeshClass * pMesh )
protected

Gets the index values for a particular mesh section of the bridge.

Definition at line 640 of file W3DBridgeBuffer.cpp.

◆ getModelVertices()

Int W3DBridge::getModelVertices ( VertexFormatXYZNDUV1 * destination_vb,
Int curVertex,
Real xOffset,
Vector3 & vec,
Vector3 & vecNormal,
Vector3 & vecZ,
Vector3 & offset,
const Matrix3D & mtx,
MeshClass * pMesh,
RefRenderObjListIterator * pLightsIterator )
protected

Gets the vertex values for a section of a bridge.

Definition at line 407 of file W3DBridgeBuffer.cpp.

◆ getModelVerticesFixed()

Int W3DBridge::getModelVerticesFixed ( VertexFormatXYZNDUV1 * destination_vb,
Int curVertex,
const Matrix3D & mtx,
MeshClass * pMesh,
RefRenderObjListIterator * pLightsIterator )
protected

Gets the vertex values for a section of a fixed bridge.

Definition at line 487 of file W3DBridgeBuffer.cpp.

◆ getStart()

const Vector3 * W3DBridge::getStart ( void ) const
inline

Definition at line 131 of file W3DBridgeBuffer.h.

◆ getTemplateName()

AsciiString W3DBridge::getTemplateName ( void )
inline

Definition at line 130 of file W3DBridgeBuffer.h.

◆ init()

void W3DBridge::init ( Vector3 fromLoc,
Vector3 toLoc,
AsciiString bridgeTemplateName )

Inits a bridges location & type so it can be load'ed.

Definition at line 183 of file W3DBridgeBuffer.cpp.

◆ isEnabled()

Bool W3DBridge::isEnabled ( void )
inline

Definition at line 140 of file W3DBridgeBuffer.h.

◆ isVisible()

Bool W3DBridge::isVisible ( void )
inline

Definition at line 139 of file W3DBridgeBuffer.h.

◆ load()

Bool W3DBridge::load ( enum BodyDamageType curDamageState)

Loads a bridge model(if not already loaded) and gets meshes for use at specified location.

Todo
, should these be defaults in INI??? CBD

Definition at line 197 of file W3DBridgeBuffer.cpp.

◆ renderBridge()

void W3DBridge::renderBridge ( Bool wireframe)

Renders the bride. It is assumed that the shared vertex and index buffers are already set.

Definition at line 137 of file W3DBridgeBuffer.cpp.

◆ setDamageState()

void W3DBridge::setDamageState ( enum BodyDamageType state)
inline

Definition at line 135 of file W3DBridgeBuffer.h.

◆ setEnabled()

void W3DBridge::setEnabled ( Bool enable)
inline

Definition at line 141 of file W3DBridgeBuffer.h.

Member Data Documentation

◆ m_bounds

SphereClass W3DBridge::m_bounds
protected

Bounding sphere for culling to set the visible flag.

Definition at line 92 of file W3DBridgeBuffer.h.

◆ m_bridgeTexture

TextureClass* W3DBridge::m_bridgeTexture
protected

Definition at line 93 of file W3DBridgeBuffer.h.

◆ m_bridgeType

TBridgeType W3DBridge::m_bridgeType
protected

Type of bridge. Currently only 2 supported.

Definition at line 91 of file W3DBridgeBuffer.h.

◆ m_curDamageState

enum BodyDamageType W3DBridge::m_curDamageState
protected

Definition at line 114 of file W3DBridgeBuffer.h.

◆ m_enabled

Bool W3DBridge::m_enabled
protected

Definition at line 115 of file W3DBridgeBuffer.h.

◆ m_end

Vector3 W3DBridge::m_end
protected

Drawing location.

Definition at line 88 of file W3DBridgeBuffer.h.

◆ m_firstIndex

Int W3DBridge::m_firstIndex
protected

Starting index buffer.

Definition at line 108 of file W3DBridgeBuffer.h.

◆ m_firstVertex

Int W3DBridge::m_firstVertex
protected

First vertex.

Definition at line 110 of file W3DBridgeBuffer.h.

◆ m_leftMaxX

Real W3DBridge::m_leftMaxX
protected

m_leftMesh max x vertex.

Definition at line 99 of file W3DBridgeBuffer.h.

◆ m_leftMesh

MeshClass* W3DBridge::m_leftMesh
protected

W3D mesh models for the bridges.

Definition at line 94 of file W3DBridgeBuffer.h.

◆ m_leftMinX

Real W3DBridge::m_leftMinX
protected

m_leftMesh min x vertex.

Definition at line 98 of file W3DBridgeBuffer.h.

◆ m_leftMtx

Matrix3D W3DBridge::m_leftMtx
protected

Transform for the left mesh.

Definition at line 95 of file W3DBridgeBuffer.h.

◆ m_length

Real W3DBridge::m_length
protected

Definition at line 90 of file W3DBridgeBuffer.h.

◆ m_maxY

Real W3DBridge::m_maxY
protected

max y vertex.

Definition at line 97 of file W3DBridgeBuffer.h.

◆ m_minY

Real W3DBridge::m_minY
protected

min y vertex.

Definition at line 96 of file W3DBridgeBuffer.h.

◆ m_numPolygons

Int W3DBridge::m_numPolygons
protected

Number of polygons to draw.

Definition at line 111 of file W3DBridgeBuffer.h.

◆ m_numVertex

Int W3DBridge::m_numVertex
protected

Number of vertex used.

Definition at line 109 of file W3DBridgeBuffer.h.

◆ m_rightMaxX

Real W3DBridge::m_rightMaxX
protected

m_rightMesh max x vertex.

Definition at line 107 of file W3DBridgeBuffer.h.

◆ m_rightMesh

MeshClass* W3DBridge::m_rightMesh
protected

W3D mesh models for the bridges.

Definition at line 104 of file W3DBridgeBuffer.h.

◆ m_rightMinX

Real W3DBridge::m_rightMinX
protected

m_rightMesh min x vertex.

Definition at line 106 of file W3DBridgeBuffer.h.

◆ m_rightMtx

Matrix3D W3DBridge::m_rightMtx
protected

Transform for the right mesh.

Definition at line 105 of file W3DBridgeBuffer.h.

◆ m_scale

Real W3DBridge::m_scale
protected

Width scale.

Definition at line 89 of file W3DBridgeBuffer.h.

◆ m_sectionMaxX

Real W3DBridge::m_sectionMaxX
protected

m_sectionMesh max x vertex.

Definition at line 103 of file W3DBridgeBuffer.h.

◆ m_sectionMesh

MeshClass* W3DBridge::m_sectionMesh
protected

W3D mesh models for the bridges.

Definition at line 100 of file W3DBridgeBuffer.h.

◆ m_sectionMinX

Real W3DBridge::m_sectionMinX
protected

m_sectionMesh min x vertex.

Definition at line 102 of file W3DBridgeBuffer.h.

◆ m_sectionMtx

Matrix3D W3DBridge::m_sectionMtx
protected

Transform for the section mesh.

Definition at line 101 of file W3DBridgeBuffer.h.

◆ m_start

Vector3 W3DBridge::m_start
protected

Drawing location.

Definition at line 87 of file W3DBridgeBuffer.h.

◆ m_templateName

AsciiString W3DBridge::m_templateName
protected

Name of the bridge type.

Definition at line 113 of file W3DBridgeBuffer.h.

◆ m_visible

Bool W3DBridge::m_visible
protected

Definition at line 112 of file W3DBridgeBuffer.h.


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