TorqueScript Reference
Public Member Functions | List of all members
ParticleAsset Class Reference

#include <ParticleAsset_ScriptBinding.h>

Inherits AssetBase.

Public Member Functions

Integer addDataKey (time, value)
 
Boolean addEmitter (emitterId)
 
Boolean clearDataKeys ()
 
void clearEmitters ()
 
String createEmitter ()
 Emitter asset methods.
 
void deselectField ()
 
Integer findEmitter (emitterName)
 
String getDataKey (keyIndex)
 
Integer getDataKeyCount ()
 
Integer getEmitter (emitterIndex)
 
Integer getEmitterCount ()
 
Float getFieldValue (time)
 
String getLifeMode ()
 
Float getLifetime ()
 
Float getMaxTime ()
 
Float getMaxValue ()
 
Float getMinTime ()
 
Float getMinValue ()
 
Float getRepeatTime ()
 
Integer getSelectableFieldCount ()
 Particle asset fields.
 
String getSelectableFieldName (fieldIndex)
 
String getSelectedField ()
 
Float getValueScale ()
 
void moveEmitter (fromEmitterIndex, toEmitterIndex)
 
Boolean removeDataKey (keyIndex)
 
Boolean removeEmitter (emitterId, [bool deleteEmitter])
 
Boolean selectField (fieldName)
 
Boolean setDataKeyValue (keyIndex, value)
 
void setLifeMode (lifeMode)
 Particle asset accessors.
 
void setLifetime (lifeTime)
 
Boolean setRepeatTime (repeatTime)
 
Integer setSingleDataKey (value)
 
Boolean setValueScale (valueScale)
 
- Public Member Functions inherited from AssetBase
String getAssetId ()
 
void refreshAsset ()
 
- Public Member Functions inherited from SimObject
void assignFieldsFrom (SimObject)
 
Integer clone ([copyDynamicFields=false]?)
 
void delete ()
 
Integer getId ()
 
void setName (newName)
 
String getName ()
 
String getClassNamespace ()
 
String getSuperClassNamespace ()
 
void setClassNamespace (nameSpace)
 
void setSuperClassNamespace ()
 
Boolean isMethod (string methodName)
 
String call (methodName, [args] *)
 
void dumpClassHierarchy ()
 
void dump ()
 
Boolean isMemberOfClass (string classname)
 
String getClassName ()
 
String getFieldValue (fieldName)
 
Boolean setFieldValue (fieldName, value)
 
Boolean setEditFieldValue (fieldName, value)
 
Integer getDynamicFieldCount ()
 
String getDynamicField (index)
 
Integer getFieldCount ()
 
String getField (int index)
 
void setProgenitorFile (file)
 
String getProgenitorFile ()
 
Integer getType ()
 
String getFieldType (fieldName)
 
void setInternalName (string InternalName)
 
String getInternalName ()
 
Boolean isChildOfGroup (groupID)
 
Integer getGroup ()
 
Boolean startTimer (callbackFunction, float timePeriod, [repeat]?)
 
void stopTimer ()
 
Boolean isTimerActive ()
 
Integer schedule (time, command, [arg] *)
 
void startListening (SimObject)
 
void stopListening (SimObject)
 
void addListener (SimObject)
 
void removeListener (SimObject)
 
void removeAllListeners ()
 
void postEvent (String eventName, String data)
 
Boolean save (fileName, [selectedOnly]?)
 
void addFieldFilter (fieldName)
 
void removeFieldFilter (fieldName)
 

Member Function Documentation

◆ addDataKey()

Integer addDataKey ( time  ,
value   
)

Add Data-Key to Graph.

Parameters
timeThe key time.
valueThe value at specified time
Returns
Returns the index of the new data-key or -1 on failure.

◆ addEmitter()

Boolean addEmitter ( emitterId  )

Adds an existing emitter.

Parameters
emitterIdThe emitter to add.
Returns
On success it returns the ID of the emitter, or 0 if failed.

◆ clearDataKeys()

Boolean clearDataKeys ( )

Clears all data-key(s) from the field.

Returns
Whether the operation was successful or not.

◆ clearEmitters()

void clearEmitters ( )

Clear all the emitters.

Returns
No return Value.

◆ createEmitter()

String createEmitter ( )

Emitter asset methods.

Creates and add a new emitter.

Returns
The new emitter that was added or 0 if failed.

◆ deselectField()

void deselectField ( )

Deselect any selected field. If no field is selected then nothing happens.

Returns
No return value.

◆ findEmitter()

Integer findEmitter ( emitterName  )

Finds the emitter by its name.

Parameters
emitterNameThe name of the desired emitter.
Returns
The emitter or 0 if not found.

◆ getDataKey()

String getDataKey ( keyIndex  )

Gets the data-key at the specified index from the field.

Parameters
keyIndexThe index of the data-key to be retrieved.
Returns
The data-key comprising both the time and value or nothing if the key is invalid.

◆ getDataKeyCount()

Integer getDataKeyCount ( )

Gets the data-key count.

Returns
The number of data-keys in the currently selected field or -1 if no field is selected.

