sgLightObject Class Reference

#include <sgLightObject.h>

Inheritance diagram for sgLightObject:

Inheritance graph
[legend]
List of all members.

Detailed Description

This class extends fxLight to provide mission level static light objects.

These light objects can also be used as dynamic lights and linked to mission level particle emitters for coordinated particle system light sources (flickering,...).


Public Types

 sgLastfxLightMask = fxLightAttachChange
 sgParticleSystemMask = sgLastfxLightMask << 1
 sgAttachedObjectMask = sgLastfxLightMask << 2
enum  {
  sgLastfxLightMask = fxLightAttachChange,
  sgParticleSystemMask = sgLastfxLightMask << 1,
  sgAttachedObjectMask = sgLastfxLightMask << 2
}

Public Member Functions

 sgLightObject ()
 ~sgLightObject ()
void attachToObject (GameBase *obj)
void detachFromObject ()
bool onAdd ()
 Called when the object is added to the sim.
bool onNewDataBlock (GameBaseData *dptr)
 Called when a new datablock is set.
void processTick (const Move *move)
 Processes a move event and updates object state once every 32 milliseconds.
virtual void calculateLightPosition ()
virtual SceneObjectgetAttachedObject ()
void renderObject (ObjectRenderInst *ri, BaseMatInstance *overrideMat)
virtual void setTransform (const MatrixF &mat)
 Sets the Object -> World transform.
void registerLights (LightManager *lightManager, bool lightingScene)
 Called to register the object's lights, if any, with the LightManager.
virtual void inspectPostApply ()
 Called after any property of the object is changed in the world editor.
U32 packUpdate (NetConnection *con, U32 mask, BitStream *stream)
 Instructs this object to pack its state for transfer over the network.
void unpackUpdate (NetConnection *con, BitStream *stream)
 Instructs this object to read state data previously packed with packUpdate.
void sgCalculateParticleSystemInfo (NetConnection *con)
 Tries to turn sgParticleEmitterName into sgParticleEmitterGhostIndex.
 DECLARE_CONOBJECT (sgLightObject)

Static Public Member Functions

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

Public Attributes

sgLightInfomLight
F32 sgParticleColorAttenuation
 Used to attenuate the color received from the particle emitter.
StringTableEntry sgParticleEmitterName
 The particle emitter name field.

Private Types

typedef fxLight Parent

Private Attributes

sgLightObjectDatamDataBlock
bool sgValidParticleEmitter
 The particle emitter's ghost id is used to sync up the client and server.
S32 sgParticleEmitterGhostIndex
S32 sgAttachedObjectGhostIndex
SimObjectPtr< ParticleEmittersgParticleEmitterPtr
 The resolved (from the ghost id) particle emitter.
SimObjectPtr< GameBasesgAttachedObjectPtr
S32 sgMainZone
GFXStateBlockRef sgStateBlock

Classes

class  sgAnimateState


Member Typedef Documentation

typedef fxLight sgLightObject::Parent [private]

Reimplemented from fxLight.

Reimplemented in VolumeLight.


Member Enumeration Documentation

anonymous enum

Enumerator:
sgLastfxLightMask 
sgParticleSystemMask 
sgAttachedObjectMask 


Constructor & Destructor Documentation

sgLightObject::sgLightObject (  ) 

sgLightObject::~sgLightObject (  ) 


Member Function Documentation

void sgLightObject::attachToObject ( GameBase obj  ) 

void sgLightObject::detachFromObject (  ) 

bool sgLightObject::onAdd (  )  [virtual]

Called when the object is added to the sim.

Reimplemented from fxLight.

Reimplemented in VolumeLight.

bool sgLightObject::onNewDataBlock ( GameBaseData dptr  )  [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 fxLight.

Reimplemented in VolumeLight.

void sgLightObject::processTick ( const Move move  )  [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 fxLight.

virtual void sgLightObject::calculateLightPosition (  )  [virtual]

Reimplemented from fxLight.

virtual SceneObject* sgLightObject::getAttachedObject (  )  [inline, virtual]

Reimplemented from fxLight.

void sgLightObject::renderObject ( ObjectRenderInst ri,
BaseMatInstance overrideMat 
)

Reimplemented from fxLight.

Reimplemented in VolumeLight.

virtual void sgLightObject::setTransform ( const MatrixF mat  )  [virtual]

Sets the Object -> World transform.

Parameters:
mat New transform matrix

Reimplemented from SceneObject.

void sgLightObject::registerLights ( LightManager lightManager,
bool  lightingScene 
) [virtual]

Called to register the object's lights, if any, with the LightManager.

Parameters:
lm LightManager to put lights into.
lightingScene True if we're currently calculating lighting information.

Reimplemented from fxLight.

static void sgLightObject::initPersistFields (  )  [static]

Register dynamic fields in a subclass of ConsoleObject.

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

Reimplemented from fxLight.

Reimplemented in VolumeLight.

virtual void sgLightObject::inspectPostApply (  )  [virtual]

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

See also:
inspectPreApply

Reimplemented from fxLight.

Reimplemented in VolumeLight.

U32 sgLightObject::packUpdate ( NetConnection con,
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 fxLight.

Reimplemented in VolumeLight.

void sgLightObject::unpackUpdate ( NetConnection con,
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 fxLight.

Reimplemented in VolumeLight.

void sgLightObject::sgCalculateParticleSystemInfo ( NetConnection con  ) 

Tries to turn sgParticleEmitterName into sgParticleEmitterGhostIndex.

sgLightObject::DECLARE_CONOBJECT ( sgLightObject   ) 


Member Data Documentation

Reimplemented from fxLight.

Reimplemented in VolumeLight.

The particle emitter's ghost id is used to sync up the client and server.

The resolved (from the ghost id) particle emitter.

Used to attenuate the color received from the particle emitter.

The particle emitter name field.

This is the unique mission name of the particle emitter.