GetNearClipDistance

From Multi Theft Auto: Wiki
Revision as of 16:07, 27 November 2014 by AlexTMjugador (talk | contribs) (Documented the function added in r6948)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function gets the distance from the camera at which the world starts rendering. For more information about this please refer to setNearClipDistance.

Syntax

float getNearClipDistance ( )

Returns

This function returns a float containing the actual near clip distance.

Example

This example adds a /testmynearclipdistance command which outputs different things deppending of the current near clip distance.

local function tellPlayerNearClipFacts()
    local nearClipDistance = getNearClipDistance()
    outputChatBox(nearClipDistance == 0.3 and "Your near clip distance is normal." or (nearClipDistance > 0.3 and "Be aware! You shouldn't be able to see very near objects so well!" or "You should be able to see very near objects so well!"))
end
addCommandHandler("/testmynearclipdistance", tellPlayerNearClipFacts)

See also