Garry's Mod Wiki

cam

This directs all drawing to be done to a certain 2D or 3D plane or position, until the corresponding "End" function is called.

The matrix functions exist, but are mostly unusable unless you're familiar with the source engine's layout for each aspect.

Methods

cam.ApplyShake( Vector pos, Angle angles, number factor )
Shakes the screen at a certain position.
cam.End()
Switches the renderer back to the previous drawing mode from a 3D context. This function is an alias of cam.End3D. This will crash the game if there is no context to end.
cam.End2D()
Switches the renderer back to the previous drawing mode from a 2D context. This will crash the game if there is no context to end.
cam.End3D()
Switches the renderer back to the previous drawing mode from a 3D context. This will crash the game if there is no context to end.
cam.End3D2D()
Switches the renderer back to the previous drawing mode from a 3D2D context. This will crash the game if there is no context to end.
cam.EndOrthoView()
Switches the renderer back to the previous drawing mode from a 3D orthographic rendering context.
VMatrix cam.GetModelMatrix()
Returns the currently active model matrix. (TODO: Does this actually mean the matrix on top of the stack? Probably)
cam.IgnoreZ( boolean ignoreZ )
Tells the renderer to ignore the depth buffer and draw any upcoming operation "ontop" of everything that was drawn yet.
cam.PopModelMatrix()
Pops the current active rendering matrix from the stack and reinstates the previous one.
cam.PushModelMatrix( VMatrix matrix, boolean multiply = false )
Pushes the specified matrix onto the render matrix stack. Unlike opengl, this will replace the current model matrix. This does not work with cam.Start3D2D in certain hooks.
cam.Start( table dataTbl )
Sets up a new rendering context. This is an extended version of cam.Start3D and cam.Start2D. Must be finished by cam.End3D or cam.End2D. This will not update current view properties for 3D contexts.
cam.Start2D()
Sets up a new 2D rendering context. Must be finished by cam.End2D. This is almost always used with a render target from the render. To set its position use render.SetViewPort with a target already stored. This will put an identity matrix at the top of the model matrix stack. If you are trying to use cam.PushModelMatrix, call it after this function and not before. <rendercontext hook="false" type="2D"/>
cam.Start3D( Vector pos = EyePos(), Angle angles = EyeAngles(), number fov = nil, number x = 0, number y = 0, number w = ScrW(), number h = ScrH(), number zNear = nil, number zFar = nil )
Sets up a new 3D rendering context. Must be finished by cam.End3D. For more advanced settings such as an orthographic view, use cam.Start instead. This is a rendering function that requires a 3d rendering context. This means that it will only work in 3d Rendering Hooks.Negative x/y values won't work.This will not update current view properties.
cam.Start3D2D( Vector pos, Angle angles, number scale )
Sets up a new 2D rendering context. Must be finished by cam.End3D2D. This function pushes a new matrix onto the stack. (cam.PushModelMatrix) This is a rendering function that requires a 2d rendering context. This means that it will only work in 2d Rendering Hooks.This is a rendering function that requires a 3d rendering context. This means that it will only work in 3d Rendering Hooks.This should be closed by cam.End3D2D otherwise the game crashes
cam.StartOrthoView( number leftOffset, number topOffset, number rightOffset, number bottomOffset )
Sets up a new 3d context using orthographic projection.

Page Links


Special Pages


Wikis

?

Render Time: 27ms

Session 0
DB GetPage 2
Generate Html 2
SaveChanges 8
Render Body 0
Render Sidebar 13