PositionSpawnIcon

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

Contents

Description

Moves the given model to the given position and calculates appropriate camera parameters for rendering the model to an icon.

The output table interacts nicely with Panel:RebuildSpawnIconEx with a few key renames.

Arguments

Entity model

Model that is being rendered to the spawn icon

Arguments

Vector position

Position that the model is being rendered at

Arguments

boolean noAngles

If true the function won't reset the angles to 0 for the model.

Returns

table

Table of information of the view which can be used for rendering

Examples

Example

Creates a clientside model and then PositionSpawnIcon is used to figure out the appropriate camera parameters for rendering this model.

local ent = ClientsideModel("models/props_wasteland/cafeteria_table001a.mdl", RENDERGROUP_BOTH)
local tab = PositionSpawnIcon(ent, vector_origin)
ent:Remove()

PrintTable(tab)

Output:

angles	=	25.000 220.000 0.000
fov	=	8.4436927451273
origin	=	1156.924316 970.773010 704.184265
zfar	=	1888.5692536466
znear	=	1
Personal tools
Navigation