Forest

Engine/source/forest/forest.h

More...

Public User Defined

Protected Types

enum
MaskBits {
  MediaMask = Parent::NextFreeMask << 1
  LodMask = Parent::NextFreeMask << 2
  NextFreeMask = Parent::NextFreeMask << 3
}
Parent 

Public Friends

Protected Attributes

The forest data file which defines planting.

The name of the planting data file.

Used to scale the tree LODs when rendering into reflections.

bool

Set when rezoning of forest cells is required.

Protected Static Functions

Public Functions

applyRadialImpulse(const Point3F & origin, F32 radius, F32 magnitude)

Applies a radial impulse to the object using the impulse origin and force.

buildConvex(const Box3F & box, Convex * convex)

Builds a convex hull for this object.

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
castRayBase(const Point3F & start, const Point3F & end, RayInfo * outInfo, bool rendered)
bool

Casts a ray against rendered geometry, returns true if RayInfo is modified.

Remove all objects from this set.

bool
collideBox(const Point3F & start, const Point3F & end, RayInfo * outInfo)

Called to create a new empty planting data file and assign it to this forest.

getLocalWindTrees(const Point3F & camPos, F32 radius, Vector< TreePlacementInfo > * placementInfo)

Overloaded from SceneObject to properly update the client side forest when changes occur within the mission editor.

bool
isTreeInRange(const Point2F & point, F32 radius)
bool

Called when the object is added to the sim.

Called when the object is removed from the sim.

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

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

Called when the SceneManager is ready for the registration of render instances.

saveDataFile(const char * path)

Overloaded from SceneObject for updating the client side position of the forest.

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

Called to rebuild the collision state.

Detailed Description

Public User Defined

Convex * mConvexList 

Collision and Physics.

Protected Types

MaskBits

Enumerator

MediaMask = Parent::NextFreeMask << 1
LodMask = Parent::NextFreeMask << 2
NextFreeMask = Parent::NextFreeMask << 3
typedef SceneObject Parent 

Public Friends

Protected Attributes

Resource< ForestData > mData 

The forest data file which defines planting.

StringTableEntry mDataFileName 

The name of the planting data file.

F32 mReflectionLodScalar 

Used to scale the tree LODs when rendering into reflections.

It should be greater or equal to 1.

bool mZoningDirty 

Set when rezoning of forest cells is required.

Protected Static Attributes

F32 smAverageItemsPerCell 
U32 smCellItemsBatched 
U32 smCellItemsRendered 
U32 smCellsBatched 
U32 smCellsRendered 
ForestCreatedSignal smCreatedSignal 
ForestCreatedSignal smDestroyedSignal 
bool smDisableImposters 
bool smDrawBounds 
bool smDrawCells 
bool smForceImposters 

Debug helpers.

U32 smTotalCells 

Protected Static Functions

_clearStats(bool )

Protected Functions

_onZoningChanged(SceneZoneSpaceManager * zoneManager)

_renderCellBounds(ObjectRenderInst * ri, SceneRenderState * state, BaseMatInstance * overrideMat)

Public Static Functions

consoleInit()

getCreatedSignal()

getDestroyedSignal()

initPersistFields()

Public Functions

Forest()

~Forest()

applyRadialImpulse(const Point3F & origin, F32 radius, F32 magnitude)

Reimplemented from: SceneObject

buildConvex(const Box3F & box, Convex * convex)

Reimplemented from: SceneObject

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

castRayBase(const Point3F & start, const Point3F & end, RayInfo * outInfo, bool rendered)

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

Reimplemented from: SceneObject

clear()

Reimplemented from: SimGroup

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

Reimplemented from: SceneObject

createNewFile()

Called to create a new empty planting data file and assign it to this forest.

DECLARE_CONOBJECT(Forest )

getData()

getData()

getLocalWindTrees(const Point3F & camPos, F32 radius, Vector< TreePlacementInfo > * placementInfo)

inspectPostApply()

Reimplemented from: SceneObject

isTreeInRange(const Point2F & point, F32 radius)

onAdd()

Reimplemented from: SceneObject

onRemove()

Reimplemented from: SceneObject

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

Reimplemented from: SceneObject

prepRenderImage(SceneRenderState * state)

Reimplemented from: SceneObject

saveDataFile(const char * path)

setTransform(const MatrixF & mat)

Reimplemented from: SceneObject

unpackUpdate(NetConnection * conn, BitStream * stream)

Reimplemented from: SceneObject

updateCollision()

Called to rebuild the collision state.