Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow you to define thirdperson camera center offset #21

Merged
merged 1 commit into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lua/entities/base_glide/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ if CLIENT then

-- Setup the camera parameters for this vehicle
ENT.CameraOffset = Vector( -200, 0, 50 )
ENT.CameraCenterOffset = Vector( 0, 0, 0 )
ENT.CameraAngleOffset = Angle( 6, 0, 0 )

-- Setup how far away players can hear sounds and update misc. features
Expand All @@ -90,14 +91,14 @@ if CLIENT then

-- Set label/icons for each weapon slot.
-- This should contain a array of tables, where each table looks like these:
--
--
-- { name = "Machine Guns", icon = "glide/icons/bullets.png" }
-- { name = "Missiles", icon = "glide/icons/rocket.png" }
ENT.WeaponInfo = {}

-- Set crosshair parameters per weapon slot.
-- This should contain a array of tables, where each table looks like these:
--
--
-- { iconType = "dot", traceOrigin = Vector() }
-- { iconType = "square", traceOrigin = Vector(), traceAngle = Angle(), size = 0.1 }
ENT.CrosshairInfo = {}
Expand Down Expand Up @@ -183,7 +184,7 @@ if SERVER then

-- Setup available weapon slots.
-- Should contain a array of tables, where each table looks like this:
--
--
-- { maxAmmo = 0, fireRate = 0.02 }
-- { maxAmmo = 2, fireRate = 1.0, replenishDelay = 2, ammoType = "missile" }
ENT.WeaponSlots = {}
Expand Down
2 changes: 1 addition & 1 deletion lua/glide/client/camera.lua
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ function Camera:CalcView()
else
local fraction = self.traceFraction
local offset = self.shakeOffset + vehicle.CameraOffset * Vector( Config.cameraDistance, 1, Config.cameraHeight ) * fraction
local startPos = vehicle:GetPos()
local startPos = vehicle:LocalToWorld( vehicle.CameraCenterOffset )

angles = angles + vehicle.CameraAngleOffset

Expand Down
Loading