SetNearClipPlane: Difference between revisions

From Onset Developer Wiki
m (Minor addition)
No edit summary
Line 8: Line 8:
{{FuncParam|distance|The distance in which you have to cull the objects. Set to zero (0) to reset back to defaults.}}
{{FuncParam|distance|The distance in which you have to cull the objects. Set to zero (0) to reset back to defaults.}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|Returns nothing.}}


== Example ==
== Example ==

Revision as of 18:34, 17 June 2020

SetNearClipPlane

Type: Function
Context: Client
Introduced: v1.0

Description

This function culls triangles in a certain distance. Useful for the first person mode to hide head attachments.

Syntax

SetNearClipPlane(distance)

Parameters

  • distance
    The distance in which you have to cull the objects. Set to zero (0) to reset back to defaults.

Return Value

  • Returns nothing.

Example

function OnKeyPress(key)
	if key == "P" then
		local bEnable = not IsFirstPersonCamera()
		EnableFirstPersonCamera(bEnable)
		SetNearClipPlane(15)
	end
end
AddEvent("OnKeyPress", OnKeyPress)

See also

Template:ClientPlayerFunctions