Gyro_Object_SetTurbulence(entity object, float turbulence, float smoothness)
The turbulence subsystem will constantly apply randomised motion to physics objects. The strength of the turbulence is relative to the object's mass and determines how much velocity to add, multiplied by the power constant (rather than by gravity). The smoothness argument is new to Gyro 2.1 and permits smaller, more subtle shifts in velocity than were possible before. It should be given as a float between 0.0
and 1.0
, where higher values provide smoother velocity changes. The final turbulence level is then scaled per-environment by the GYRO_TURBULENCEMOD_***
constants, as found here.
Gyro_Object_SetTurbulenceMod(entity object, float turbulence, float smoothness, float airturb, float waterturb, float slimeturb, float lavaturb)
This declaration encapsulates all the functionality of the above but also accepts four extra float arguments. These arguments can be used to set the environment multipliers on a per-object basis rather than using the default GYRO_TURBULENCEMOD_***
constants.
Gyro_Object_RemoveTurbulence(entity object)
Removes all turbluence properties from a specified object.
Gyro_Object_SetGlobalTurb(entity object, float turbulence, float smoothness)
Global turbulence operates in exactly the same way as the standard turbulence above, except the random motion is shared between all objects. This is especially useful for objects floating on the surface of water, as they will move and sway together, creating a more convincing illusion of waves and ripples. The two turbulence systems are not mutually exclusive and should ideally be used together for best results.
Gyro_Object_SetGlobalTurbMod(entity object, float turbulence, float smoothness, float airturb, float waterturb, float slimeturb, float lavaturb)
Global turbulence implementation of the above Gyro_Object_SetTurbulenceMod()
function.
Gyro_Object_RemoveTurbulence(entity object)
Removes all global turbluence properties from a specified object.
Note: The presence of two turbulence subsystems creates a lot of unneccessary code. Later versions of Gyro may combine the two into a single subsystem, assuming a suitable way of doing it is found.