torque Torque Game Engine Documentation
TGE Version 1.5.2

ShapeBaseImageData::StateData Struct Reference

#include <shapeBase.h>


State attributes

enum  LoadedState {
  IgnoreLoaded,
  Loaded,
  NotLoaded,
  NumLoadedBits = 3
}
enum  SpinState {
  IgnoreSpin,
  NoSpin,
  SpinUp,
  SpinDown,
  FullSpin,
  NumSpinBits = 3
}
enum  RecoilState {
  NoRecoil,
  LightRecoil,
  MediumRecoil,
  HeavyRecoil,
  NumRecoilBits = 3
}
bool fire
 Can only have one fire state.
bool ejectShell
 Should we eject a shell casing in this state?
bool allowImageChange
 Can we switch to another image while in this state?
bool scaleAnimation
 Scale animation to fit the state timeout.
bool direction
 Animation direction.
bool waitForTimeout
 Require the timeout to pass before advancing to the next state.
F32 timeoutValue
 A timeout value; the effect of this value is determined by the flags scaleAnimation and waitForTimeout.
F32 energyDrain
 Sets the energy drain rate per second of this state.
enum ShapeBaseImageData::StateData::LoadedState loaded
 Is the image considered loaded?
enum ShapeBaseImageData::StateData::SpinState spin
 Spin thread state. (Used to control spinning weapons, e.g. chainguns).
enum ShapeBaseImageData::StateData::RecoilState recoil
 Recoil thread state.
bool flashSequence
 Is this a muzzle flash sequence?
S32 sequence
 Main thread sequence ID.
S32 sequenceVis
 Visibility thread sequence.
const char * script
 Function on datablock to call when we enter this state; passed the id of the imageSlot.
ParticleEmitterDataemitter
 A particle emitter; this emitter will emit as long as the gun is in this this state.
AudioProfilesound
F32 emitterTime
S32 emitterNode

Public Member Functions

 StateData ()

Data Fields

const char * name
 State name.
Transition states
ShapeBaseImageData::StateData::Transition transition
bool ignoreLoadedForReady

Data Structures

struct  Transition


Member Enumeration Documentation

Enumerator:
IgnoreLoaded  Don't change loaded state.
Loaded  Set us as loaded.
NotLoaded  Set us as not loaded.
NumLoadedBits  How many bits to allocate to representing this state. (3 states needs 2 bits).

Enumerator:
IgnoreSpin  Don't change spin state.
NoSpin  Mark us as having no spin (ie, stop spinning).
SpinUp  Mark us as spinning up.
SpinDown  Mark us as spinning down.
FullSpin  Mark us as being at full spin.
NumSpinBits  How many bits to allocate to representing this state. (5 states needs 3 bits).

Enumerator:
NoRecoil 
LightRecoil 
MediumRecoil 
HeavyRecoil 
NumRecoilBits 


Constructor & Destructor Documentation

ShapeBaseImageData::StateData::StateData (  ) 


Field Documentation

State name.

Can only have one fire state.

Should we eject a shell casing in this state?

Can we switch to another image while in this state?

For instance, if we have a rocket launcher, the player shouldn't be able to switch out while firing. So, you'd set allowImageChange to false in firing states, and true the rest of the time.

Scale animation to fit the state timeout.

Animation direction.

Require the timeout to pass before advancing to the next state.

A timeout value; the effect of this value is determined by the flags scaleAnimation and waitForTimeout.

Sets the energy drain rate per second of this state.

Energy is drained at energyDrain units/sec as long as we are in this state.

Spin thread state. (Used to control spinning weapons, e.g. chainguns).

Recoil thread state.

Note:
At this point, the only check being done is to see if we're in a state which isn't NoRecoil; ie, no differentiation is made between Light/Medium/Heavy recoils. Player::onImageRecoil() is the place where this is handled.

Is this a muzzle flash sequence?

A muzzle flash sequence is used as a source to randomly display frames from, so if this is a flashSequence, we'll display a random piece each frame.

Main thread sequence ID.

Visibility thread sequence.

Function on datablock to call when we enter this state; passed the id of the imageSlot.

A particle emitter; this emitter will emit as long as the gun is in this this state.




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