EngineGetModelLODDistance: Difference between revisions
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> =...") |
Zangomangu (talk | contribs) (Removed fix issue) Tag: Manual revert |
||
(5 intermediate revisions by 5 users not shown) | |||
Line 7: | Line 7: | ||
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 15: | Line 15: | ||
==Example== | ==Example== | ||
This example calculates the actual LOD distance by taking into account the Video tab 'Draw distance' setting | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
local LODDistance = engineGetModelLODDistance( 1337 ) | |||
local actualLODDistance = math.min( 300, LODDistance * ( dxGetStatus().SettingDrawDistance / 100 + 1 ) ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==Requirements== | ==Requirements== | ||
Line 25: | Line 25: | ||
==See Also== | ==See Also== | ||
* [[getVehiclesLODDistance]] | |||
* [[resetVehiclesLODDistance]] | |||
* [[setVehiclesLODDistance]] | |||
{{Engine_functions}} | {{Engine_functions}} |
Latest revision as of 10:14, 30 January 2022
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 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
- engineAddImage
- engineApplyShaderToWorldTexture
- engineFreeModel
- engineGetModelFlags
- engineGetModelIDFromName
- engineGetModelLODDistance
- engineGetModelNameFromID
- engineGetModelPhysicalPropertiesGroup
- engineGetModelTextureNames
- engineGetModelTextures
- engineGetModelTXDID
- engineGetModelVisibleTime
- engineGetObjectGroupPhysicalProperty
- engineGetSurfaceProperties
- engineGetVisibleTextureNames
- engineImageGetFilesCount
- engineImageGetFiles
- engineImageGetFile
- engineImageLinkDFF
- engineImageLinkTXD
- engineImportTXD
- engineLoadCOL
- engineLoadDFF
- engineLoadIMG
- engineLoadIFP
- engineLoadTXD
- engineRemoveImage
- engineRemoveShaderFromWorldTexture
- engineReplaceAnimation
- engineReplaceCOL
- engineReplaceModel
- engineRequestModel
- engineResetModelFlags
- engineResetModelLODDistance
- engineResetSurfaceProperties
- engineRestoreAnimation
- engineRestoreCOL
- engineRestoreDFFImage
- engineRestoreModel
- engineRestoreModelPhysicalPropertiesGroup
- engineRestoreObjectGroupPhysicalProperties
- engineRestoreTXDImage
- engineRestreamWorld
- engineSetAsynchronousLoading
- engineSetModelFlag
- engineSetModelFlags
- engineSetModelLODDistance
- engineSetModelPhysicalPropertiesGroup
- engineSetModelVisibleTime
- engineSetObjectGroupPhysicalProperty
- engineSetSurfaceProperties
- engineStreamingFreeUpMemory
- engineStreamingGetUsedMemory