Torque3D Documentation / _generateds / ShapeBaseImageData

ShapeBaseImageData

consoledoc.h

Represents geometry to be mounted to a ShapeBase object.

More...

Callbacks

void
onMount(SceneObject obj, int slot, float dt)

Called when the Image is first mounted to the object.

void
onUnmount(SceneObject obj, int slot, float dt)

Called when the Image is unmounted from the object.

Public Attributes

bool

Flag to control whether the Image's aim is automatically converged with the crosshair.

bool

Indicates that all shapes should be animated in sync.

bool

Indicates that the image should be animated on the server.

Point3F

Amplitude of the camera shaking effect.

float

Duration (in seconds) to shake the camera.

float

Falloff value for the camera shake.

Point3F

Frequency of the camera shaking effect.

float

Radial distance that a camera's position must be within relative to the center of the explosion to be shaken.

DebrisData datablock to use for ejected casings.

bool

Whether this Image can be cloaked.

bool

If true, verify that the CRC of the client's Image matches the server's CRC for the Image when loaded by the client.

bool

Flag to adjust the aiming vector to the eye's LOS point when in 1st person view.

bool

Flag to adjust the aiming vector to the camera's LOS point when in 3rd person view.

bool

Whether to enable environment mapping on this Image.

MatrixPosition

"X Y Z" translation offset from the ShapeBase model's eye node.

MatrixRotation

"X Y Z ANGLE" rotation offset from the ShapeBase model's eye node.

bool

Set to true to render the image in first person.

caseString

Passed along to the mounting shape to modify animation sequences played in third person. [optional].

caseString

Passed along to the mounting shape to modify animation sequences played in first person. [optional].

float

Brightness of the light this Image emits.

LinearColorF

The color of light this Image emits.

int

Duration in SimTime of Pulsing and WeaponFire type lights.

float

Radius of the light this Image emits.

The type of light this Image emits.

float

Mass of this Image.

int

Maximum number of sounds this Image can play at a time.

float

Minimum Image energy for it to be operable.

int

Mount node # to mount this Image to.

MatrixPosition

"X Y Z" translation offset from this Image's mountPoint node to attach to.

The projectile fired by this Image.

MatrixRotation

"X Y Z ANGLE" rotation offset from this Image's mountPoint node to attach to.

float

The amount of time to transition between the previous sequence and new sequence when the script prefix has changed.

bool

Flag indicating whether the camera should shake when this Image fires.

filename

The DTS or DAE model to use for this Image.

filename

The DTS or DAE model to use for this Image when in first person.

Point3F

Vector direction to eject shell casings.

float

Variance (in degrees) from the shellExitDir vector to eject casings.

float

Speed at which to eject casings.

bool

If false, other Images will temporarily be blocked from mounting while the state machine is executing the tasks in this state.

bool

The first state with this set to true is the state entered by the client when it receives the 'altFire' event.

bool

Direction of the animation to play in this state.

bool

If true, a shell casing will be ejected in this state.

Emitter to generate particles in this state (from muzzle point or specified node).

string

Name of the node to emit particles from.

float

How long (in seconds) to emit particles on entry to this state.

float

Amount of energy to subtract from the Image in this state.

bool
stateFire [31]

The first state with this set to true is the state entered by the client when it receives the 'fire' event.

bool

If set to true, and both ready and loaded transitions are true, the ready transition will be taken instead of the loaded transition.

Set the loaded state of the Image.

caseString
stateName [31]

Name of this state.

Type of recoil sequence to play on the ShapeBase object on entry to this state.

bool

The first state with this set to true is the state entered by the client when it receives the 'reload' event.

bool

If true, the timeScale of the stateSequence animation will be adjusted such that the sequence plays for stateTimeoutValue seconds.

bool

If true, the timeScale of the first person stateSequence animation will be adjusted such that the sequence plays for stateTimeoutValue seconds.

bool

Indicates if the sequence to be played on the mounting shape should be scaled to the length of the state.

caseString

