Skip to content

Commit 65a22ff

Browse files
committed
more camera part quick setups (place camera from editor view)
apply editor view - translates editor camera position into local space, with a series of sub-options to switch between editor or default camera FOV, and select bones centralized the zoom slider's bounds-setting functions into one Add an option on the fov slider to raise its fov limit. By default it should stay at 100, but expanding it to 179 would be used to mirror the camera part's limits to set up some of the more exaggerated camera shots we might see in stylized animation and such (e.g. high FOV close-up on a weapon to make it look bigger). converted some of the camera quick setup options into right clickable options that don't automatically close the menu, allowing a better experience in trying out different configs. I'm experimenting with that, would be good when there are occasionally options with multiple choices which would benefit from immediate 1-click feedback. I will tentatively explore this, but it should be used sparingly, for various reasons. misusing it might result in anti-QoL because most options introduce side effects that don't get undone by neighboring options, since they often do separate things try to look for an alternate head if the standard valvebiped head isn't found the base height used for calculation is now a traced hit to sample the top of the head instead of the base of the head bone. hopefully it works better. it's also manually adjustable (right clickable options refresh the height variable) to other alternates (between head bone's base, trace, hull height, eyepos), it's ultimately a micro difference but will be added for the sake of information and comparison add option to clone the camera position as a dummy model for interpolators
1 parent ba54007 commit 65a22ff

File tree

3 files changed

+336
-98
lines changed

3 files changed

+336
-98
lines changed

lua/pac3/editor/client/panels/editor.lua

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,22 @@ local zoom_smooth = CreateClientConVar("pac_zoom_smooth", 0, true, false, 'Enabl
2121
local remember_divider = CreateConVar("pac_editor_remember_divider_height", "0", {FCVAR_ARCHIVE}, "Remember PAC3 editor's vertical divider position")
2222
local remember_width = CreateConVar("pac_editor_remember_width", "0", {FCVAR_ARCHIVE}, "Remember PAC3 editor's width")
2323

24+
function pace.RefreshZoomBounds(zoomslider)
25+
if pace.Editor then
26+
if not zoomslider then
27+
zoomslider = pace.Editor.zoomslider
28+
end
29+
if pace.camera_orthographic then
30+
zoomslider:SetMin(-10000)
31+
zoomslider:SetMax(10000)
32+
else
33+
zoomslider:SetMin(0)
34+
zoomslider:SetMax(pace.max_fov)
35+
timer.Simple(0, function() zoomslider:SetValue(math.Clamp(pace.ViewFOV, 0, pace.max_fov)) end)
36+
end
37+
end
38+
end
39+
2440
function PANEL:Init()
2541
self:SetTitle("")
2642
self:SetSizable(true)
@@ -104,6 +120,14 @@ function PANEL:Init()
104120
self.smoothlabel:SetWrap(true)
105121
self.smoothlabel:SetAutoStretchVertical(true)
106122

123+
self.limitfovcheckbox = vgui.Create("DCheckBoxLabel", self.zoomsettings)
124+
self.limitfovcheckbox:SetText("Expanded FOV")
125+
self.limitfovcheckbox:SetChecked(pace.max_fov ~= 100)
126+
self.limitfovcheckbox:Dock(TOP)
127+
self.limitfovcheckbox:SetDark(true)
128+
self.limitfovcheckbox:DockMargin(0,SETTING_MARGIN_TOP,0,0)
129+
130+
107131
self.orthocheckbox = vgui.Create("DCheckBoxLabel", self.zoomsettings)
108132
self.orthocheckbox:SetText("Orthographic")
109133
self.orthocheckbox:Dock(TOP)
@@ -151,15 +175,12 @@ function PANEL:Init()
151175
self.zoomslider = vgui.Create("DNumSlider", self.sliderpanel)
152176
self.zoomslider:DockPadding(4,0,0,0)
153177
self.zoomslider:SetSize(200, 20)
154-
self.zoomslider:SetMin( 0 )
155-
self.zoomslider:SetMax( 100 )
156178
self.zoomslider:SetDecimals( 0 )
157179
self.zoomslider:SetText("Camera FOV")
158180
if pace.camera_orthographic then
159181
self.zoomslider:SetText("Ortho. Width")
160-
self.zoomslider:SetMin( -10000 )
161-
self.zoomslider:SetMax( 10000 )
162182
end
183+
pace.RefreshZoomBounds(self.zoomslider)
163184
self.zoomslider:SetDark(true)
164185
self.zoomslider:SetDefaultValue( 75 )
165186

@@ -168,6 +189,15 @@ function PANEL:Init()
168189
else
169190
self.zoomslider:SetValue( 75 )
170191
end
192+
local zoomslider = self.zoomslider
193+
function self.limitfovcheckbox:OnChange(b)
194+
if b then
195+
pace.max_fov = 179
196+
else
197+
pace.max_fov = 100
198+
end
199+
pace.RefreshZoomBounds(zoomslider)
200+
end
171201

172202
self.btnClose.Paint = function() end
173203

0 commit comments

Comments
 (0)