fsVfxSetOffset

The fsVfxSetOffset function can be use to set an offset (in meters) from the point at which the VFX was spawned.

 

 

Syntax
bool fsVfxSetOffset(
    FsVfxId id,
    FsVec3d newOffset
);

 

Members
Parameters Description
id The ID of the VFX to set the offset of, as returned by either fsVfxSpawnInWorld or fsVfxSpawnOnSimObject.
newOffset An array of three values representing the offset in meters along the latitude, longitude and altitude axis.

Return Values

The function will return TRUE if the given ID exists and is a valid VFX instance, otherwise it will return FALSE.

 

Example
FsVec3d translation = { g_MoveVars.translationSpeed * g_MoveVars.sideMoveDir, 0, g_MoveVars.translationSpeed * g_MoveVars.faceMoveDir };
g_MoveVars.currentOffset.x += g_MoveVars.translationSpeed * g_MoveVars.sideMoveDir;
g_MoveVars.currentOffset.z += g_MoveVars.translationSpeed * g_MoveVars.faceMoveDir;
fsVfxSetOffset(g_MoveVars.vfxId, g_MoveVars.currentOffset);

 

Remarks

If the VFX instance has been spawned on a Sim Object, then it will use the coordinate system of the node on which it is attached or the one of the Sim Object if none was specified, so the offset will be relative to the node/object and take the pitch, bank and heading into account.


If the VFX instance is spawned in the world, then the offset will be relative to the original position, but with an absolute pitch, bank and heading of 0.

 

See Also