Method to execute on entering this state.

string

Name of the sequence to play on entry to this state.

bool

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

bool

If true, the muzzle flash sequence will be played while in this state.

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?

float

The time to transition in or out of a sequence.

string

Name of the sequence that is played on the mounting shape.

Sound to play on entry to this state.

Controls how fast the 'spin' animation sequence will be played in this state.

float

Time in seconds to wait before transitioning to stateTransitionOnTimeout.

string

Name of the state to transition to when the generic trigger 0 state changes to true.

string

Name of the state to transition to when the generic trigger 0 state changes to false.

string

Name of the state to transition to when the generic trigger 1 state changes to true.

string

Name of the state to transition to when the generic trigger 1 state changes to false.

string

Name of the state to transition to when the generic trigger 2 state changes to true.

string

Name of the state to transition to when the generic trigger 2 state changes to false.

string

Name of the state to transition to when the generic trigger 3 state changes to true.

string

Name of the state to transition to when the generic trigger 3 state changes to false.

string

Name of the state to transition to when the alt trigger state of the Image changes to false (alt fire button up).

string

Name of the state to transition to when the alt trigger state of the Image changes to true (alt fire button down).

string

Name of the state to transition to when the ammo state of the Image changes to true.

string

Name of the state to transition to when the loaded state of the Image changes to 'Loaded'.

string

Name of the state to transition to when the Player moves.

string

Name of the state to transition to when the ammo state of the Image changes to false.

string

Name of the state to transition to when the Player stops moving.

string

Name of the state to transition to when the Image loses a target.

string

Name of the state to transition to when the loaded state of the Image changes to 'Empty'.

string

Name of the state to transition to when the Image exits the water.

string

Name of the state to transition to when the Image gains a target.

string

Name of the state to transition to when we have been in this state for stateTimeoutValue seconds.

string

Name of the state to transition to when the trigger state of the Image changes to false (fire button released).

string

Name of the state to transition to when the trigger state of the Image changes to true (fire button down).

string

Name of the state to transition to when the Image enters the water.

bool

If false, this state ignores stateTimeoutValue and transitions immediately if other transition conditions are met.

bool

Mount image using image's eyeMount node and place the camera at the image's eye node (or at the eyeMount node if the eye node is missing).

bool

If true, allow multiple timeout transitions to occur within a single tick (useful if states have a very small timeout).

bool

Flag indicating whether this Image uses energy instead of ammo. The energy level comes from the ShapeBase object we're mounted to.

Detailed Description

Represents geometry to be mounted to a ShapeBase object.

Callbacks

onMount(SceneObject obj, int slot, float dt)

Called when the Image is first mounted to the object.

Parameters:

obj

object that this Image has been mounted to

slot

Image mount slot on the object

dt

time remaining in this Image update

onUnmount(SceneObject obj, int slot, float dt)

Called when the Image is unmounted from the object.

Parameters:

obj

object that this Image has been unmounted from

slot

Image mount slot on the object

dt

time remaining in this Image update

Public Attributes

bool accuFire 

Flag to control whether the Image's aim is automatically converged with the crosshair.

Currently unused.

bool animateAllShapes 

Indicates that all shapes should be animated in sync.

When multiple shapes are defined for this image datablock, each of them are automatically animated in step with each other. This allows for easy switching between between shapes when some other condition changes, such as going from first person to third person, and keeping their look consistent. If you know that you'll never switch between shapes on the fly, such as players only being allowed in a first person view, then you could set this to false to save some calculations.

There are other circumstances internal to the engine that determine that only the current shape should be animated rather than all defined shapes. In those cases, this property is ignored.

note:

This property is only important if you have more than one shape defined, such as shapeFileFP.

bool animateOnServer 

Indicates that the image should be animated on the server.

