River

Engine/source/environment/river.h

More...

Protected Types

enum
_Anonymous_ {
  RiverMask = Parent::NextFreeMask
  NodeMask = Parent::NextFreeMask << 1
  RegenMask = Parent::NextFreeMask << 2
  InitialUpdateMask = Parent::NextFreeMask << 3
  SelectedMask = Parent::NextFreeMask << 4
  MaterialMask = Parent::NextFreeMask << 5
  NextFreeMask = Parent::NextFreeMask << 6
}

Private Types

Parent 

Public Friends

Public Functions

addNode(const Point3F & pos, const F32 & width, const F32 & depth, const VectorF & normal)
bool
buildPolyList(PolyListContext context, AbstractPolyList * polyList, const Box3F & box, const SphereF & sphere)

Builds a list of polygons which intersect a bounding volume.

bool
castRay(const Point3F & start, const Point3F & end, RayInfo * info)

Casts a ray and obtain collision information, returns true if RayInfo is modified.

bool
collideBox(const Point3F & start, const Point3F & end, RayInfo * info)
bool
collideRay(const Point3F & origin, const Point3F & direction, U32 * nodeIdx, Point3F * collisionPnt)
bool
bool
containsPoint(const Point3F & worldPos, U32 * nodeIdx)
distanceToSurface(const Point3F & pnt, U32 segmentIdx)
bool
insertNode(const Point3F & pos, const F32 & width, const F32 & depth, const VectorF & normal, const U32 & idx)

Called after any property of the object is changed in the world editor.

bool

Called when the object is added to the sim.

Called when the object is removed from the sim.

onStaticModified(const char * slotName, const char * newValue)

Specifically, these are called by setDataField when a static or dynamic field is modified, see the console details.

packUpdate(NetConnection * conn, U32 mask, BitStream * stream)

Instructs this object to pack its state for transfer over the network.

setNode(const Point3F & pos, const F32 & width, const F32 & depth, const VectorF & normal, const U32 & idx)
setNodeDepth(U32 idx, F32 depth)
setNodeHeight(U32 idx, F32 height)
setNodeWidth(U32 idx, F32 width)

Sets the scale for the object.

setShowNodes(bool enabled)

Sets the Object -> World transform.

Instructs this object to read state data previously packed with packUpdate.

bool
writeField(StringTableEntry fieldname, const char * value)

Determine whether or not a field should be written.

writeFields(Stream & stream, U32 tabStop)

Write the fields of this object in TorqueScript.

Public Static Functions

bool
addNodeFromField(void * object, const char * index, const char * data)

Protected 'Component' Field setter that will add a component to the list.

Detailed Description

Protected Types

@79

Enumerator

RiverMask = Parent::NextFreeMask
NodeMask = Parent::NextFreeMask << 1
RegenMask = Parent::NextFreeMask << 2
InitialUpdateMask = Parent::NextFreeMask << 3
SelectedMask = Parent::NextFreeMask << 4
MaterialMask = Parent::NextFreeMask << 5
NextFreeMask = Parent::NextFreeMask << 6

Private Types

typedef WaterObject Parent 

Public Friends

Public Static Attributes

bool smEditorOpen 
SimObjectPtr< SimSet > smServerRiverSet 
bool smShowNodes 
bool smShowRiver 
bool smShowSpline 
bool smShowWalls 
bool smWireframe 

Protected Attributes

U32 mColumnCount 
F32 mDepthScale 
F32 mFlowMagnitude 
RiverBatchVector mHighLODBatches 
U32 mHighTriangleCount 
U32 mHighVertCount 
F32 mLodDistance 
RiverBatchVector mLowLODBatches 
U32 mLowTriangleCount 
U32 mLowVertCount 
F32 mMaxDivisionSize 
F32 mMetersPerSegment 
F32 mMinDivisionSize 
RiverNodeVector mNodes 
GFXPrimitiveBufferHandle mPB_high 
GFXPrimitiveBufferHandle mPB_low 
RiverSegmentVector mSegments 
U32 mSegmentsPerBatch 
RiverSliceVector mSlices 
GFXVertexBufferHandle< GFXWaterVertex > mVB_high 
GFXVertexBufferHandle< GFXWaterVertex > mVB_low 

Public Functions

River()

~River()

