Skip to content

Commit

Permalink
(0.654.1.6540477)
Browse files Browse the repository at this point in the history
  • Loading branch information
EgoMoose authored and github-actions[bot] committed Dec 11, 2024
1 parent 54c77b7 commit 63687be
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 21 deletions.
16 changes: 13 additions & 3 deletions src/PlayerModulePatched/CameraModule/ClassicCamera.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ local FlagUtil = require(CommonUtils:WaitForChild("FlagUtil"))

local FFlagUserFixCameraOffsetJitter = FlagUtil.getUserFlag("UserFixCameraOffsetJitter2")
local FFlagUserCameraInputDt = FlagUtil.getUserFlag("UserCameraInputDt")

local FFlagUserFixCameraFPError = FlagUtil.getUserFlag("UserFixCameraFPError")

--[[ Services ]]--
local PlayersService = game:GetService("Players")
Expand Down Expand Up @@ -202,12 +202,22 @@ function ClassicCamera:Update(dt)

local cameraFocusP = newCameraFocus.p
local newLookVector = self:CalculateNewLookVectorFromArg(overrideCameraLookVector, rotateInput)
newCameraCFrame = CFrame.new(cameraFocusP - (zoom * newLookVector), cameraFocusP)

if FFlagUserFixCameraFPError then
newCameraCFrame = CFrame.lookAlong(cameraFocusP - (zoom * newLookVector), newLookVector)
else
newCameraCFrame = CFrame.new(cameraFocusP - (zoom * newLookVector), cameraFocusP)
end
else -- is FollowCamera
local newLookVector = self:CalculateNewLookVectorFromArg(overrideCameraLookVector, rotateInput)

newCameraFocus = CFrame.new(subjectPosition)
newCameraCFrame = CFrame.new(newCameraFocus.p - (zoom * newLookVector), newCameraFocus.p) + Vector3.new(0, cameraHeight, 0)

if FFlagUserFixCameraFPError then
newCameraCFrame = CFrame.lookAlong(newCameraFocus.p - (zoom * newLookVector), newLookVector)
else
newCameraCFrame = CFrame.new(newCameraFocus.p - (zoom * newLookVector), newCameraFocus.p) + Vector3.new(0, cameraHeight, 0)
end
end

local toggleOffset = self:GetCameraToggleOffset(timeDelta)
Expand Down
27 changes: 21 additions & 6 deletions src/PlayerModulePatched/CameraModule/Poppercam.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
Poppercam - Occlusion module that brings the camera closer to the subject when objects are blocking the view.
--]]

local CommonUtils = script.Parent.Parent:WaitForChild("CommonUtils")
local FlagUtil = require(CommonUtils:WaitForChild("FlagUtil"))

local ZoomController = require(script.Parent:WaitForChild("ZoomController"))
local FFlagUserFixCameraFPError = FlagUtil.getUserFlag("UserFixCameraFPError")

local TransformExtrapolator = {} do
TransformExtrapolator.__index = TransformExtrapolator
Expand Down Expand Up @@ -87,12 +91,23 @@ function Poppercam:Enable(enable)
end

function Poppercam:Update(renderDt, desiredCameraCFrame, desiredCameraFocus, cameraController)
local rotatedFocus = CFrame.new(desiredCameraFocus.p, desiredCameraCFrame.p)*CFrame.new(
0, 0, 0,
-1, 0, 0,
0, 1, 0,
0, 0, -1
)
local rotatedFocus = nil
if FFlagUserFixCameraFPError then
rotatedFocus = CFrame.lookAlong(desiredCameraFocus.p, -desiredCameraCFrame.LookVector)*CFrame.new(
0, 0, 0,
-1, 0, 0,
0, 1, 0,
0, 0, -1
)
else
rotatedFocus = CFrame.new(desiredCameraFocus.p, desiredCameraCFrame.p)*CFrame.new(
0, 0, 0,
-1, 0, 0,
0, 1, 0,
0, 0, -1
)
end

local extrapolation = self.focusExtrapolator:Step(renderDt, rotatedFocus)
local zoom = ZoomController.Update(renderDt, rotatedFocus, extrapolation)
return rotatedFocus*CFrame.new(0, 0, zoom), desiredCameraFocus
Expand Down
16 changes: 13 additions & 3 deletions src/PlayerModuleUnpatched/CameraModule/ClassicCamera.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ local FlagUtil = require(CommonUtils:WaitForChild("FlagUtil"))