In most cases you'll want this set if you're using useEyeNode. You may also want to set this if the muzzlePoint is animated while it shoots. You can set this to false even if these previous cases are true if the image's shape is set up in the correct position and orientation in the 'root' pose and none of the nodes are animated at key times, such as the muzzlePoint essentially remaining at the same position at the start of the fire state (it could animate just fine after the projectile is away as the muzzle vector is only calculated at the start of the state).

You'll also want to set this to true if you're animating the camera using the image's 'eye' node – unless the movement is very subtle and doesn't need to be reflected on the server.

note:

Setting this to true causes up to four animation threads to be advanced on the server for each instance in use, although for most images only one or two are actually defined.

Point3F camShakeAmp 

Amplitude of the camera shaking effect.

see:

shakeCamera

float camShakeDuration 

Duration (in seconds) to shake the camera.

float camShakeFalloff 

Falloff value for the camera shake.

Point3F camShakeFreq 

Frequency of the camera shaking effect.

see:

shakeCamera

float camShakeRadius 

Radial distance that a camera's position must be within relative to the center of the explosion to be shaken.

DebrisData casing 

DebrisData datablock to use for ejected casings.

bool cloakable 

Whether this Image can be cloaked.

Currently unused.

bool computeCRC 

If true, verify that the CRC of the client's Image matches the server's CRC for the Image when loaded by the client.

bool correctMuzzleVector 

Flag to adjust the aiming vector to the eye's LOS point when in 1st person view.

bool correctMuzzleVectorTP 

Flag to adjust the aiming vector to the camera's LOS point when in 3rd person view.

bool emap 

Whether to enable environment mapping on this Image.

MatrixPosition eyeOffset 

"X Y Z" translation offset from the ShapeBase model's eye node.

When in first person view, this is the offset from the eye node to place the gun. This gives the gun a fixed point in space, typical of a lot of FPS games.

MatrixRotation eyeRotation 

"X Y Z ANGLE" rotation offset from the ShapeBase model's eye node.

When in first person view, this is the rotation from the eye node to place the gun.

bool firstPerson 

Set to true to render the image in first person.

caseString imageAnimPrefix 

Passed along to the mounting shape to modify animation sequences played in third person. [optional].

caseString imageAnimPrefixFP 

Passed along to the mounting shape to modify animation sequences played in first person. [optional].

float lightBrightness 

Brightness of the light this Image emits.

Only valid for WeaponFireLight.

LinearColorF lightColor 

The color of light this Image emits.

int lightDuration 

Duration in SimTime of Pulsing and WeaponFire type lights.

float lightRadius 

Radius of the light this Image emits.

ShapeBaseImageLightType lightType 

The type of light this Image emits.

float mass 

Mass of this Image.

This is added to the total mass of the ShapeBase object.

int maxConcurrentSounds 

Maximum number of sounds this Image can play at a time.

Any value <= 0 indicates that it can play an infinite number of sounds.

float minEnergy 

Minimum Image energy for it to be operable.

int mountPoint 

Mount node # to mount this Image to.

This should correspond to a mount# node on the ShapeBase derived object we are mounting to.

MatrixPosition offset 

"X Y Z" translation offset from this Image's mountPoint node to attach to.

Defaults to "0 0 0". ie. attach this Image's mountPoint node to the ShapeBase model's mount# node without any offset.

ProjectileData Projectile 

The projectile fired by this Image.

MatrixRotation rotation 

"X Y Z ANGLE" rotation offset from this Image's mountPoint node to attach to.

Defaults to "0 0 0". ie. attach this Image's mountPoint node to the ShapeBase model's mount# node without any additional rotation.

see:

float scriptAnimTransitionTime 

The amount of time to transition between the previous sequence and new sequence when the script prefix has changed.

When setImageScriptAnimPrefix() is used on a ShapeBase that has this image mounted, the image will attempt to switch to the new animation sequence based on the given script prefix. This is the amount of time it takes to transition from the previously playing animation sequence tothe new script prefix-based animation sequence.

bool ShakeCamera 

Flag indicating whether the camera should shake when this Image fires.

filename shapeFile 

The DTS or DAE model to use for this Image.

