EngineGetModelLODDistance: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "{{Client function}} __NOTOC__ This function gets the LOD distance for any object / model ID. ==Syntax== <syntaxhighlight lang="lua"> float engineGetModelLODDistance ( int model ) </syntaxhighlight> =...")
 
No edit summary
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">
Line 15: Line 16:


==Example==  
==Example==  
<section name="Client" class="client" show="true">
This example calculates the actual LOD distance by taking into account the Video tab 'Draw distance' setting
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
-- TODO
local LODDistance = engineGetModelLODDistance( 1337 )
local actualLODDistance = math.min( 300, LODDistance * ( dxGetStatus().SettingDrawDistance / 100 + 1 ) )
</syntaxhighlight>
</syntaxhighlight>
</section>


==Requirements==
==Requirements==

Revision as of 20:39, 24 October 2012

ADDED/UPDATED IN VERSION 1.3.1 r4779:

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

Syntax

float engineGetModelLODDistance ( int model ) 

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 ) )

Requirements

Minimum server version n/a
Minimum client version 1.3.1-9.04779

Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version client="1.3.1-9.04779" />

See Also