EngineGetModelLODDistance: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(Remove obsolete Requirements section)
 
(5 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Client function}}
{{Client function}}
__NOTOC__
__NOTOC__
{{New feature/item|4.0132|1.3.1|4779|
This function gets the LOD distance for any object / model ID.
This function gets the LOD distance for any object / model ID.
}}
 
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
float engineGetModelLODDistance ( int model )  
float engineGetModelLODDistance ( int model )  
</syntaxhighlight>  
</syntaxhighlight>  
 
{{OOP||Engine.getModelLODDistance}}
===Required Arguments===  
===Required Arguments===  
*'''model:''' The model / object ID number you want to get the LOD distance of.
*'''model:''' The model / object ID number you want to get the LOD distance of.
Line 21: Line 20:
local actualLODDistance = math.min( 300, LODDistance * ( dxGetStatus().SettingDrawDistance / 100 + 1 ) )
local actualLODDistance = math.min( 300, LODDistance * ( dxGetStatus().SettingDrawDistance / 100 + 1 ) )
</syntaxhighlight>
</syntaxhighlight>
==Requirements==
{{Requirements|n/a|1.3.1-9.04779|}}


==See Also==
==See Also==
* [[getVehiclesLODDistance]]
* [[resetVehiclesLODDistance]]
* [[setVehiclesLODDistance]]
{{Engine_functions}}
{{Engine_functions}}

Latest revision as of 17:08, 7 November 2024

This function gets the LOD distance for any object / model ID.

Syntax

float engineGetModelLODDistance ( int model ) 

OOP Syntax Help! I don't understand this!

Method: Engine.getModelLODDistance(...)


Required Arguments

  • model: The model / object ID number you want to get the LOD distance of.

Returns

Returns a float representing the LOD distance of the model, or false if the model argument is incorrect.

Example

This example calculates the actual LOD distance by taking into account the Video tab 'Draw distance' setting

local LODDistance = engineGetModelLODDistance( 1337 )
local actualLODDistance = math.min( 300, LODDistance * ( dxGetStatus().SettingDrawDistance / 100 + 1 ) )

See Also