fogParams: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<code>\[\[private\]\] _([a-zA-Z0-9_]+) = \[\[([a-zA-Z0-9]+)\]\];?<\/code>" to "<sqf>private _$1 = $2;</sqf>")
No edit summary
Line 15: Line 15:


|seealso= [[setFog]] [[fog]] [[fogForecast]] [[rainParams]]
|seealso= [[setFog]] [[fog]] [[fogForecast]] [[rainParams]]
}}
{{Note
|user= POLPOX
|timestamp= 20230923065153
|text= To return a position (ASL Height)'s approx. fog level
<sqf>private _getFogPowerASL = {
    fogParams params ["_fogPower","_fogDecay","_fogHeight"] ;
    private _height = _this - _fogHeight;
    (_fogPower*(1/2)^(_height*_fogDecay/2.45) max 0)
};
(AGLToASL (positionCameraToWorld [0,0,0])#2) call _getFogPowerASL</sqf>
Note that, this could return >1 value if fogDecay is not 0.
}}
}}

Revision as of 08:51, 23 September 2023

Hover & click on the images for description

Description

Description:
A getter for setFog (Alt Syntax). Returns extended params for the fog
Groups:
Environment

Syntax

Syntax:
fogParams
Return Value:
Array of Numbers - in setFog format: [fogValue, fogDecay, fogBase]

Examples

Example 1:
private _fog = fogParams;

Additional Information

See also:
setFog fog fogForecast rainParams

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
POLPOX - c
Posted on Sep 23, 2023 - 06:51 (UTC)
To return a position (ASL Height)'s approx. fog level
private _getFogPowerASL = { fogParams params ["_fogPower","_fogDecay","_fogHeight"] ; private _height = _this - _fogHeight; (_fogPower*(1/2)^(_height*_fogDecay/2.45) max 0) }; (AGLToASL (positionCameraToWorld [0,0,0])#2) call _getFogPowerASL
Note that, this could return >1 value if fogDecay is not 0.