DModelPanel:SetLookAt
Description
Makes the panel's camera face the given position. Basically sets the camera's angles (DModelPanel:SetLookAng) after doing some math.
Arguments
Example
Creates a model panel focused on Colonel Odessa Cubbage's face.
BGPanel = vgui.Create("DPanel")
BGPanel:SetPos(20, 20)
BGPanel:SetSize(200, 200)
local mdl = vgui.Create("DModelPanel", BGPanel)
mdl:SetSize(BGPanel:GetSize())
mdl:SetModel("models/player/odessa.mdl")
function mdl:LayoutEntity( Entity ) return end -- Disable cam rotation
local headpos = mdl.Entity:GetBonePosition(mdl.Entity:LookupBone("ValveBiped.Bip01_Head1"))
mdl:SetLookAt(headpos)
mdl:SetCamPos(headpos-Vector(-15, 0, 0)) -- Move cam in front of face
--mdl.Entity:SetEyeTarget(headpos-Vector(-15, 0, 0))
-- Makes Odessa look at the camera
-- Commented out because the result is funnier without this
Output: 
