torque Torque Game Engine Documentation
TGE Version 1.5.2

Lightning Class Reference

#include <lightning.h>

Inheritance diagram for Lightning:

Inheritance graph
[legend]

Public Member Functions

 Lightning ()
 ~Lightning ()
void applyDamage (const Point3F &hitPosition, const Point3F &hitNormal, SceneObject *hitObject)
void warningFlashes ()
void strikeRandomPoint ()
void strikeObject (ShapeBase *)
void processEvent (LightningStrikeEvent *)
 DECLARE_CONOBJECT (Lightning)
U32 packUpdate (NetConnection *conn, U32 mask, BitStream *stream)
 Instructs this object to pack its state for transfer over the network.
void unpackUpdate (NetConnection *conn, BitStream *stream)
 Instructs this object to read state data previously packed with packUpdate.

Static Public Member Functions

static void initPersistFields ()
 Register dynamic fields in a subclass of ConsoleObject.

Data Fields

U32 strikesPerMinute
F32 strikeWidth
F32 chanceToHitTarget
F32 strikeRadius
F32 boltStartRadius
ColorF color
ColorF fadeColor
bool useFog

Protected Member Functions

bool onAdd ()
 Called when the object is added to the sim.
void onRemove ()
 Called when the object is removed from the sim.
bool onNewDataBlock (GameBaseData *dptr)
 Called when a new datablock is set.
bool prepRenderImage (SceneState *state, const U32 stateKey, const U32 startZone, const bool modifyBaseZoneState)
 Called when the SceneGraph is ready for the registration of RenderImages.
void renderObject (SceneState *state, SceneRenderImage *image)
 Called when the object is supposed to render itself.
void processTick (const Move *move)
 Processes a move event and updates object state once every 32 milliseconds.
void interpolateTick (F32 delta)
 Interpolates between tick events.
void advanceTime (F32 dt)
 Advances simulation time for animations.
void scheduleThunder (Strike *)

Protected Attributes

U32 mLastThink
StrikemStrikeListHead
ThundermThunderListHead

Static Protected Attributes

static const U32 csmTargetMask

Private Types

typedef GameBase Parent

Private Attributes

LightningDatamDataBlock

Data Structures

struct  Strike
struct  Thunder

Member Typedef Documentation

typedef GameBase Lightning::Parent [private]

Reimplemented from GameBase.


Constructor & Destructor Documentation

Lightning::Lightning (  ) 

Lightning::~Lightning (  ) 


Member Function Documentation

bool Lightning::onAdd (  )  [protected, virtual]

Called when the object is added to the sim.

Reimplemented from GameBase.

void Lightning::onRemove (  )  [protected, virtual]

Called when the object is removed from the sim.

Reimplemented from GameBase.

bool Lightning::onNewDataBlock ( GameBaseData dptr  )  [protected, virtual]

Called when a new datablock is set.

This allows subclasses to appropriately handle new datablocks.

See also:
setDataBlock()
Parameters:
dptr New datablock

Reimplemented from GameBase.

bool Lightning::prepRenderImage ( SceneState state,
const U32  stateKey,
const U32  startZone,
const bool  modifyBaseZoneState 
) [protected, virtual]

Called when the SceneGraph is ready for the registration of RenderImages.

See also:
SceneState
Parameters:
state SceneState
stateKey State key of the current SceneState
startZone Base zone index
modifyBaseZoneState If true, the object needs to modify the zone state.

Reimplemented from SceneObject.

void Lightning::renderObject ( SceneState state,
SceneRenderImage image 
) [protected, virtual]

Called when the object is supposed to render itself.

Parameters:
state Current rendering state.
See also:
SceneState
Parameters:
image Image associated with this object to render.
See also:
SceneRenderImage

Reimplemented from SceneObject.

void Lightning::processTick ( const Move move  )  [protected, virtual]

Processes a move event and updates object state once every 32 milliseconds.

This takes place both on the client and server, every 32 milliseconds (1 tick).

See also:
ProcessList
Parameters:
move Move event corresponding to this tick, or NULL.

Reimplemented from GameBase.

void Lightning::interpolateTick ( F32  delta  )  [protected, virtual]

Interpolates between tick events.

This takes place on the CLIENT ONLY.

Parameters:
delta Time since last call to interpolate

Reimplemented from GameBase.

void Lightning::advanceTime ( F32  dt  )  [protected, virtual]

Advances simulation time for animations.

This is called every frame.

Parameters:
dt Time since last advance call

Reimplemented from GameBase.

void Lightning::scheduleThunder ( Strike  )  [protected]

void Lightning::applyDamage ( const Point3F hitPosition,
const Point3F hitNormal,
SceneObject hitObject 
)

void Lightning::warningFlashes (  ) 

void Lightning::strikeRandomPoint (  ) 

void Lightning::strikeObject ( ShapeBase  ) 

void Lightning::processEvent ( LightningStrikeEvent *   ) 

Lightning::DECLARE_CONOBJECT ( Lightning   ) 

static void Lightning::initPersistFields (  )  [static]

Register dynamic fields in a subclass of ConsoleObject.

See also:
addField(), addFieldV(), addDepricatedField(), addGroup(), endGroup()

Reimplemented from GameBase.

U32 Lightning::packUpdate ( NetConnection conn,
U32  mask,
BitStream stream 
) [virtual]

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

Parameters:
conn Net connection being used
mask Mask indicating fields to transmit.
stream Bitstream to pack data to
Returns:
Any bits which were not dealt with. The value is stored by the networking system. Don't set bits you weren't passed.

Reimplemented from GameBase.

void Lightning::unpackUpdate ( NetConnection conn,
BitStream stream 
) [virtual]

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

Parameters:
conn Net connection being used
stream stream to read from

Reimplemented from GameBase.


Field Documentation

Reimplemented from GameBase.

const U32 Lightning::csmTargetMask [static, protected]




All Rights Reserved GarageGames.com, Inc. 1999-2005
Auto-magically Generated with Doxygen