torque Torque Game Engine Documentation
TGE Version 1.5.2

sgLightObject Class Reference

#include <sgLightObject.h>

Inheritance diagram for sgLightObject:

Inheritance graph
[legend]

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

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

Public Member Functions

 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 (SceneState *state, SceneRenderImage *)
 Called when the object is supposed to render itself.
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.

Data Fields

LightInfo mLight
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

Data Structures

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 (  )  [inline]


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.

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 ( SceneState state,
SceneRenderImage image 
) [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 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 lm,
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(), addDepricatedField(), 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 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 fxLight.

Reimplemented in volumeLight.

void sgLightObject::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 fxLight.

Reimplemented in volumeLight.

void sgLightObject::sgCalculateParticleSystemInfo ( NetConnection con  ) 

Tries to turn sgParticleEmitterName into sgParticleEmitterGhostIndex.

sgLightObject::DECLARE_CONOBJECT ( sgLightObject   ) 


Field Documentation

Reimplemented from fxLight.

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.




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