filename shapeFileFP 

The DTS or DAE model to use for this Image when in first person.

This is an optional parameter that also requires either eyeOffset or useEyeNode to be set. If none of these conditions is met then shapeFile will be used for all cases.

Typically you set a first person image for a weapon that includes the player's arms attached to it for animating while firing, reloading, etc. This is typical of many FPS games.

Point3F shellExitDir 

Vector direction to eject shell casings.

see:

float shellExitVariance 

Variance (in degrees) from the shellExitDir vector to eject casings.

float shellVelocity 

Speed at which to eject casings.

see:

bool stateAllowImageChange [31]

If false, other Images will temporarily be blocked from mounting while the state machine is executing the tasks 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 stateAllowImageChange to false in firing states, and true the rest of the time.

bool stateAlternateFire [31]

The first state with this set to true is the state entered by the client when it receives the 'altFire' event.

bool stateDirection [31]

Direction of the animation to play in this state.

True is forward, false is backward.

bool stateEjectShell [31]

If true, a shell casing will be ejected in this state.

ParticleEmitterData stateEmitter [31]

Emitter to generate particles in this state (from muzzle point or specified node).

string stateEmitterNode [31]

Name of the node to emit particles from.

float stateEmitterTime [31]

How long (in seconds) to emit particles on entry to this state.

float stateEnergyDrain [31]

Amount of energy to subtract from the Image in this state.

Energy is drained at stateEnergyDrain units/tick as long as we are in this state.

bool stateFire [31]

The first state with this set to true is the state entered by the client when it receives the 'fire' event.

bool stateIgnoreLoadedForReady [31]

If set to true, and both ready and loaded transitions are true, the ready transition will be taken instead of the loaded transition.

A state is 'ready' if pressing the fire trigger in that state would transition to the fire state.

ShapeBaseImageLoadedState stateLoadedFlag [31]

Set the loaded state of the Image.

  • IgnoreLoaded: Don't change Image loaded state.

  • Loaded: Set Image loaded state to true.

  • NotLoaded: Set Image loaded state to false.

caseString stateName [31]

Name of this state.

ShapeBaseImageRecoilState stateRecoil [31]

Type of recoil sequence to play on the ShapeBase object on entry to this state.

  • NoRecoil: Do not play a recoil sequence.

  • LightRecoil: Play the light_recoil sequence.

  • MediumRecoil: Play the medium_recoil sequence.

  • HeavyRecoil: Play the heavy_recoil sequence.

bool stateReload [31]

The first state with this set to true is the state entered by the client when it receives the 'reload' event.

bool stateScaleAnimation [31]

If true, the timeScale of the stateSequence animation will be adjusted such that the sequence plays for stateTimeoutValue seconds.

bool stateScaleAnimationFP [31]

If true, the timeScale of the first person stateSequence animation will be adjusted such that the sequence plays for stateTimeoutValue seconds.

bool stateScaleShapeSequence [31]

Indicates if the sequence to be played on the mounting shape should be scaled to the length of the state.

caseString stateScript [31]

Method to execute on entering this state.

Scoped to this image class name, then ShapeBaseImageData. The script callback function takes the same arguments as the onMount callback.

see:

onMount() for the same arguments as this callback.

string stateSequence [31]

Name of the sequence to play on entry to this state.

bool stateSequenceNeverTransition [31]

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

bool stateSequenceRandomFlash [31]

If true, the muzzle flash sequence will be played while in this state.

The name of the muzzle flash sequence is the same as stateSequence, with "_vis" at the end.

bool stateSequenceTransitionIn [31]

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

bool stateSequenceTransitionOut [31]

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

float stateSequenceTransitionTime [31]

The time to transition in or out of a sequence.

string stateShapeSequence [31]

Name of the sequence that is played on the mounting shape.

SFXTrack stateSound [31]

Sound to play on entry to this state.

ShapeBaseImageSpinState stateSpinThread [31]

