GM:CalcView

From Garry's Mod
Jump to: navigation, search
 GM:CalcView( )

Contents

Description

Allows override of the default view.

Arguments

Player ply

The local player.

Arguments

Vector origin

The player's view position.

Arguments

Angle angles

The player's view angles.

Arguments

number fov

Field of view.

Arguments

number znear

Distance to near clipping plane.

Arguments

number zfar

Distance to far clipping plane.

Returns

table

View data table. See CamData structure

Examples

Example

Draws the LocalPlayer and sets the view behind.

local function MyCalcView(ply, pos, angles, fov)
    local view = {}
    view.origin = pos-(angles:Forward()*100)
    view.angles = angles
    view.fov = fov
    view.drawviewer = true
 
    return view
end
 
hook.Add( "CalcView", "MyCalcView", MyCalcView )


Personal tools
Navigation