◆ getEmitter()

Integer getEmitter ( emitterIndex  )

Gets the emitter at the specified index.

Parameters
emitterIndexThe index for the desired emitter
Returns
The emitter or 0 if not found.

◆ getEmitterCount()

Integer getEmitterCount ( )

Gets the emitter count.

Returns
Returns the number of emitters as an integer.

◆ getFieldValue()

Float getFieldValue ( time  )

Get the fields' value at the specified time.

Parameters
timeThe time to sample the field value at.
Returns
The fields' value at the specified time or always 0.0 if no field is selected.

◆ getLifeMode()

String getLifeMode ( )

Gets the life-mode of the particle effect.

Returns
The life-mode of the particle effect.

◆ getLifetime()

Float getLifetime ( )

Gets the lifetime of the particle effect.

Returns
The lifetime of the particle effect.

◆ getMaxTime()

Float getMaxTime ( )

Get the maximum time for the field.

Returns
The maximum time for the field or always 0.0 if no field is selected.

◆ getMaxValue()

Float getMaxValue ( )

Get the maximum value for the field.

Returns
The maximum value for the field or always 0.0 if no field is selected.

◆ getMinTime()

Float getMinTime ( )

Get the minimum time for the field.

Returns
The minimum time for the field or always 0.0 if no field is selected.

◆ getMinValue()

Float getMinValue ( )

Get the minimum value for the field.

Returns
The minimum value for the field or always 0.0 if no field is selected.

◆ getRepeatTime()

Float getRepeatTime ( )

Gets the time period that the fields' value repeat (cycle) at.

Returns
The time period that the fields' value repeat (cycle) at.

◆ getSelectableFieldCount()

Integer getSelectableFieldCount ( )

Particle asset fields.

Gets the number of available selectable fields.

Returns
The number of available selectable fields.

◆ getSelectableFieldName()

String getSelectableFieldName ( fieldIndex  )

Gets the selectable field at the specified index.

Returns
The selectable field name at the specified index.

◆ getSelectedField()

String getSelectedField ( )

Gets the selected field name or nothing if no field is selected.

Returns
The selected field name or nothing if no fields is selected.

◆ getValueScale()

Float getValueScale ( )

Gets the scaling of field values' retrieved from the field.

Returns
The scaling of field values' retrieved from the field.

◆ moveEmitter()

void moveEmitter ( fromEmitterIndex  ,
toEmitterIndex   
)

Moves the emitter order.

Parameters
fromEmitterIndexThe source index of the emitter to move.
toEmitterIndexThe destination index to move the emitter to.
Returns
No return value.

◆ removeDataKey()

Boolean removeDataKey ( keyIndex  )

Remove the data-key from the field.

Parameters
keyIndexThe index of the data-key you want to remove.
Returns
Whether the operation was successful or not.

◆ removeEmitter()

Boolean removeEmitter ( emitterId  )

Removes an emitter.

Parameters
emitterIdThe emitter to remove.
Returns
No return value.

◆ selectField()

Boolean selectField ( fieldName  )

Select the specified field by its name.

Parameters
fieldNameThe field name to use for the selection. Use an empty name to deselect to stop accidental changes.
Returns
Whether the field was successfully selected or not.

◆ setDataKeyValue()

Boolean setDataKeyValue ( keyIndex  ,
value   
)

Set data-key value for the field.

Parameters
keyIndexThe index of the key to be modified.
valueThe value to change the key to.
Returns
Whether the operation was successful or not.

◆ setLifeMode()

void setLifeMode ( lifeMode  )

Particle asset accessors.

Sets the life-mode of the particle effect.

Parameters
lifeModeThe life-mode of the particle effect (either INFINITE, CYCLE, KILL or STOP. A life-mode of INFINITE causes the particle effect to last forever. A life-mode of CYCLE causes the particle effect to restart playing when its specified 'lifetime' has been reached. A life-mode of KILL causes the particle effect to be deleted when its specified 'lifetime' has been reached. A life-mode of STOP causes the particle effect to stop playing (but not be deleted) when its specified lifetime has been reached.
Returns
No return value.

◆ setLifetime()

void setLifetime ( lifeTime  )

Sets the lifetime of the particle effect.

Parameters
lifeTimeThe lifetime of the particle effect. This is used according to the 'lifeMode' setting.
Returns
No return value.

◆ setRepeatTime()

Boolean setRepeatTime ( repeatTime  )

Sets the time period to repeat (cycle) the fields' values at.

Returns
Whether the operation was successful or not.

◆ setSingleDataKey()

Integer setSingleDataKey ( value  )

Sets a single data-key at time-zero with the specified value. All existing keys are cleared.

Parameters
valueThe value to set the key to.
Returns
Returns the index of the new data-key (always zero) or -1 on failure.

◆ setValueScale()

Boolean setValueScale ( valueScale  )

Set the scaling of field values retrieved from the field. This does not alter the actual data-key values.

Parameters
valueScaleThe scale for field values retrieved from the field.
Returns
Whether the operation was successful or not.