Controls how fast the 'spin' animation sequence will be played in this state.

  • Ignore: No change to the spin sequence.

  • Stop: Stops the spin sequence at its current position.

  • SpinUp: Increase spin sequence timeScale from 0 (on state entry) to 1 (after stateTimeoutValue seconds).

  • SpinDown: Decrease spin sequence timeScale from 1 (on state entry) to 0 (after stateTimeoutValue seconds).

  • FullSpeed: Resume the spin sequence playback at its current position with timeScale=1.

float stateTimeoutValue [31]

Time in seconds to wait before transitioning to stateTransitionOnTimeout.

string stateTransitionGeneric0In [31]

Name of the state to transition to when the generic trigger 0 state changes to true.

string stateTransitionGeneric0Out [31]

Name of the state to transition to when the generic trigger 0 state changes to false.

string stateTransitionGeneric1In [31]

Name of the state to transition to when the generic trigger 1 state changes to true.

string stateTransitionGeneric1Out [31]

Name of the state to transition to when the generic trigger 1 state changes to false.

string stateTransitionGeneric2In [31]

Name of the state to transition to when the generic trigger 2 state changes to true.

string stateTransitionGeneric2Out [31]

Name of the state to transition to when the generic trigger 2 state changes to false.

string stateTransitionGeneric3In [31]

Name of the state to transition to when the generic trigger 3 state changes to true.

string stateTransitionGeneric3Out [31]

Name of the state to transition to when the generic trigger 3 state changes to false.

string stateTransitionOnAltTriggerDown [31]

Name of the state to transition to when the alt trigger state of the Image changes to false (alt fire button up).

string stateTransitionOnAltTriggerUp [31]

Name of the state to transition to when the alt trigger state of the Image changes to true (alt fire button down).

string stateTransitionOnAmmo [31]

Name of the state to transition to when the ammo state of the Image changes to true.

string stateTransitionOnLoaded [31]

Name of the state to transition to when the loaded state of the Image changes to 'Loaded'.

string stateTransitionOnMotion [31]

Name of the state to transition to when the Player moves.

string stateTransitionOnNoAmmo [31]

Name of the state to transition to when the ammo state of the Image changes to false.

string stateTransitionOnNoMotion [31]

Name of the state to transition to when the Player stops moving.

string stateTransitionOnNoTarget [31]

Name of the state to transition to when the Image loses a target.

string stateTransitionOnNotLoaded [31]

Name of the state to transition to when the loaded state of the Image changes to 'Empty'.

string stateTransitionOnNotWet [31]

Name of the state to transition to when the Image exits the water.

string stateTransitionOnTarget [31]

Name of the state to transition to when the Image gains a target.

string stateTransitionOnTimeout [31]

Name of the state to transition to when we have been in this state for stateTimeoutValue seconds.

string stateTransitionOnTriggerDown [31]

Name of the state to transition to when the trigger state of the Image changes to false (fire button released).

string stateTransitionOnTriggerUp [31]

Name of the state to transition to when the trigger state of the Image changes to true (fire button down).

string stateTransitionOnWet [31]

Name of the state to transition to when the Image enters the water.

bool stateWaitForTimeout [31]

If false, this state ignores stateTimeoutValue and transitions immediately if other transition conditions are met.

bool useEyeNode 

Mount image using image's eyeMount node and place the camera at the image's eye node (or at the eyeMount node if the eye node is missing).

When in first person view, if an 'eyeMount' node is present in the image's shape, this indicates that the image should mount eyeMount node to Player eye node for image placement. The Player's camera should also mount to the image's eye node to inherit any animation (or the eyeMount node if the image doesn't have an eye node).

note:

Used instead of eyeOffset.

note:

Read about the animateOnServer field as you may want to set it to true if you're using useEyeNode.

bool useRemainderDT 

If true, allow multiple timeout transitions to occur within a single tick (useful if states have a very small timeout).

bool usesEnergy 

Flag indicating whether this Image uses energy instead of ammo. The energy level comes from the ShapeBase object we're mounted to.