Garry's Mod Wiki

GM:CalcView

table GM:CalcView( Player ply, Vector origin, Angle angles, number fov, number znear, number zfar )

Description

Allows override of the default view.

Arguments

1 Player ply
The local player.
2 Vector origin
The player's view position.
3 Angle angles
The player's view angles.
4 number fov
Field of view.
5 number znear
Distance to near clipping plane.
6 number zfar
Distance to far clipping plane.

Returns

1 table
View data table. See Structures/CamData

Example

Draws the LocalPlayer and sets the view behind.

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

Page Links


Special Pages


Wikis

?

Render Time: 106ms

DB GetPage 50
Generate Html 23
SaveChanges (1) 23
Render Body 0
Render Sidebar 7