SetCameraShakeRotation: Difference between revisions

From Onset Developer Wiki
Created page with "{{Info|Function|Client|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|SetCameraShakeRotation(PitchAmp, PitchFreq, YawAmp, YawFreq, RollAmp, RollFreq)}} {{FuncParameters..."
 
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Info|Function|Client|1.0}}
{{Info|Function|Client|1.0}}


{{FuncDescription|__EDIT_ME__}}
{{FuncDescription|Set the camera shake rotation properties.}}


{{FuncSyntax|SetCameraShakeRotation(PitchAmp, PitchFreq, YawAmp, YawFreq, RollAmp, RollFreq)}}
{{FuncSyntax|SetCameraShakeRotation(PitchAmp, PitchFreq, YawAmp, YawFreq, RollAmp, RollFreq)}}


{{FuncParameters}}
{{FuncParameters}}
{{FuncParam|PitchAmp|__EDIT_ME__}}
{{FuncParam|PitchAmp|The pitch amplitude in floating point value.}}
{{FuncParam|PitchFreq|__EDIT_ME__}}
{{FuncParam|PitchFreq|The pitch frequency in floating point value.}}
{{FuncParam|YawAmp|__EDIT_ME__}}
{{FuncParam|YawAmp|The yaw amplitude in floating point value.}}
{{FuncParam|YawFreq|__EDIT_ME__}}
{{FuncParam|YawFreq|The yaw frequency in floating point value.}}
{{FuncParam|RollAmp|__EDIT_ME__}}
{{FuncParam|RollAmp|The rolling amplitude in floating point value.}}
{{FuncParam|RollFreq|__EDIT_ME__}}
{{FuncParam|RollFreq|The roll frequency in floating point value.}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|Returns '''true''' on success.}}


== Example ==
== Example ==
__EDIT_ME__
Example taken from https://github.com/BlueMountainsIO/OnsetLuaScripts/blob/6ef0c5406e84a434ca2d497c470404802f05e0d6/horizon/client/world.lua
<syntaxhighlight lang="Lua>
function ToggleDrunkEffect()
if (not DrunkOn) then
DrunkOn = true
SetPostEffect("ImageEffects", "VignetteIntensity", 1.0)
SetPostEffect("Chromatic", "Intensity", 5.0)
SetPostEffect("Chromatic", "StartOffset", 0.1)
SetPostEffect("MotionBlur", "Amount", 0.05)
SetPostEffect("MotionWhiteBalanceBlur", "Temp", 7000)
SetCameraShakeRotation(0.0, 0.0, 1.0, 10.0, 0.0, 0.0)
SetCameraShakeFOV(5.0, 5.0)
PlayCameraShake(100000.0, 2.0, 1.0, 1.1)
else
DrunkOn = false
SetPostEffect("ImageEffects", "VignetteIntensity", 0.25)
SetPostEffect("Chromatic", "Intensity", 0.0)
SetPostEffect("Chromatic", "StartOffset", 0.0)
SetPostEffect("MotionBlur", "Amount", 0.0)
SetPostEffect("MotionWhiteBalanceBlur", "Temp", 6500)
StopCameraShake(false)
end
end
AddRemoteEvent("ToggleDrunkEffect", ToggleDrunkEffect)
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
{{Template:CameraShakeFunctions}}

Latest revision as of 14:52, 23 December 2020

SetCameraShakeRotation

Type: Function
Context: Client
Introduced: v1.0

Description

Set the camera shake rotation properties.

Syntax

SetCameraShakeRotation(PitchAmp, PitchFreq, YawAmp, YawFreq, RollAmp, RollFreq)

Parameters

  • PitchAmp
    The pitch amplitude in floating point value.
  • PitchFreq
    The pitch frequency in floating point value.
  • YawAmp
    The yaw amplitude in floating point value.
  • YawFreq
    The yaw frequency in floating point value.
  • RollAmp
    The rolling amplitude in floating point value.
  • RollFreq
    The roll frequency in floating point value.

Return Value

  • Returns true on success.

Example

Example taken from https://github.com/BlueMountainsIO/OnsetLuaScripts/blob/6ef0c5406e84a434ca2d497c470404802f05e0d6/horizon/client/world.lua

function ToggleDrunkEffect()
	if (not DrunkOn) then
		DrunkOn = true
		SetPostEffect("ImageEffects", "VignetteIntensity", 1.0)
		SetPostEffect("Chromatic", "Intensity", 5.0)
		SetPostEffect("Chromatic", "StartOffset", 0.1)
		SetPostEffect("MotionBlur", "Amount", 0.05)
		SetPostEffect("MotionWhiteBalanceBlur", "Temp", 7000)
		SetCameraShakeRotation(0.0, 0.0, 1.0, 10.0, 0.0, 0.0)
		SetCameraShakeFOV(5.0, 5.0)
		PlayCameraShake(100000.0, 2.0, 1.0, 1.1)
	else
		DrunkOn = false
		SetPostEffect("ImageEffects", "VignetteIntensity", 0.25)
		SetPostEffect("Chromatic", "Intensity", 0.0)
		SetPostEffect("Chromatic", "StartOffset", 0.0)
		SetPostEffect("MotionBlur", "Amount", 0.0)
		SetPostEffect("MotionWhiteBalanceBlur", "Temp", 6500)
		StopCameraShake(false)
	end
end
AddRemoteEvent("ToggleDrunkEffect", ToggleDrunkEffect)

See also