GetOcclusionsEnabled: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(Remove obsolete Requirements section)
 
Line 25: Line 25:
end
end
</syntaxhighlight>
</syntaxhighlight>
==Requirements==
{{Requirements|1.3|1.3|}}


==See Also==
==See Also==
{{World functions}}
{{World functions}}

Latest revision as of 17:00, 7 November 2024

This function is used to get "occlusions enabled" state.

[[{{{image}}}|link=|]] Note: Occlusions are used by GTA to enhance performance by hiding objects that are (normally) obscured by certain large buildings. However when removeWorldModel is used they may also have the undesired effect of making parts of the map disappear. Disabling occlusions will fix that.

Syntax

bool getOcclusionsEnabled ( )

Returns

Returns true if occlusions are enabled, or false otherwise.

Example

This example shows how to disable occlusions after the whole map has been cleared:

-- Remove all world models
for i=700,20000 do
    removeWorldModel(i,10000,0,0,0)
end

-- Turn off occlusions with simple check
if getOcclusionsEnabled() then
    setOcclusionsEnabled( false )
end

See Also