EngineGetModelLODDistance
From Multi Theft Auto: Wiki
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 ) )
Requirements
Minimum supported server | n/a |
---|---|
Minimum supported client | 1.3.1-9.04779 |
Note: Using this function 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" />
Issues
Issue ID | Description |
---|---|
#9139 | Invalid model ID will crash when used with engine LOD distance functions. |
See Also
- getVehiclesLODDistance
- resetVehiclesLODDistance
- setVehiclesLODDistance
- engineApplyShaderToWorldTexture
- engineGetModelIDFromName
- engineGetModelLODDistance
- engineGetModelNameFromID
FROM VERSION 1.5.7 r19626 ONWARDS
FROM VERSION 1.5.7 r20147 ONWARDS
- engineGetModelTextureNames
- engineGetVisibleTextureNames
- engineImportTXD
- engineLoadCOL
- engineLoadDFF
- engineLoadIFP
- engineLoadTXD
- engineRemoveShaderFromWorldTexture
- engineReplaceAnimation
- engineReplaceCOL
- engineReplaceModel
- engineRestoreAnimation
- engineRestoreCOL
- engineRestoreModel
- engineSetAsynchronousLoading
- engineSetModelLODDistance
- engineSetSurfaceProperties
- engineGetSurfaceProperties
- engineResetSurfaceProperties