local FFlagUserFixCameraOffsetJitter = FlagUtil.getUserFlag("UserFixCameraOffsetJitter2")
local FFlagUserCameraInputDt = FlagUtil.getUserFlag("UserCameraInputDt")

local FFlagUserFixCameraFPError = FlagUtil.getUserFlag("UserFixCameraFPError")

--[[ Services ]]--
local PlayersService = game:GetService("Players")
Expand Down Expand Up @@ -202,12 +202,22 @@ function ClassicCamera:Update(dt)

local cameraFocusP = newCameraFocus.p
local newLookVector = self:CalculateNewLookVectorFromArg(overrideCameraLookVector, rotateInput)
newCameraCFrame = CFrame.new(cameraFocusP - (zoom * newLookVector), cameraFocusP)

if FFlagUserFixCameraFPError then
newCameraCFrame = CFrame.lookAlong(cameraFocusP - (zoom * newLookVector), newLookVector)
else
newCameraCFrame = CFrame.new(cameraFocusP - (zoom * newLookVector), cameraFocusP)
end
else -- is FollowCamera
local newLookVector = self:CalculateNewLookVectorFromArg(overrideCameraLookVector, rotateInput)

newCameraFocus = CFrame.new(subjectPosition)
newCameraCFrame = CFrame.new(newCameraFocus.p - (zoom * newLookVector), newCameraFocus.p) + Vector3.new(0, cameraHeight, 0)

if FFlagUserFixCameraFPError then
newCameraCFrame = CFrame.lookAlong(newCameraFocus.p - (zoom * newLookVector), newLookVector)
else
newCameraCFrame = CFrame.new(newCameraFocus.p - (zoom * newLookVector), newCameraFocus.p) + Vector3.new(0, cameraHeight, 0)
end
end

local toggleOffset = self:GetCameraToggleOffset(timeDelta)
Expand Down
27 changes: 21 additions & 6 deletions src/PlayerModuleUnpatched/CameraModule/Poppercam.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
Poppercam - Occlusion module that brings the camera closer to the subject when objects are blocking the view.
--]]

local CommonUtils = script.Parent.Parent:WaitForChild("CommonUtils")
local FlagUtil = require(CommonUtils:WaitForChild("FlagUtil"))

local ZoomController = require(script.Parent:WaitForChild("ZoomController"))
local FFlagUserFixCameraFPError = FlagUtil.getUserFlag("UserFixCameraFPError")

local TransformExtrapolator = {} do
TransformExtrapolator.__index = TransformExtrapolator
Expand Down Expand Up @@ -87,12 +91,23 @@ function Poppercam:Enable(enable)
end

function Poppercam:Update(renderDt, desiredCameraCFrame, desiredCameraFocus, cameraController)
local rotatedFocus = CFrame.new(desiredCameraFocus.p, desiredCameraCFrame.p)*CFrame.new(
0, 0, 0,
-1, 0, 0,
0, 1, 0,
0, 0, -1
)
local rotatedFocus = nil
if FFlagUserFixCameraFPError then
rotatedFocus = CFrame.lookAlong(desiredCameraFocus.p, -desiredCameraCFrame.LookVector)*CFrame.new(
0, 0, 0,
-1, 0, 0,
0, 1, 0,
0, 0, -1
)
else
rotatedFocus = CFrame.new(desiredCameraFocus.p, desiredCameraCFrame.p)*CFrame.new(
0, 0, 0,
-1, 0, 0,
0, 1, 0,
0, 0, -1
)
end

local extrapolation = self.focusExtrapolator:Step(renderDt, rotatedFocus)
local zoom = ZoomController.Update(renderDt, rotatedFocus, extrapolation)
return rotatedFocus*CFrame.new(0, 0, zoom), desiredCameraFocus
Expand Down
4 changes: 2 additions & 2 deletions src/VersionInfo.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "0.651.0.6510833",
"guid": "version-e0a840597ded474b"
"version": "0.654.1.6540477",
"guid": "version-b8e18f8286604778"
}
2 changes: 1 addition & 1 deletion wally.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "upliftgames/playermodule"
version = "651.0.6510833"
version = "654.1.6540477"
registry = "https://github.com/UpliftGames/wally-index"
realm = "shared"

Expand Down

0 comments on commit 63687be

Please sign in to comment.