SetEngineCameraNearClipPlane

Definition

SetEngineCameraNearClipPlane(string engineCameraName, float nearClipPlane)

Description

This function sets the near clip plane value of the engine camera engineCameraName to nearClipPlane.

Parameters

engineCameraName
Specifies the name of the engine camera. You can also use the name “this” for this parameter. In this case, “this” refers to the camera object that this script is attached to.

nearClipPlane
Specifies the near clip plane of engine camera. This value must be greater than 0.0.

Example 1

function Init()
    ActivateEngineCamera("camera1")
    SetEngineCameraNearClipPlane("camera1", 0.1)
end

function Update()

end
First we activate the engine camera “camera1”. Then we set the near clip plane of engine camera “camera1” to 0.1.

Example 2

--Name of script is SetEngineCameraNearClipPlane2.lua

function Init()
    ActivateEngineCamera("this")
    SetEngineCameraNearClipPlane("this", 0.1)
end

function Update()

end
In this case, “this” string in the SetEngineCameraNearClipPlane function points to the camera that SetEngineCameraNearClipPlane2.lua script is attached to. For example, if SetEngineCameraNearClipPlane2.lua script is attached to a engine camera named “camera1”, “this” will be equivalent to the name “camera1”. In this example, we activate the current engine camera (for example, “camera1”). Then we set the near clip plane of current engine camera to 0.1.
adminSetEngineCameraNearClipPlane