@quenty/camera 14.21.0-canary.ae8d76d.0 → 14.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -2
- package/package.json +17 -17
- package/src/Client/CameraStack.lua +2 -2
- package/src/Client/CameraStackService.lua +2 -2
- package/src/Client/CameraState.lua +2 -2
- package/src/Client/CameraUtils.lua +1 -1
- package/src/Client/CameraUtils.story.lua +5 -4
- package/src/Client/Controls/CameraControls.lua +1 -1
- package/src/Client/Controls/GamepadRotateModel.lua +1 -1
- package/src/Client/Effects/CameraEffectUtils.lua +1 -1
- package/src/Client/Effects/CustomCameraEffect.lua +1 -1
- package/src/Client/Effects/DefaultCamera.lua +2 -2
- package/src/Client/Effects/FadeBetween/FadeBetweenCamera.lua +7 -7
- package/src/Client/Effects/FadeBetween/FadeBetweenCamera2.lua +11 -11
- package/src/Client/Effects/FadeBetween/FadeBetweenCamera3.lua +8 -8
- package/src/Client/Effects/FadeBetween/FadeBetweenCamera4.lua +17 -9
- package/src/Client/Effects/FadingCamera.lua +3 -3
- package/src/Client/Effects/HeartbeatCamera.lua +4 -4
- package/src/Client/Effects/ImpulseCamera.lua +2 -2
- package/src/Client/Effects/ImpulseCamera.story.lua +6 -6
- package/src/Client/Effects/InverseFader.lua +3 -3
- package/src/Client/Effects/LagPointCamera.lua +3 -3
- package/src/Client/Effects/OverrideDefaultCameraToo.lua +14 -5
- package/src/Client/Effects/PointCamera.lua +2 -2
- package/src/Client/Effects/PushCamera.lua +2 -2
- package/src/Client/Effects/RotatedCamera.lua +3 -3
- package/src/Client/Effects/SmoothPositionCamera.lua +5 -5
- package/src/Client/Effects/SmoothRotatedCamera.lua +1 -1
- package/src/Client/Effects/SmoothZoomedCamera.lua +3 -3
- package/src/Client/Effects/SummedCamera.lua +12 -9
- package/src/Client/Effects/TrackCamera.lua +1 -1
- package/src/Client/Effects/XZPlaneLockCamera.lua +6 -3
- package/src/Client/Effects/ZoomedCamera.lua +2 -2
- package/src/Client/Input/CameraInputUtils.lua +2 -2
- package/src/Client/Input/CameraTouchInputUtils.lua +15 -15
- package/src/Client/Utility/CameraFrame.lua +2 -2
- package/src/Client/Utility/CameraFrame.story.lua +21 -12
- package/src/Client/Utility/CameraStateTweener.lua +4 -4
- package/src/Client/Utility/FieldOfViewUtils.lua +1 -1
- package/test/scripts/Client/ClientMain.client.lua +1 -1
- package/test/scripts/Server/ServerMain.server.lua +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
# [14.21.0
|
|
6
|
+
# [14.21.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/camera@14.20.3...@quenty/camera@14.21.0) (2025-05-10)
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### Bug Fixes
|
|
@@ -13,7 +13,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
13
13
|
|
|
14
14
|
### Features
|
|
15
15
|
|
|
16
|
-
* Add even more types ([
|
|
16
|
+
* Add even more types ([b31717d](https://github.com/Quenty/NevermoreEngine/commit/b31717d8c9f7620c457f5018a2affa760a65334a))
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/camera",
|
|
3
|
-
"version": "14.21.0
|
|
3
|
+
"version": "14.21.0",
|
|
4
4
|
"description": "Quenty's camera system for Roblox",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -25,26 +25,26 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/acceltween": "2.5.3",
|
|
29
|
-
"@quenty/baseobject": "10.
|
|
30
|
-
"@quenty/cframeutils": "5.5.3",
|
|
31
|
-
"@quenty/cubicspline": "10.9.0
|
|
32
|
-
"@quenty/ducktype": "5.
|
|
33
|
-
"@quenty/inputobjectutils": "4.19.0
|
|
34
|
-
"@quenty/loader": "10.
|
|
35
|
-
"@quenty/maid": "3.
|
|
36
|
-
"@quenty/math": "2.7.3",
|
|
37
|
-
"@quenty/qframe": "10.11.0
|
|
38
|
-
"@quenty/servicebag": "11.12.0
|
|
39
|
-
"@quenty/spring": "10.9.0
|
|
40
|
-
"@quenty/valueobject": "13.18.0
|
|
41
|
-
"@quenty/vector3utils": "10.
|
|
28
|
+
"@quenty/acceltween": "^2.5.3",
|
|
29
|
+
"@quenty/baseobject": "^10.9.0",
|
|
30
|
+
"@quenty/cframeutils": "^5.5.3",
|
|
31
|
+
"@quenty/cubicspline": "^10.9.0",
|
|
32
|
+
"@quenty/ducktype": "^5.9.0",
|
|
33
|
+
"@quenty/inputobjectutils": "^4.19.0",
|
|
34
|
+
"@quenty/loader": "^10.9.0",
|
|
35
|
+
"@quenty/maid": "^3.5.0",
|
|
36
|
+
"@quenty/math": "^2.7.3",
|
|
37
|
+
"@quenty/qframe": "^10.11.0",
|
|
38
|
+
"@quenty/servicebag": "^11.12.0",
|
|
39
|
+
"@quenty/spring": "^10.9.0",
|
|
40
|
+
"@quenty/valueobject": "^13.18.0",
|
|
41
|
+
"@quenty/vector3utils": "^10.9.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@quenty/camerastoryutils": "10.11.0
|
|
44
|
+
"@quenty/camerastoryutils": "^10.11.0"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "20cff952c2cf06b959f2f11d2293bdef38acc604"
|
|
50
50
|
}
|
|
@@ -9,9 +9,9 @@ local HttpService = game:GetService("HttpService")
|
|
|
9
9
|
|
|
10
10
|
local BaseObject = require("BaseObject")
|
|
11
11
|
local CameraEffectUtils = require("CameraEffectUtils")
|
|
12
|
+
local CameraState = require("CameraState")
|
|
12
13
|
local CustomCameraEffect = require("CustomCameraEffect")
|
|
13
14
|
local DuckTypeUtils = require("DuckTypeUtils")
|
|
14
|
-
local CameraState = require("CameraState")
|
|
15
15
|
|
|
16
16
|
local CameraStack = setmetatable({}, BaseObject)
|
|
17
17
|
CameraStack.ClassName = "CameraStack"
|
|
@@ -214,4 +214,4 @@ function CameraStack.Add(self: CameraStack, state: CameraEffectUtils.CameraLike)
|
|
|
214
214
|
end
|
|
215
215
|
end
|
|
216
216
|
|
|
217
|
-
return CameraStack
|
|
217
|
+
return CameraStack
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
local require = require(script.Parent.loader).load(script)
|
|
9
9
|
|
|
10
|
+
local HttpService = game:GetService("HttpService")
|
|
10
11
|
local RunService = game:GetService("RunService")
|
|
11
12
|
local Workspace = game:GetService("Workspace")
|
|
12
|
-
local HttpService = game:GetService("HttpService")
|
|
13
13
|
|
|
14
14
|
local CameraEffectUtils = require("CameraEffectUtils")
|
|
15
15
|
local CameraStack = require("CameraStack")
|
|
@@ -270,4 +270,4 @@ function CameraStackService.Destroy(self: CameraStackService)
|
|
|
270
270
|
self._maid:DoCleaning()
|
|
271
271
|
end
|
|
272
272
|
|
|
273
|
-
return CameraStackService
|
|
273
|
+
return CameraStackService
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
local require = require(script.Parent.loader).load(script)
|
|
8
8
|
|
|
9
|
-
local QFrame = require("QFrame")
|
|
10
9
|
local CameraFrame = require("CameraFrame")
|
|
11
10
|
local DuckTypeUtils = require("DuckTypeUtils")
|
|
11
|
+
local QFrame = require("QFrame")
|
|
12
12
|
|
|
13
13
|
local CameraState = {}
|
|
14
14
|
CameraState.ClassName = "CameraState"
|
|
@@ -112,4 +112,4 @@ function CameraState.Set(self: CameraState, camera: Camera)
|
|
|
112
112
|
camera.CFrame = self.CFrame
|
|
113
113
|
end
|
|
114
114
|
|
|
115
|
-
return CameraState
|
|
115
|
+
return CameraState
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
@class CameraUtils.story
|
|
3
3
|
]]
|
|
4
4
|
|
|
5
|
-
local require =
|
|
5
|
+
local require =
|
|
6
|
+
require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).bootstrapStory(script)
|
|
6
7
|
|
|
7
8
|
local Maid = require("Maid")
|
|
8
9
|
|
|
@@ -25,7 +26,7 @@ return function(target: Instance)
|
|
|
25
26
|
|
|
26
27
|
local ball: Part = maid:Add(Instance.new("Part"))
|
|
27
28
|
ball.Color = Color3.new(1, 0.5, 0.5)
|
|
28
|
-
ball.Size = Vector3.new(2*radius, 2*radius, 2*radius)
|
|
29
|
+
ball.Size = Vector3.new(2 * radius, 2 * radius, 2 * radius)
|
|
29
30
|
ball.Shape = Enum.PartType.Ball
|
|
30
31
|
ball.CFrame = CFrame.new()
|
|
31
32
|
ball.Anchored = true
|
|
@@ -34,7 +35,7 @@ return function(target: Instance)
|
|
|
34
35
|
local function update()
|
|
35
36
|
local absSize = viewportFrame.AbsoluteSize
|
|
36
37
|
if absSize.x > 0 and absSize.y > 0 then
|
|
37
|
-
local aspectRatio = absSize.x/absSize.y
|
|
38
|
+
local aspectRatio = absSize.x / absSize.y
|
|
38
39
|
local dist = CameraUtils.fitSphereToCamera(radius, camera.FieldOfView, aspectRatio)
|
|
39
40
|
camera.CFrame = CFrame.new(0, 0, dist)
|
|
40
41
|
end
|
|
@@ -48,4 +49,4 @@ return function(target: Instance)
|
|
|
48
49
|
return function()
|
|
49
50
|
maid:DoCleaning()
|
|
50
51
|
end
|
|
51
|
-
end
|
|
52
|
+
end
|
|
@@ -13,9 +13,9 @@ local UserInputService = game:GetService("UserInputService")
|
|
|
13
13
|
local GamepadRotateModel = require("GamepadRotateModel")
|
|
14
14
|
local InputObjectUtils = require("InputObjectUtils")
|
|
15
15
|
local Maid = require("Maid")
|
|
16
|
+
local PushCamera = require("PushCamera")
|
|
16
17
|
local SmoothRotatedCamera = require("SmoothRotatedCamera")
|
|
17
18
|
local SmoothZoomedCamera = require("SmoothZoomedCamera")
|
|
18
|
-
local PushCamera = require("PushCamera")
|
|
19
19
|
|
|
20
20
|
-- Stolen directly from ROBLOX's core scripts.
|
|
21
21
|
-- Looks like a simple integrator.
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
|
|
10
10
|
local require = require(script.Parent.loader).load(script)
|
|
11
11
|
|
|
12
|
+
local HttpService = game:GetService("HttpService")
|
|
12
13
|
local RunService = game:GetService("RunService")
|
|
13
14
|
local Workspace = game:GetService("Workspace")
|
|
14
|
-
local HttpService = game:GetService("HttpService")
|
|
15
15
|
|
|
16
16
|
local CFrameUtils = require("CFrameUtils")
|
|
17
17
|
local CameraEffectUtils = require("CameraEffectUtils")
|
|
@@ -227,4 +227,4 @@ function DefaultCamera.__index(self: DefaultCamera, index)
|
|
|
227
227
|
end
|
|
228
228
|
end
|
|
229
229
|
|
|
230
|
-
return DefaultCamera
|
|
230
|
+
return DefaultCamera
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
local require = require(script.Parent.loader).load(script)
|
|
7
7
|
|
|
8
|
-
local Spring = require("Spring")
|
|
9
|
-
local SummedCamera = require("SummedCamera")
|
|
10
|
-
local SpringUtils = require("SpringUtils")
|
|
11
8
|
local CameraState = require("CameraState")
|
|
12
9
|
local CubicSplineUtils = require("CubicSplineUtils")
|
|
10
|
+
local Spring = require("Spring")
|
|
11
|
+
local SpringUtils = require("SpringUtils")
|
|
12
|
+
local SummedCamera = require("SummedCamera")
|
|
13
13
|
|
|
14
14
|
local FadeBetweenCamera = {}
|
|
15
15
|
FadeBetweenCamera.ClassName = "FadeBetweenCamera"
|
|
@@ -21,9 +21,9 @@ FadeBetweenCamera.ClassName = "FadeBetweenCamera"
|
|
|
21
21
|
]=]
|
|
22
22
|
function FadeBetweenCamera.new(cameraA, cameraB)
|
|
23
23
|
local self = setmetatable({
|
|
24
|
-
_spring = Spring.new(0)
|
|
25
|
-
CameraA = cameraA or error("No cameraA")
|
|
26
|
-
CameraB = cameraB or error("No cameraB")
|
|
24
|
+
_spring = Spring.new(0),
|
|
25
|
+
CameraA = cameraA or error("No cameraA"),
|
|
26
|
+
CameraB = cameraB or error("No cameraB"),
|
|
27
27
|
}, FadeBetweenCamera)
|
|
28
28
|
|
|
29
29
|
self.Damper = 1
|
|
@@ -127,4 +127,4 @@ function FadeBetweenCamera:__index(index)
|
|
|
127
127
|
end
|
|
128
128
|
end
|
|
129
129
|
|
|
130
|
-
return FadeBetweenCamera
|
|
130
|
+
return FadeBetweenCamera
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
local require = require(script.Parent.loader).load(script)
|
|
6
6
|
|
|
7
|
-
local CubicSplineUtils = require("CubicSplineUtils")
|
|
8
7
|
local CameraState = require("CameraState")
|
|
8
|
+
local CubicSplineUtils = require("CubicSplineUtils")
|
|
9
9
|
|
|
10
10
|
local FadeBetweenCamera2 = {}
|
|
11
11
|
FadeBetweenCamera2.ClassName = "FadeBetweenCamera2"
|
|
@@ -18,13 +18,13 @@ FadeBetweenCamera2.__index = FadeBetweenCamera2
|
|
|
18
18
|
]=]
|
|
19
19
|
function FadeBetweenCamera2.new(cameraA, cameraB)
|
|
20
20
|
local self = setmetatable({
|
|
21
|
-
CameraA = cameraA or error("No cameraA")
|
|
22
|
-
CameraB = cameraB or error("No cameraB")
|
|
23
|
-
_state0 = cameraA.CameraState
|
|
24
|
-
_time0 = os.clock()
|
|
25
|
-
_target = 0
|
|
26
|
-
_position0 = 0
|
|
27
|
-
_speed = 15
|
|
21
|
+
CameraA = cameraA or error("No cameraA"),
|
|
22
|
+
CameraB = cameraB or error("No cameraB"),
|
|
23
|
+
_state0 = cameraA.CameraState,
|
|
24
|
+
_time0 = os.clock(),
|
|
25
|
+
_target = 0,
|
|
26
|
+
_position0 = 0,
|
|
27
|
+
_speed = 15,
|
|
28
28
|
}, FadeBetweenCamera2)
|
|
29
29
|
|
|
30
30
|
return self
|
|
@@ -138,9 +138,9 @@ function FadeBetweenCamera2:_computeDoneProportion(now)
|
|
|
138
138
|
return 1
|
|
139
139
|
end
|
|
140
140
|
|
|
141
|
-
local SPEED_CONSTANT = 0.5/15 -- 0.5 seconds is 15 speed in the other system
|
|
141
|
+
local SPEED_CONSTANT = 0.5 / 15 -- 0.5 seconds is 15 speed in the other system
|
|
142
142
|
|
|
143
|
-
return math.clamp(self._speed*(now - self._time0)*SPEED_CONSTANT/dist_to_travel, 0, 1)
|
|
143
|
+
return math.clamp(self._speed * (now - self._time0) * SPEED_CONSTANT / dist_to_travel, 0, 1)
|
|
144
144
|
end
|
|
145
145
|
|
|
146
|
-
return FadeBetweenCamera2
|
|
146
|
+
return FadeBetweenCamera2
|
|
@@ -6,15 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
local require = require(script.Parent.loader).load(script)
|
|
8
8
|
|
|
9
|
-
local
|
|
10
|
-
local SummedCamera = require("SummedCamera")
|
|
11
|
-
local SpringUtils = require("SpringUtils")
|
|
12
|
-
local QFrame = require("QFrame")
|
|
13
|
-
local FieldOfViewUtils = require("FieldOfViewUtils")
|
|
14
|
-
local CameraState = require("CameraState")
|
|
9
|
+
local CameraEffectUtils = require("CameraEffectUtils")
|
|
15
10
|
local CameraFrame = require("CameraFrame")
|
|
11
|
+
local CameraState = require("CameraState")
|
|
16
12
|
local CubicSplineUtils = require("CubicSplineUtils")
|
|
17
|
-
local
|
|
13
|
+
local FieldOfViewUtils = require("FieldOfViewUtils")
|
|
14
|
+
local QFrame = require("QFrame")
|
|
15
|
+
local Spring = require("Spring")
|
|
16
|
+
local SpringUtils = require("SpringUtils")
|
|
17
|
+
local SummedCamera = require("SummedCamera")
|
|
18
18
|
|
|
19
19
|
local FadeBetweenCamera3 = {}
|
|
20
20
|
FadeBetweenCamera3.ClassName = "FadeBetweenCamera3"
|
|
@@ -171,4 +171,4 @@ function FadeBetweenCamera3:__index(index)
|
|
|
171
171
|
end
|
|
172
172
|
end
|
|
173
173
|
|
|
174
|
-
return FadeBetweenCamera3
|
|
174
|
+
return FadeBetweenCamera3
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
local require = require(script.Parent.loader).load(script)
|
|
6
6
|
|
|
7
|
-
local CubicSplineUtils = require("CubicSplineUtils")
|
|
8
7
|
local CameraState = require("CameraState")
|
|
8
|
+
local CubicSplineUtils = require("CubicSplineUtils")
|
|
9
9
|
local Spring = require("Spring")
|
|
10
10
|
local SpringUtils = require("SpringUtils")
|
|
11
11
|
|
|
@@ -20,11 +20,11 @@ FadeBetweenCamera4.__index = FadeBetweenCamera4
|
|
|
20
20
|
]=]
|
|
21
21
|
function FadeBetweenCamera4.new(cameraA, cameraB)
|
|
22
22
|
local self = setmetatable({
|
|
23
|
-
CameraA = cameraA or error("No cameraA")
|
|
24
|
-
CameraB = cameraB or error("No cameraB")
|
|
25
|
-
_spring = Spring.new()
|
|
26
|
-
_position0 = 0
|
|
27
|
-
_state0 = cameraA.CameraState
|
|
23
|
+
CameraA = cameraA or error("No cameraA"),
|
|
24
|
+
CameraB = cameraB or error("No cameraB"),
|
|
25
|
+
_spring = Spring.new(),
|
|
26
|
+
_position0 = 0,
|
|
27
|
+
_state0 = cameraA.CameraState,
|
|
28
28
|
}, FadeBetweenCamera4)
|
|
29
29
|
|
|
30
30
|
self._spring.s = 15
|
|
@@ -122,11 +122,19 @@ function FadeBetweenCamera4:_computeCameraState(position)
|
|
|
122
122
|
local a = self:_computeTargetState(0)
|
|
123
123
|
|
|
124
124
|
node0 = CubicSplineUtils.newSplineNode(0, a.CameraFrame, a.CameraFrameDerivative)
|
|
125
|
-
node1 = CubicSplineUtils.newSplineNode(
|
|
125
|
+
node1 = CubicSplineUtils.newSplineNode(
|
|
126
|
+
self._position0,
|
|
127
|
+
self._state0.CameraFrame,
|
|
128
|
+
self._state0.CameraFrameDerivative
|
|
129
|
+
)
|
|
126
130
|
else
|
|
127
131
|
local b = self:_computeTargetState(1)
|
|
128
132
|
|
|
129
|
-
node0 = CubicSplineUtils.newSplineNode(
|
|
133
|
+
node0 = CubicSplineUtils.newSplineNode(
|
|
134
|
+
self._position0,
|
|
135
|
+
self._state0.CameraFrame,
|
|
136
|
+
self._state0.CameraFrameDerivative
|
|
137
|
+
)
|
|
130
138
|
node1 = CubicSplineUtils.newSplineNode(1, b.CameraFrame, b.CameraFrameDerivative)
|
|
131
139
|
end
|
|
132
140
|
|
|
@@ -136,4 +144,4 @@ function FadeBetweenCamera4:_computeCameraState(position)
|
|
|
136
144
|
return newState, position
|
|
137
145
|
end
|
|
138
146
|
|
|
139
|
-
return FadeBetweenCamera4
|
|
147
|
+
return FadeBetweenCamera4
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
local require = require(script.Parent.loader).load(script)
|
|
8
8
|
|
|
9
|
+
local CameraEffectUtils = require("CameraEffectUtils")
|
|
10
|
+
local CameraState = require("CameraState")
|
|
9
11
|
local Spring = require("Spring")
|
|
10
12
|
local SummedCamera = require("SummedCamera")
|
|
11
|
-
local CameraState = require("CameraState")
|
|
12
|
-
local CameraEffectUtils = require("CameraEffectUtils")
|
|
13
13
|
|
|
14
14
|
local FadingCamera = {}
|
|
15
15
|
FadingCamera.ClassName = "FadingCamera"
|
|
@@ -88,4 +88,4 @@ function FadingCamera:__index(index)
|
|
|
88
88
|
end
|
|
89
89
|
end
|
|
90
90
|
|
|
91
|
-
return FadingCamera
|
|
91
|
+
return FadingCamera
|
|
@@ -11,10 +11,10 @@ local require = require(script.Parent.loader).load(script)
|
|
|
11
11
|
|
|
12
12
|
local RunService = game:GetService("RunService")
|
|
13
13
|
|
|
14
|
-
local SummedCamera = require("SummedCamera")
|
|
15
|
-
local Maid = require("Maid")
|
|
16
|
-
local CameraState = require("CameraState")
|
|
17
14
|
local CameraEffectUtils = require("CameraEffectUtils")
|
|
15
|
+
local CameraState = require("CameraState")
|
|
16
|
+
local Maid = require("Maid")
|
|
17
|
+
local SummedCamera = require("SummedCamera")
|
|
18
18
|
|
|
19
19
|
local HeartbeatCamera = {}
|
|
20
20
|
HeartbeatCamera.ClassName = "HeartbeatCamera"
|
|
@@ -72,4 +72,4 @@ function HeartbeatCamera.Destroy(self: HeartbeatCamera)
|
|
|
72
72
|
self._maid:DoCleaning()
|
|
73
73
|
end
|
|
74
74
|
|
|
75
|
-
return HeartbeatCamera
|
|
75
|
+
return HeartbeatCamera
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
|
|
9
9
|
local require = require(script.Parent.loader).load(script)
|
|
10
10
|
|
|
11
|
+
local CameraEffectUtils = require("CameraEffectUtils")
|
|
11
12
|
local CameraState = require("CameraState")
|
|
12
13
|
local Spring = require("Spring")
|
|
13
14
|
local SpringUtils = require("SpringUtils")
|
|
14
15
|
local SummedCamera = require("SummedCamera")
|
|
15
|
-
local CameraEffectUtils = require("CameraEffectUtils")
|
|
16
16
|
|
|
17
17
|
local EPSILON = 1e-6
|
|
18
18
|
|
|
@@ -167,4 +167,4 @@ function ImpulseCamera.__index(self: ImpulseCamera, index)
|
|
|
167
167
|
end
|
|
168
168
|
end
|
|
169
169
|
|
|
170
|
-
return ImpulseCamera
|
|
170
|
+
return ImpulseCamera
|
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
@class ImpulseCamera.story
|
|
3
3
|
]]
|
|
4
4
|
|
|
5
|
-
local require =
|
|
5
|
+
local require =
|
|
6
|
+
require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).bootstrapStory(script)
|
|
6
7
|
|
|
7
8
|
local RunService = game:GetService("RunService")
|
|
8
9
|
local Workspace = game:GetService("Workspace")
|
|
9
10
|
|
|
10
|
-
local Maid = require("Maid")
|
|
11
11
|
local CameraStack = require("CameraStack")
|
|
12
|
-
local ImpulseCamera = require("ImpulseCamera")
|
|
13
12
|
local DefaultCamera = require("DefaultCamera")
|
|
13
|
+
local ImpulseCamera = require("ImpulseCamera")
|
|
14
|
+
local Maid = require("Maid")
|
|
14
15
|
|
|
15
16
|
return function(target)
|
|
16
17
|
local maid = Maid.new()
|
|
@@ -67,9 +68,8 @@ return function(target)
|
|
|
67
68
|
maid:GiveTask(button.Activated:Connect(impulse))
|
|
68
69
|
end
|
|
69
70
|
|
|
70
|
-
|
|
71
71
|
makeShaker("Shake", function()
|
|
72
|
-
impulseCamera:Impulse(Vector3.new(0, math.random() - 0.5, math.random() - 0.5)*50, 50, 0.2)
|
|
72
|
+
impulseCamera:Impulse(Vector3.new(0, math.random() - 0.5, math.random() - 0.5) * 50, 50, 0.2)
|
|
73
73
|
end)
|
|
74
74
|
makeShaker("SHAKE", function()
|
|
75
75
|
impulseCamera:ImpulseRandom(Vector3.new(0, 3, 0), 75, 0.1)
|
|
@@ -78,4 +78,4 @@ return function(target)
|
|
|
78
78
|
return function()
|
|
79
79
|
maid:DoCleaning()
|
|
80
80
|
end
|
|
81
|
-
end
|
|
81
|
+
end
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
local require = require(script.Parent.loader).load(script)
|
|
8
8
|
|
|
9
|
-
local SummedCamera = require("SummedCamera")
|
|
10
|
-
local CameraState = require("CameraState")
|
|
11
9
|
local CameraEffectUtils = require("CameraEffectUtils")
|
|
10
|
+
local CameraState = require("CameraState")
|
|
12
11
|
local FadingCamera = require("FadingCamera")
|
|
12
|
+
local SummedCamera = require("SummedCamera")
|
|
13
13
|
|
|
14
14
|
local InverseFader = {}
|
|
15
15
|
InverseFader.ClassName = "InverseFader"
|
|
@@ -47,4 +47,4 @@ function InverseFader.__index(self: InverseFader, index)
|
|
|
47
47
|
end
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
-
return InverseFader
|
|
50
|
+
return InverseFader
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
local require = require(script.Parent.loader).load(script)
|
|
8
8
|
|
|
9
|
+
local CameraEffectUtils = require("CameraEffectUtils")
|
|
9
10
|
local CameraState = require("CameraState")
|
|
10
|
-
local SummedCamera = require("SummedCamera")
|
|
11
11
|
local Spring = require("Spring")
|
|
12
|
-
local
|
|
12
|
+
local SummedCamera = require("SummedCamera")
|
|
13
13
|
|
|
14
14
|
local LagPointCamera = {}
|
|
15
15
|
LagPointCamera.ClassName = "LagPointCamera"
|
|
@@ -106,4 +106,4 @@ function LagPointCamera.__index(self: LagPointCamera, index): any
|
|
|
106
106
|
end
|
|
107
107
|
end
|
|
108
108
|
|
|
109
|
-
return LagPointCamera
|
|
109
|
+
return LagPointCamera
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
|
|
17
17
|
local require = require(script.Parent.loader).load(script)
|
|
18
18
|
|
|
19
|
-
local SummedCamera = require("SummedCamera")
|
|
20
|
-
local Vector3Utils = require("Vector3Utils")
|
|
21
19
|
local CameraEffectUtils = require("CameraEffectUtils")
|
|
22
20
|
local CameraState = require("CameraState")
|
|
21
|
+
local SummedCamera = require("SummedCamera")
|
|
22
|
+
local Vector3Utils = require("Vector3Utils")
|
|
23
23
|
|
|
24
24
|
local OverrideDefaultCameraToo = {}
|
|
25
25
|
OverrideDefaultCameraToo.ClassName = "OverrideDefaultCameraToo"
|
|
@@ -41,7 +41,11 @@ export type OverrideDefaultCameraToo = typeof(setmetatable(
|
|
|
41
41
|
@param defaultCamera DefaultCamera
|
|
42
42
|
@param predicate Filter on whether to override or not
|
|
43
43
|
]=]
|
|
44
|
-
function OverrideDefaultCameraToo.new(
|
|
44
|
+
function OverrideDefaultCameraToo.new(
|
|
45
|
+
baseCamera: CameraEffectUtils.CameraEffect,
|
|
46
|
+
defaultCamera: CameraEffectUtils.CameraEffect,
|
|
47
|
+
predicate
|
|
48
|
+
): OverrideDefaultCameraToo
|
|
45
49
|
local self: OverrideDefaultCameraToo = setmetatable({} :: any, OverrideDefaultCameraToo)
|
|
46
50
|
|
|
47
51
|
self.BaseCamera = assert(baseCamera, "No baseCamera")
|
|
@@ -73,7 +77,12 @@ function OverrideDefaultCameraToo:__index(index)
|
|
|
73
77
|
warn("[OverrideDefaultCameraToo] - No predicate set")
|
|
74
78
|
end
|
|
75
79
|
|
|
76
|
-
local angle = math.abs(
|
|
80
|
+
local angle = math.abs(
|
|
81
|
+
Vector3Utils.angleBetweenVectors(
|
|
82
|
+
result.CFrame:VectorToWorldSpace(Vector3.new(0, 0, -1)),
|
|
83
|
+
Vector3.new(0, 1, 0)
|
|
84
|
+
)
|
|
85
|
+
)
|
|
77
86
|
|
|
78
87
|
-- If the camera is straight up and down then Roblox breaks
|
|
79
88
|
if angle >= math.rad(0.1) and angle <= math.rad(179.9) then
|
|
@@ -89,4 +98,4 @@ function OverrideDefaultCameraToo:__index(index)
|
|
|
89
98
|
end
|
|
90
99
|
end
|
|
91
100
|
|
|
92
|
-
return OverrideDefaultCameraToo
|
|
101
|
+
return OverrideDefaultCameraToo
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
local require = require(script.Parent.loader).load(script)
|
|
8
8
|
|
|
9
|
+
local CameraEffectUtils = require("CameraEffectUtils")
|
|
9
10
|
local CameraState = require("CameraState")
|
|
10
11
|
local SummedCamera = require("SummedCamera")
|
|
11
|
-
local CameraEffectUtils = require("CameraEffectUtils")
|
|
12
12
|
|
|
13
13
|
local PointCamera = {}
|
|
14
14
|
PointCamera.ClassName = "PointCamera"
|
|
@@ -72,4 +72,4 @@ function PointCamera.__index(self: PointCamera, index)
|
|
|
72
72
|
end
|
|
73
73
|
end
|
|
74
74
|
|
|
75
|
-
return PointCamera
|
|
75
|
+
return PointCamera
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
|
|
9
9
|
local require = require(script.Parent.loader).load(script)
|
|
10
10
|
|
|
11
|
+
local CameraEffectUtils = require("CameraEffectUtils")
|
|
11
12
|
local CameraState = require("CameraState")
|
|
12
|
-
local getRotationInXZPlane = require("getRotationInXZPlane")
|
|
13
13
|
local Math = require("Math")
|
|
14
14
|
local SummedCamera = require("SummedCamera")
|
|
15
|
-
local
|
|
15
|
+
local getRotationInXZPlane = require("getRotationInXZPlane")
|
|
16
16
|
|
|
17
17
|
local PushCamera = {}
|
|
18
18
|
PushCamera.ClassName = "PushCamera"
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
|
|
10
10
|
local require = require(script.Parent.loader).load(script)
|
|
11
11
|
|
|
12
|
+
local CameraEffectUtils = require("CameraEffectUtils")
|
|
12
13
|
local CameraState = require("CameraState")
|
|
13
|
-
local getRotationInXZPlane = require("getRotationInXZPlane")
|
|
14
14
|
local SummedCamera = require("SummedCamera")
|
|
15
|
-
local
|
|
15
|
+
local getRotationInXZPlane = require("getRotationInXZPlane")
|
|
16
16
|
|
|
17
17
|
local RotatedCamera = {}
|
|
18
18
|
RotatedCamera.ClassName = "RotatedCamera"
|
|
@@ -111,4 +111,4 @@ function RotatedCamera:__index(index)
|
|
|
111
111
|
end
|
|
112
112
|
end
|
|
113
113
|
|
|
114
|
-
return RotatedCamera
|
|
114
|
+
return RotatedCamera
|
|
@@ -62,12 +62,12 @@ function SmoothPositionCamera:__index(index)
|
|
|
62
62
|
local baseCameraFrame = baseCameraState.CameraFrame
|
|
63
63
|
local baseCameraFrameDerivative = baseCameraState.CameraFrameDerivative
|
|
64
64
|
|
|
65
|
-
local cameraFrame =
|
|
66
|
-
QFrame.fromVector3(self.Position, baseCameraFrame.QFrame),
|
|
67
|
-
baseCameraFrame.FieldOfView)
|
|
65
|
+
local cameraFrame =
|
|
66
|
+
CameraFrame.new(QFrame.fromVector3(self.Position, baseCameraFrame.QFrame), baseCameraFrame.FieldOfView)
|
|
68
67
|
local cameraFrameDerivative = CameraFrame.new(
|
|
69
68
|
QFrame.fromVector3(self.Velocity, baseCameraFrameDerivative.QFrame),
|
|
70
|
-
baseCameraFrameDerivative.FieldOfView
|
|
69
|
+
baseCameraFrameDerivative.FieldOfView
|
|
70
|
+
)
|
|
71
71
|
|
|
72
72
|
return CameraState.new(cameraFrame, cameraFrameDerivative)
|
|
73
73
|
elseif index == "Position" then
|
|
@@ -98,4 +98,4 @@ function SmoothPositionCamera:_internalUpdate()
|
|
|
98
98
|
end
|
|
99
99
|
end
|
|
100
100
|
|
|
101
|
-
return SmoothPositionCamera
|
|
101
|
+
return SmoothPositionCamera
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
|
|
10
10
|
local require = require(script.Parent.loader).load(script)
|
|
11
11
|
|
|
12
|
+
local CameraEffectUtils = require("CameraEffectUtils")
|
|
12
13
|
local CameraState = require("CameraState")
|
|
13
|
-
local SummedCamera = require("SummedCamera")
|
|
14
14
|
local Spring = require("Spring")
|
|
15
|
-
local
|
|
15
|
+
local SummedCamera = require("SummedCamera")
|
|
16
16
|
|
|
17
17
|
local SmoothZoomedCamera = {}
|
|
18
18
|
SmoothZoomedCamera.ClassName = "SmoothZoomedCamera"
|
|
@@ -129,4 +129,4 @@ function SmoothZoomedCamera.__index(self: SmoothZoomedCamera, index)
|
|
|
129
129
|
end
|
|
130
130
|
end
|
|
131
131
|
|
|
132
|
-
return SmoothZoomedCamera
|
|
132
|
+
return SmoothZoomedCamera
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
local require = require(script.Parent.loader).load(script)
|
|
8
8
|
|
|
9
|
-
local QFrame = require("QFrame")
|
|
10
|
-
local CameraState = require("CameraState")
|
|
11
|
-
local CameraFrame = require("CameraFrame")
|
|
12
9
|
local CameraEffectUtils = require("CameraEffectUtils")
|
|
10
|
+
local CameraFrame = require("CameraFrame")
|
|
11
|
+
local CameraState = require("CameraState")
|
|
12
|
+
local QFrame = require("QFrame")
|
|
13
13
|
|
|
14
14
|
local SummedCamera = {}
|
|
15
15
|
SummedCamera.ClassName = "SummedCamera"
|
|
@@ -90,15 +90,18 @@ function SummedCamera.__index(self: SummedCamera, index)
|
|
|
90
90
|
local a = self.CameraAState
|
|
91
91
|
local b = self.CameraBState
|
|
92
92
|
|
|
93
|
-
local newQFrame = QFrame.fromCFrameClosestTo(a.CFrame*b.CFrame, a.CameraFrame.QFrame)
|
|
93
|
+
local newQFrame = QFrame.fromCFrameClosestTo(a.CFrame * b.CFrame, a.CameraFrame.QFrame)
|
|
94
94
|
local cameraFrame = CameraFrame.new(newQFrame, a.FieldOfView + b.FieldOfView)
|
|
95
95
|
|
|
96
96
|
-- TODO: compute derivative velocity more correctly of this non-linear thing
|
|
97
97
|
local newQFrameVelocity = QFrame.fromCFrameClosestTo(
|
|
98
|
-
a.CameraFrameDerivative.CFrame*b.CameraFrameDerivative.CFrame,
|
|
99
|
-
a.CameraFrameDerivative.QFrame
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
a.CameraFrameDerivative.CFrame * b.CameraFrameDerivative.CFrame,
|
|
99
|
+
a.CameraFrameDerivative.QFrame
|
|
100
|
+
)
|
|
101
|
+
local cameraFrameVelocity = CameraFrame.new(
|
|
102
|
+
newQFrameVelocity,
|
|
103
|
+
a.CameraFrameDerivative.FieldOfView + b.CameraFrameDerivative.FieldOfView
|
|
104
|
+
)
|
|
102
105
|
|
|
103
106
|
local result = CameraState.new(cameraFrame, cameraFrameVelocity)
|
|
104
107
|
-- result.CFrame =
|
|
@@ -116,4 +119,4 @@ function SummedCamera.__index(self: SummedCamera, index)
|
|
|
116
119
|
end
|
|
117
120
|
end
|
|
118
121
|
|
|
119
|
-
return SummedCamera
|
|
122
|
+
return SummedCamera
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
local require = require(script.Parent.loader).load(script)
|
|
8
8
|
|
|
9
|
+
local CameraEffectUtils = require("CameraEffectUtils")
|
|
9
10
|
local CameraState = require("CameraState")
|
|
10
11
|
local SummedCamera = require("SummedCamera")
|
|
11
12
|
local getRotationInXZPlane = require("getRotationInXZPlane")
|
|
12
|
-
local CameraEffectUtils = require("CameraEffectUtils")
|
|
13
13
|
|
|
14
14
|
local XZPlaneLockCamera = {}
|
|
15
15
|
XZPlaneLockCamera.ClassName = "XZPlaneLockCamera"
|
|
@@ -30,7 +30,10 @@ function XZPlaneLockCamera.new(camera: CameraEffectUtils.CameraLike): XZPlaneLoc
|
|
|
30
30
|
return self
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
function XZPlaneLockCamera.__add(
|
|
33
|
+
function XZPlaneLockCamera.__add(
|
|
34
|
+
self: XZPlaneLockCamera,
|
|
35
|
+
other: CameraEffectUtils.CameraEffect
|
|
36
|
+
): SummedCamera.SummedCamera
|
|
34
37
|
return SummedCamera.new(self, other)
|
|
35
38
|
end
|
|
36
39
|
|
|
@@ -49,4 +52,4 @@ function XZPlaneLockCamera.__index(self: XZPlaneLockCamera, index)
|
|
|
49
52
|
end
|
|
50
53
|
end
|
|
51
54
|
|
|
52
|
-
return XZPlaneLockCamera
|
|
55
|
+
return XZPlaneLockCamera
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
|
|
19
19
|
local require = require(script.Parent.loader).load(script)
|
|
20
20
|
|
|
21
|
+
local CameraEffectUtils = require("CameraEffectUtils")
|
|
21
22
|
local CameraState = require("CameraState")
|
|
22
23
|
local SummedCamera = require("SummedCamera")
|
|
23
|
-
local CameraEffectUtils = require("CameraEffectUtils")
|
|
24
24
|
|
|
25
25
|
local ZoomedCamera = {}
|
|
26
26
|
ZoomedCamera.ClassName = "ZoomedCamera"
|
|
@@ -95,4 +95,4 @@ function ZoomedCamera.__index(self: ZoomedCamera, index)
|
|
|
95
95
|
end
|
|
96
96
|
end
|
|
97
97
|
|
|
98
|
-
return ZoomedCamera
|
|
98
|
+
return ZoomedCamera
|
|
@@ -78,7 +78,7 @@ end
|
|
|
78
78
|
function CameraInputUtils.getCappedAspectRatio(viewportSize: Vector2): number
|
|
79
79
|
local x = math.clamp(viewportSize.X, 0, 1920)
|
|
80
80
|
local y = math.clamp(viewportSize.Y, 0, 1080)
|
|
81
|
-
return x/y
|
|
81
|
+
return x / y
|
|
82
82
|
end
|
|
83
83
|
|
|
84
|
-
return CameraInputUtils
|
|
84
|
+
return CameraInputUtils
|
|
@@ -26,25 +26,25 @@ local TOUCH_SENSITIVTY_ADJUST_MIN_Y = 0.5
|
|
|
26
26
|
@param delta Vector2
|
|
27
27
|
@return Vector2
|
|
28
28
|
]=]
|
|
29
|
-
function CameraTouchInputUtils.adjustTouchSensitivity(
|
|
29
|
+
function CameraTouchInputUtils.adjustTouchSensitivity(
|
|
30
|
+
currPitchAngle: number,
|
|
31
|
+
sensitivity: Vector2,
|
|
32
|
+
delta: Vector2
|
|
33
|
+
): Vector2
|
|
30
34
|
local multiplierY = TOUCH_SENSITIVTY_ADJUST_MAX_Y
|
|
31
35
|
if currPitchAngle > TOUCH_ADJUST_AREA_UP and delta.Y < 0 then
|
|
32
|
-
local fractionAdjust = (currPitchAngle - TOUCH_ADJUST_AREA_UP)/(MAX_Y - TOUCH_ADJUST_AREA_UP)
|
|
33
|
-
fractionAdjust = 1 - (1 - fractionAdjust)^3
|
|
34
|
-
multiplierY = TOUCH_SENSITIVTY_ADJUST_MAX_Y
|
|
35
|
-
TOUCH_SENSITIVTY_ADJUST_MAX_Y - TOUCH_SENSITIVTY_ADJUST_MIN_Y)
|
|
36
|
+
local fractionAdjust = (currPitchAngle - TOUCH_ADJUST_AREA_UP) / (MAX_Y - TOUCH_ADJUST_AREA_UP)
|
|
37
|
+
fractionAdjust = 1 - (1 - fractionAdjust) ^ 3
|
|
38
|
+
multiplierY = TOUCH_SENSITIVTY_ADJUST_MAX_Y
|
|
39
|
+
- fractionAdjust * (TOUCH_SENSITIVTY_ADJUST_MAX_Y - TOUCH_SENSITIVTY_ADJUST_MIN_Y)
|
|
36
40
|
elseif currPitchAngle < TOUCH_ADJUST_AREA_DOWN and delta.Y > 0 then
|
|
37
|
-
local fractionAdjust = (currPitchAngle - TOUCH_ADJUST_AREA_DOWN)/(MIN_Y - TOUCH_ADJUST_AREA_DOWN)
|
|
38
|
-
fractionAdjust = 1 - (1 - fractionAdjust)^3
|
|
39
|
-
multiplierY = TOUCH_SENSITIVTY_ADJUST_MAX_Y
|
|
40
|
-
TOUCH_SENSITIVTY_ADJUST_MAX_Y - TOUCH_SENSITIVTY_ADJUST_MIN_Y)
|
|
41
|
+
local fractionAdjust = (currPitchAngle - TOUCH_ADJUST_AREA_DOWN) / (MIN_Y - TOUCH_ADJUST_AREA_DOWN)
|
|
42
|
+
fractionAdjust = 1 - (1 - fractionAdjust) ^ 3
|
|
43
|
+
multiplierY = TOUCH_SENSITIVTY_ADJUST_MAX_Y
|
|
44
|
+
- fractionAdjust * (TOUCH_SENSITIVTY_ADJUST_MAX_Y - TOUCH_SENSITIVTY_ADJUST_MIN_Y)
|
|
41
45
|
end
|
|
42
46
|
|
|
43
|
-
return Vector2.new(
|
|
44
|
-
sensitivity.X,
|
|
45
|
-
sensitivity.Y * multiplierY
|
|
46
|
-
)
|
|
47
|
+
return Vector2.new(sensitivity.X, sensitivity.Y * multiplierY)
|
|
47
48
|
end
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
return CameraTouchInputUtils
|
|
50
|
+
return CameraTouchInputUtils
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
local require = require(script.Parent.loader).load(script)
|
|
8
8
|
|
|
9
|
-
local QFrame = require("QFrame")
|
|
10
9
|
local DuckTypeUtils = require("DuckTypeUtils")
|
|
10
|
+
local QFrame = require("QFrame")
|
|
11
11
|
|
|
12
12
|
local CameraFrame = {}
|
|
13
13
|
CameraFrame.ClassName = "CameraFrame"
|
|
@@ -197,4 +197,4 @@ function CameraFrame.__eq(a: CameraFrame, b: CameraFrame): boolean
|
|
|
197
197
|
return a.QFrame == b.QFrame and a.FieldOfView == b.FieldOfView
|
|
198
198
|
end
|
|
199
199
|
|
|
200
|
-
return CameraFrame
|
|
200
|
+
return CameraFrame
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
@class CameraFrame.story
|
|
3
3
|
]]
|
|
4
4
|
|
|
5
|
-
local require =
|
|
5
|
+
local require =
|
|
6
|
+
require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).bootstrapStory(script)
|
|
6
7
|
|
|
7
8
|
local CameraFrame = require("CameraFrame")
|
|
8
9
|
local CameraStoryUtils = require("CameraStoryUtils")
|
|
@@ -16,13 +17,21 @@ return function(target)
|
|
|
16
17
|
local viewportFrame = CameraStoryUtils.setupViewportFrame(maid, target)
|
|
17
18
|
|
|
18
19
|
local cameraCFrame = workspace.CurrentCamera.CFrame
|
|
19
|
-
local a = CameraFrame.new(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
local a = CameraFrame.new(
|
|
21
|
+
QFrame.fromCFrameClosestTo(
|
|
22
|
+
CFrame.new(cameraCFrame.Position + cameraCFrame.lookVector * 25 - 20 * cameraCFrame.RightVector),
|
|
23
|
+
QFrame.new()
|
|
24
|
+
),
|
|
25
|
+
70
|
|
26
|
+
)
|
|
27
|
+
local b = CameraFrame.new(
|
|
28
|
+
QFrame.fromCFrameClosestTo(
|
|
29
|
+
CFrame.new(cameraCFrame.Position + cameraCFrame.lookVector * 30 + 20 * cameraCFrame.RightVector)
|
|
30
|
+
* CFrame.Angles(math.pi / 3, 2 * math.pi / 3, 0),
|
|
31
|
+
QFrame.new()
|
|
32
|
+
),
|
|
33
|
+
70
|
|
34
|
+
)
|
|
26
35
|
|
|
27
36
|
local setup = CameraStoryUtils.getInterpolationFactory(maid, viewportFrame, -0.1, 1.1, 4, function(cameraFrame)
|
|
28
37
|
return cameraFrame.CFrame
|
|
@@ -37,12 +46,12 @@ return function(target)
|
|
|
37
46
|
end, Color3.new(0.5, 1, 0.5))
|
|
38
47
|
|
|
39
48
|
setup(function(t)
|
|
40
|
-
return CameraFrame.new((1 - t)*a.QFrame + t*b.QFrame, a.FieldOfView + (b.FieldOfView - a.FieldOfView)*t)
|
|
49
|
+
return CameraFrame.new((1 - t) * a.QFrame + t * b.QFrame, a.FieldOfView + (b.FieldOfView - a.FieldOfView) * t)
|
|
41
50
|
end, Color3.new(0.25, 0.25, 0.25), "Linear", Vector2.new(80, 0))
|
|
42
51
|
|
|
43
52
|
setup(function(t)
|
|
44
|
-
local result = ((b.QFrame*(a.QFrame
|
|
45
|
-
return CameraFrame.new(result, a.FieldOfView + (b.FieldOfView - a.FieldOfView)*t)
|
|
53
|
+
local result = ((b.QFrame * (a.QFrame ^ -1)) ^ t) * a.QFrame
|
|
54
|
+
return CameraFrame.new(result, a.FieldOfView + (b.FieldOfView - a.FieldOfView) * t)
|
|
46
55
|
end, Color3.new(0.5, 0.5, 1), "Quaternion", Vector2.new(0, -80))
|
|
47
56
|
|
|
48
57
|
setup(function(t)
|
|
@@ -61,4 +70,4 @@ return function(target)
|
|
|
61
70
|
return function()
|
|
62
71
|
maid:DoCleaning()
|
|
63
72
|
end
|
|
64
|
-
end
|
|
73
|
+
end
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
|
|
10
10
|
local require = require(script.Parent.loader).load(script)
|
|
11
11
|
|
|
12
|
+
local BaseObject = require("BaseObject")
|
|
13
|
+
local CameraEffectUtils = require("CameraEffectUtils")
|
|
14
|
+
local CameraStack = require("CameraStack")
|
|
12
15
|
local CameraStackService = require("CameraStackService")
|
|
13
16
|
local FadeBetweenCamera3 = require("FadeBetweenCamera3")
|
|
14
17
|
local ServiceBag = require("ServiceBag")
|
|
15
|
-
local BaseObject = require("BaseObject")
|
|
16
|
-
local CameraStack = require("CameraStack")
|
|
17
|
-
local CameraEffectUtils = require("CameraEffectUtils")
|
|
18
18
|
|
|
19
19
|
local CameraStateTweener = setmetatable({}, BaseObject)
|
|
20
20
|
CameraStateTweener.ClassName = "CameraStateTweener"
|
|
@@ -209,4 +209,4 @@ function CameraStateTweener.GetFader(self: CameraStateTweener): CameraEffectUtil
|
|
|
209
209
|
return self._fadeBetween
|
|
210
210
|
end
|
|
211
211
|
|
|
212
|
-
return CameraStateTweener
|
|
212
|
+
return CameraStateTweener
|