addNode(const Point3F & pos, const F32 & width, const F32 & depth, const VectorF & normal)

buildNodesFromList(RiverNodeList * list)

buildPolyList(PolyListContext context, AbstractPolyList * polyList, const Box3F & box, const SphereF & sphere)

Reimplemented from: SceneObject

castRay(const Point3F & start, const Point3F & end, RayInfo * info)

Reimplemented from: SceneObject

collideBox(const Point3F & start, const Point3F & end, RayInfo * info)

Reimplemented from: SceneObject

collideRay(const Point3F & origin, const Point3F & direction, U32 * nodeIdx, Point3F * collisionPnt)

containsPoint(const Point3F & point)

containsPoint(const Point3F & worldPos, U32 * nodeIdx)

DECLARE_CONOBJECT(River )

deleteNode(U32 idx)

distanceToSurface(const Point3F & pnt, U32 segmentIdx)

getClosestNode(const Point3F & pos, U32 & idx)

getFlow(const Point3F & pos)

Reimplemented from: WaterObject

getNodeDepth(U32 idx)

getNodeNormal(U32 idx)

getNodePosition(U32 idx)

getNodeTransform(U32 idx)

getNodeWidth(U32 idx)

getSurfaceHeight(const Point2F & pos)

Reimplemented from: WaterObject

getWaterCoverage(const Box3F & worldBox)

Reimplemented from: WaterObject

insertNode(const Point3F & pos, const F32 & width, const F32 & depth, const VectorF & normal, const U32 & idx)

inspectPostApply()

Reimplemented from: WaterObject

isUnderwater(const Point3F & pnt)

Reimplemented from: WaterObject

onAdd()

Reimplemented from: WaterObject

onReflectionInfoChanged()

onRemove()

Reimplemented from: WaterObject

onStaticModified(const char * slotName, const char * newValue)

Reimplemented from: SimObject

packUpdate(NetConnection * conn, U32 mask, BitStream * stream)

Reimplemented from: WaterObject

regenerate()

setBatchSize(U32 level)

setColumnCount(S32 count)

setMaxDivisionSize(F32 meters)

setMetersPerSegment(F32 meters)

setNode(const Point3F & pos, const F32 & width, const F32 & depth, const VectorF & normal, const U32 & idx)

setNodeDepth(U32 idx, F32 depth)

setNodeHeight(U32 idx, F32 height)

setNodeNormal(U32 idx, const VectorF & normal)

setNodePosition(U32 idx, const Point3F & pos)

setNodeWidth(U32 idx, F32 width)

setScale(const VectorF & scale)

Reimplemented from: SceneObject

setShowNodes(bool enabled)

setTransform(const MatrixF & mat)

Reimplemented from: SceneObject

unpackUpdate(NetConnection * conn, BitStream * stream)

Reimplemented from: WaterObject

updateUnderwaterEffect(SceneRenderState * state)

Reimplemented from: WaterObject

writeField(StringTableEntry fieldname, const char * value)

Reimplemented from: SceneObject

writeFields(Stream & stream, U32 tabStop)

Reimplemented from: SimObject

Public Static Functions

addNodeFromField(void * object, const char * index, const char * data)

Protected 'Component' Field setter that will add a component to the list.

consoleInit()

getServerSet()

initPersistFields()

Protected Functions

_addNode(const Point3F & pos, const F32 & width, const F32 & depth, const VectorF & normal)

_generateSegments()

_generateSlices()

_generateVerts()

_getTerrainHeight(const Point2F & pos, F32 & height)

_getTerrainHeight(F32 x, F32 y, F32 & height)

_getWaterPlane(const Point3F & camPos, PlaneF & outPlane, Point3F & outPos)

Reimplemented from: WaterObject

_insertNode(const Point3F & pos, const F32 & width, const F32 & depth, const VectorF & normal, const U32 & idx)

_loadRenderData()

_makeHighLODBuffers()

_makeRenderBatches(const Point3F & cameraPos)

_regenerate()

_render(ObjectRenderInst * ri, SceneRenderState * state, BaseMatInstance * matInst)

_setRenderData()

innerRender(SceneRenderState * state)

Reimplemented from: WaterObject

setShaderParams(SceneRenderState * state, BaseMatInstance * mat, const WaterMatParams & paramHandles)

Reimplemented from: WaterObject