Torque3D Documentation / _generateds / ShapeBaseImageData::StateData

ShapeBaseImageData::StateData

Engine/source/T3D/shapeBase.h

More...

Classes:

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

Can only have one fire state.

bool

Can only have one alternate fire state.

bool

Can only have one reload state.

bool

Should we eject a shell casing in this state?

bool

Can we switch to another image while in this state?

bool

Scale animation to fit the state timeout.

bool

Scale animation to fit the state timeout while in first person.

bool

Animation direction.

bool

Do we transition to the state's sequence when we enter the state?

bool

Do we transition to the new state's sequence when we leave the state?

bool

Never allow a transition to this sequence. Often used for a fire sequence.

The time to transition in or out of a sequence.

bool

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.

Is the image considered loaded?

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

bool
flashSequence [MaxShapes]

Is this a muzzle flash sequence?

sequence [MaxShapes]

Main thread sequence ID.

sequenceVis [MaxShapes]

Visibility thread sequence.

Sequence that is played on mounting shape.

bool

Should the mounting shape's sequence playback be scaled to the length of the state.

const char *

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.

emitterNode [MaxShapes]

Node ID on the shape to emit from.

Public Attributes

const char *

State name.

Public Functions

Detailed Description

State attributes

LoadedState

Enumerator

IgnoreLoaded

Don't change loaded state.

Loaded

Set us as loaded.

NotLoaded

Set us as not loaded.

NumLoadedBits = 3

How many bits to allocate to representing this state. (3 states needs 2 bits)

SpinState

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 = 3

How many bits to allocate to representing this state. (5 states needs 3 bits)

RecoilState

Enumerator

NoRecoil
LightRecoil
MediumRecoil
HeavyRecoil
NumRecoilBits = 3
bool fire 

Can only have one fire state.

bool altFire 

Can only have one alternate fire state.

bool reload 

Can only have one reload state.

bool ejectShell 

Should we eject a shell casing in this state?

bool allowImageChange 

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.

bool scaleAnimation 

Scale animation to fit the state timeout.

bool scaleAnimationFP 

Scale animation to fit the state timeout while in first person.

bool direction 

Animation direction.

bool sequenceTransitionIn 

Do we transition to the state's sequence when we enter the state?

bool sequenceTransitionOut 

Do we transition to the new state's sequence when we leave the state?

bool sequenceNeverTransition 

Never allow a transition to this sequence. Often used for a fire sequence.

F32 sequenceTransitionTime 

The time to transition in or out of a sequence.

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.

Energy is drained at energyDrain units/sec as long as we are in 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.

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.

bool flashSequence [MaxShapes]

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. 

S32 sequence [MaxShapes]

Main thread sequence ID.

S32 sequenceVis [MaxShapes]

Visibility thread sequence.

StringTableEntry shapeSequence 

Sequence that is played on mounting shape.

bool shapeSequenceScale 

Should the mounting shape's sequence playback be scaled to the length of the state.

const char * script 

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

ParticleEmitterData * emitter 

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

SFXTrack * sound 
F32 emitterTime 
S32 emitterNode [MaxShapes]

Node ID on the shape to emit from.

Transition states

struct ShapeBaseImageData::StateData::Transition transition 
bool ignoreLoadedForReady 

Public Attributes

const char * name 

State name.

Public Functions

StateData()