@quenty/camera 14.42.0 → 14.43.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 +6 -0
- package/package.json +5 -5
- package/src/Client/CameraStackService.lua +1 -1
- package/src/Client/Effects/FadeBetween/FadeBetweenCamera.lua +44 -13
- package/src/Client/Effects/FadeBetween/FadeBetweenCamera2.lua +45 -18
- package/src/Client/Effects/FadeBetween/FadeBetweenCamera4.lua +43 -15
- package/src/Client/Utility/CameraSubjectUtils.lua +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
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.43.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/camera@14.42.0...@quenty/camera@14.43.0) (2026-07-14)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **camera:** convert package to --!strict ([9fe73f4](https://github.com/Quenty/NevermoreEngine/commit/9fe73f4a3d2cc98a171f6e9f92e592d0aeb30d15))
|
|
11
|
+
|
|
6
12
|
# [14.42.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/camera@14.41.1...@quenty/camera@14.42.0) (2026-07-12)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/camera",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.43.0",
|
|
4
4
|
"description": "Quenty's camera system for Roblox",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@quenty/acceltween": "2.7.0",
|
|
32
32
|
"@quenty/baseobject": "10.13.0",
|
|
33
33
|
"@quenty/cframeutils": "5.5.6",
|
|
34
|
-
"@quenty/cubicspline": "10.
|
|
34
|
+
"@quenty/cubicspline": "10.13.0",
|
|
35
35
|
"@quenty/draw": "7.14.1",
|
|
36
36
|
"@quenty/ducktype": "5.11.0",
|
|
37
37
|
"@quenty/inputobjectutils": "4.30.1",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@quenty/maid": "3.9.0",
|
|
40
40
|
"@quenty/math": "2.7.5",
|
|
41
41
|
"@quenty/nevermore-test-runner": "1.4.0",
|
|
42
|
-
"@quenty/qframe": "10.
|
|
42
|
+
"@quenty/qframe": "10.23.0",
|
|
43
43
|
"@quenty/rx": "13.28.3",
|
|
44
44
|
"@quenty/servicebag": "11.18.1",
|
|
45
45
|
"@quenty/spring": "10.12.0",
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"@quentystudios/jest-lua": "3.10.0-quenty.2"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@quenty/camerastoryutils": "10.
|
|
51
|
+
"@quenty/camerastoryutils": "10.22.0"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "13f0162f4971a77378e55e9b7236aea94f0dd3a8"
|
|
57
57
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
--!
|
|
1
|
+
--!strict
|
|
2
2
|
--[=[
|
|
3
3
|
Add another layer of effects that can be faded in/out
|
|
4
4
|
@class FadeBetweenCamera
|
|
@@ -6,6 +6,7 @@
|
|
|
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 CubicSplineUtils = require("CubicSplineUtils")
|
|
11
12
|
local Spring = require("Spring")
|
|
@@ -15,17 +16,44 @@ local SummedCamera = require("SummedCamera")
|
|
|
15
16
|
local FadeBetweenCamera = {}
|
|
16
17
|
FadeBetweenCamera.ClassName = "FadeBetweenCamera"
|
|
17
18
|
|
|
19
|
+
export type FadeBetweenCamera =
|
|
20
|
+
typeof(setmetatable(
|
|
21
|
+
{} :: {
|
|
22
|
+
_spring: Spring.Spring<number>,
|
|
23
|
+
CameraA: CameraEffectUtils.CameraLike,
|
|
24
|
+
CameraB: CameraEffectUtils.CameraLike,
|
|
25
|
+
CameraState: CameraState.CameraState,
|
|
26
|
+
CameraStateA: CameraState.CameraState,
|
|
27
|
+
CameraStateB: CameraState.CameraState,
|
|
28
|
+
Damper: number,
|
|
29
|
+
Value: number,
|
|
30
|
+
Speed: number,
|
|
31
|
+
Target: number,
|
|
32
|
+
Velocity: number,
|
|
33
|
+
HasReachedTarget: boolean,
|
|
34
|
+
Spring: Spring.Spring<number>,
|
|
35
|
+
},
|
|
36
|
+
{} :: typeof({ __index = FadeBetweenCamera })
|
|
37
|
+
))
|
|
38
|
+
& CameraEffectUtils.CameraEffect
|
|
39
|
+
|
|
18
40
|
--[=[
|
|
19
41
|
@param cameraA CameraLike
|
|
20
42
|
@param cameraB CameraLike
|
|
21
43
|
@return FadeBetweenCamera
|
|
22
44
|
]=]
|
|
23
|
-
function FadeBetweenCamera.new(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
45
|
+
function FadeBetweenCamera.new(
|
|
46
|
+
cameraA: CameraEffectUtils.CameraLike,
|
|
47
|
+
cameraB: CameraEffectUtils.CameraLike
|
|
48
|
+
): FadeBetweenCamera
|
|
49
|
+
local self: FadeBetweenCamera = setmetatable(
|
|
50
|
+
{
|
|
51
|
+
_spring = Spring.new(0),
|
|
52
|
+
CameraA = cameraA or error("No cameraA"),
|
|
53
|
+
CameraB = cameraB or error("No cameraB"),
|
|
54
|
+
} :: any,
|
|
55
|
+
FadeBetweenCamera
|
|
56
|
+
)
|
|
29
57
|
|
|
30
58
|
self.Damper = 1
|
|
31
59
|
self.Speed = 15
|
|
@@ -33,11 +61,14 @@ function FadeBetweenCamera.new(cameraA, cameraB)
|
|
|
33
61
|
return self
|
|
34
62
|
end
|
|
35
63
|
|
|
36
|
-
function FadeBetweenCamera
|
|
64
|
+
function FadeBetweenCamera.__add(
|
|
65
|
+
self: FadeBetweenCamera,
|
|
66
|
+
other: CameraEffectUtils.CameraEffect
|
|
67
|
+
): SummedCamera.SummedCamera
|
|
37
68
|
return SummedCamera.new(self, other)
|
|
38
69
|
end
|
|
39
70
|
|
|
40
|
-
function FadeBetweenCamera
|
|
71
|
+
function FadeBetweenCamera.__newindex(self: FadeBetweenCamera, index, value)
|
|
41
72
|
if index == "Damper" then
|
|
42
73
|
self._spring.Damper = value
|
|
43
74
|
elseif index == "Value" then
|
|
@@ -49,7 +80,7 @@ function FadeBetweenCamera:__newindex(index, value)
|
|
|
49
80
|
elseif index == "Velocity" then
|
|
50
81
|
self._spring.Velocity = value
|
|
51
82
|
elseif index == "CameraA" or index == "CameraB" then
|
|
52
|
-
rawset(self, index, value)
|
|
83
|
+
rawset(self :: any, index, value)
|
|
53
84
|
else
|
|
54
85
|
error(string.format("%q is not a valid member of FadeBetweenCamera", tostring(index)))
|
|
55
86
|
end
|
|
@@ -61,7 +92,7 @@ end
|
|
|
61
92
|
@prop CameraState CameraState
|
|
62
93
|
@within FadeBetweenCamera
|
|
63
94
|
]=]
|
|
64
|
-
function FadeBetweenCamera
|
|
95
|
+
function FadeBetweenCamera.__index(self: FadeBetweenCamera, index)
|
|
65
96
|
if index == "CameraState" then
|
|
66
97
|
local _, t = SpringUtils.animating(self._spring)
|
|
67
98
|
if t <= 0 then
|
|
@@ -97,9 +128,9 @@ function FadeBetweenCamera:__index(index)
|
|
|
97
128
|
return newState
|
|
98
129
|
end
|
|
99
130
|
elseif index == "CameraStateA" then
|
|
100
|
-
return self.CameraA.CameraState or self.CameraA
|
|
131
|
+
return (self.CameraA :: any).CameraState or self.CameraA
|
|
101
132
|
elseif index == "CameraStateB" then
|
|
102
|
-
return self.CameraB.CameraState or self.CameraB
|
|
133
|
+
return (self.CameraB :: any).CameraState or self.CameraB
|
|
103
134
|
elseif index == "Damper" then
|
|
104
135
|
return self._spring.Damper
|
|
105
136
|
elseif index == "Value" then
|
|
@@ -1,37 +1,64 @@
|
|
|
1
|
-
--!
|
|
1
|
+
--!strict
|
|
2
2
|
--[=[
|
|
3
3
|
@class FadeBetweenCamera2
|
|
4
4
|
]=]
|
|
5
5
|
|
|
6
6
|
local require = require(script.Parent.loader).load(script)
|
|
7
7
|
|
|
8
|
+
local CameraEffectUtils = require("CameraEffectUtils")
|
|
8
9
|
local CameraState = require("CameraState")
|
|
9
10
|
local CubicSplineUtils = require("CubicSplineUtils")
|
|
10
11
|
|
|
11
12
|
local FadeBetweenCamera2 = {}
|
|
12
13
|
FadeBetweenCamera2.ClassName = "FadeBetweenCamera2"
|
|
13
|
-
|
|
14
|
+
|
|
15
|
+
export type FadeBetweenCamera2 =
|
|
16
|
+
typeof(setmetatable(
|
|
17
|
+
{} :: {
|
|
18
|
+
CameraA: CameraEffectUtils.CameraEffect,
|
|
19
|
+
CameraB: CameraEffectUtils.CameraEffect,
|
|
20
|
+
CameraState: CameraState.CameraState,
|
|
21
|
+
Value: number,
|
|
22
|
+
Target: number,
|
|
23
|
+
HasReachedTarget: boolean,
|
|
24
|
+
Speed: number,
|
|
25
|
+
Velocity: number,
|
|
26
|
+
_state0: CameraState.CameraState,
|
|
27
|
+
_time0: number,
|
|
28
|
+
_target: number,
|
|
29
|
+
_position0: number,
|
|
30
|
+
_speed: number,
|
|
31
|
+
},
|
|
32
|
+
{} :: typeof({ __index = FadeBetweenCamera2 })
|
|
33
|
+
))
|
|
34
|
+
& CameraEffectUtils.CameraEffect
|
|
14
35
|
|
|
15
36
|
--[=[
|
|
16
37
|
@param cameraA CameraLike
|
|
17
38
|
@param cameraB CameraLike
|
|
18
39
|
@return FadeBetweenCamera2
|
|
19
40
|
]=]
|
|
20
|
-
function FadeBetweenCamera2.new(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
41
|
+
function FadeBetweenCamera2.new(
|
|
42
|
+
cameraA: CameraEffectUtils.CameraEffect,
|
|
43
|
+
cameraB: CameraEffectUtils.CameraEffect
|
|
44
|
+
): FadeBetweenCamera2
|
|
45
|
+
local self: FadeBetweenCamera2 = setmetatable(
|
|
46
|
+
{
|
|
47
|
+
CameraA = cameraA or error("No cameraA"),
|
|
48
|
+
CameraB = cameraB or error("No cameraB"),
|
|
49
|
+
_state0 = cameraA.CameraState,
|
|
50
|
+
_time0 = os.clock(),
|
|
51
|
+
_target = 0,
|
|
52
|
+
_position0 = 0,
|
|
53
|
+
_speed = 15,
|
|
54
|
+
} :: any,
|
|
55
|
+
FadeBetweenCamera2
|
|
56
|
+
)
|
|
30
57
|
|
|
31
58
|
return self
|
|
32
59
|
end
|
|
33
60
|
|
|
34
|
-
function FadeBetweenCamera2
|
|
61
|
+
function FadeBetweenCamera2.__newindex(self: FadeBetweenCamera2, index, value)
|
|
35
62
|
if index == "Value" then
|
|
36
63
|
assert(type(value) == "number", "Bad value")
|
|
37
64
|
|
|
@@ -61,7 +88,7 @@ function FadeBetweenCamera2:__newindex(index, value)
|
|
|
61
88
|
local now = os.clock()
|
|
62
89
|
self._state0, self._position0 = self:_computeCameraState(self:_computeDoneProportion(now))
|
|
63
90
|
self._time0 = now
|
|
64
|
-
rawset(self, index, value)
|
|
91
|
+
rawset(self :: any, index, value)
|
|
65
92
|
else
|
|
66
93
|
error(string.format("%q is not a valid member of FadeBetweenCamera2", tostring(index)))
|
|
67
94
|
end
|
|
@@ -73,7 +100,7 @@ end
|
|
|
73
100
|
@prop CameraState CameraState
|
|
74
101
|
@within FadeBetweenCamera2
|
|
75
102
|
]=]
|
|
76
|
-
function FadeBetweenCamera2
|
|
103
|
+
function FadeBetweenCamera2.__index(self: FadeBetweenCamera2, index)
|
|
77
104
|
if index == "CameraState" then
|
|
78
105
|
local state, _ = self:_computeCameraState(self:_computeDoneProportion(os.clock()))
|
|
79
106
|
return state
|
|
@@ -94,7 +121,7 @@ function FadeBetweenCamera2:__index(index)
|
|
|
94
121
|
end
|
|
95
122
|
end
|
|
96
123
|
|
|
97
|
-
function FadeBetweenCamera2
|
|
124
|
+
function FadeBetweenCamera2._computeTargetState(self: FadeBetweenCamera2): CameraState.CameraState
|
|
98
125
|
if self._target == 0 then
|
|
99
126
|
return self.CameraA.CameraState
|
|
100
127
|
elseif self._target == 1 then
|
|
@@ -112,7 +139,7 @@ function FadeBetweenCamera2:_computeTargetState()
|
|
|
112
139
|
end
|
|
113
140
|
end
|
|
114
141
|
|
|
115
|
-
function FadeBetweenCamera2
|
|
142
|
+
function FadeBetweenCamera2._computeCameraState(self: FadeBetweenCamera2, t: number): (CameraState.CameraState, number)
|
|
116
143
|
if t <= 0 then
|
|
117
144
|
return self._state0, 0
|
|
118
145
|
end
|
|
@@ -133,7 +160,7 @@ function FadeBetweenCamera2:_computeCameraState(t)
|
|
|
133
160
|
end
|
|
134
161
|
end
|
|
135
162
|
|
|
136
|
-
function FadeBetweenCamera2
|
|
163
|
+
function FadeBetweenCamera2._computeDoneProportion(self: FadeBetweenCamera2, now: number): number
|
|
137
164
|
local dist_to_travel = math.abs(self._position0 - self._target)
|
|
138
165
|
if dist_to_travel == 0 then
|
|
139
166
|
return 1
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
--!
|
|
1
|
+
--!strict
|
|
2
2
|
--[=[
|
|
3
3
|
@class FadeBetweenCamera4
|
|
4
4
|
]=]
|
|
5
5
|
|
|
6
6
|
local require = require(script.Parent.loader).load(script)
|
|
7
7
|
|
|
8
|
+
local CameraEffectUtils = require("CameraEffectUtils")
|
|
8
9
|
local CameraState = require("CameraState")
|
|
9
10
|
local CubicSplineUtils = require("CubicSplineUtils")
|
|
10
11
|
local Spring = require("Spring")
|
|
@@ -12,28 +13,52 @@ local SpringUtils = require("SpringUtils")
|
|
|
12
13
|
|
|
13
14
|
local FadeBetweenCamera4 = {}
|
|
14
15
|
FadeBetweenCamera4.ClassName = "FadeBetweenCamera4"
|
|
15
|
-
|
|
16
|
+
|
|
17
|
+
export type FadeBetweenCamera4 =
|
|
18
|
+
typeof(setmetatable(
|
|
19
|
+
{} :: {
|
|
20
|
+
CameraA: CameraEffectUtils.CameraEffect,
|
|
21
|
+
CameraB: CameraEffectUtils.CameraEffect,
|
|
22
|
+
_spring: Spring.Spring<number>,
|
|
23
|
+
_position0: number,
|
|
24
|
+
_state0: CameraState.CameraState,
|
|
25
|
+
CameraState: CameraState.CameraState,
|
|
26
|
+
Value: number,
|
|
27
|
+
Target: number,
|
|
28
|
+
HasReachedTarget: boolean,
|
|
29
|
+
Speed: number,
|
|
30
|
+
Velocity: number,
|
|
31
|
+
},
|
|
32
|
+
{} :: typeof({ __index = FadeBetweenCamera4 })
|
|
33
|
+
))
|
|
34
|
+
& CameraEffectUtils.CameraEffect
|
|
16
35
|
|
|
17
36
|
--[=[
|
|
18
37
|
@param cameraA CameraLike
|
|
19
38
|
@param cameraB CameraLike
|
|
20
39
|
@return FadeBetweenCamera4
|
|
21
40
|
]=]
|
|
22
|
-
function FadeBetweenCamera4.new(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
41
|
+
function FadeBetweenCamera4.new(
|
|
42
|
+
cameraA: CameraEffectUtils.CameraEffect,
|
|
43
|
+
cameraB: CameraEffectUtils.CameraEffect
|
|
44
|
+
): FadeBetweenCamera4
|
|
45
|
+
local self: FadeBetweenCamera4 = setmetatable(
|
|
46
|
+
{
|
|
47
|
+
CameraA = cameraA or error("No cameraA"),
|
|
48
|
+
CameraB = cameraB or error("No cameraB"),
|
|
49
|
+
_spring = Spring.new(0),
|
|
50
|
+
_position0 = 0,
|
|
51
|
+
_state0 = cameraA.CameraState,
|
|
52
|
+
} :: any,
|
|
53
|
+
FadeBetweenCamera4
|
|
54
|
+
)
|
|
30
55
|
|
|
31
56
|
self._spring.s = 15
|
|
32
57
|
|
|
33
58
|
return self
|
|
34
59
|
end
|
|
35
60
|
|
|
36
|
-
function FadeBetweenCamera4
|
|
61
|
+
function FadeBetweenCamera4.__newindex(self: FadeBetweenCamera4, index, value)
|
|
37
62
|
if index == "Value" then
|
|
38
63
|
assert(type(value) == "number", "Bad value")
|
|
39
64
|
|
|
@@ -57,7 +82,7 @@ function FadeBetweenCamera4:__newindex(index, value)
|
|
|
57
82
|
|
|
58
83
|
local _, position = SpringUtils.animating(self._spring)
|
|
59
84
|
self._state0, self._position0 = self:_computeCameraState(position)
|
|
60
|
-
rawset(self, index, value)
|
|
85
|
+
rawset(self :: any, index, value)
|
|
61
86
|
else
|
|
62
87
|
error(string.format("%q is not a valid member of FadeBetweenCamera4", tostring(index)))
|
|
63
88
|
end
|
|
@@ -69,7 +94,7 @@ end
|
|
|
69
94
|
@prop CameraState CameraState
|
|
70
95
|
@within FadeBetweenCamera4
|
|
71
96
|
]=]
|
|
72
|
-
function FadeBetweenCamera4
|
|
97
|
+
function FadeBetweenCamera4.__index(self: FadeBetweenCamera4, index)
|
|
73
98
|
if index == "CameraState" then
|
|
74
99
|
local _, value = SpringUtils.animating(self._spring)
|
|
75
100
|
local state, _ = self:_computeCameraState(value)
|
|
@@ -93,7 +118,7 @@ function FadeBetweenCamera4:__index(index)
|
|
|
93
118
|
end
|
|
94
119
|
end
|
|
95
120
|
|
|
96
|
-
function FadeBetweenCamera4
|
|
121
|
+
function FadeBetweenCamera4._computeTargetState(self: FadeBetweenCamera4, target: number): CameraState.CameraState
|
|
97
122
|
if target <= 0 then
|
|
98
123
|
return self.CameraA.CameraState
|
|
99
124
|
elseif target >= 1 then
|
|
@@ -111,7 +136,10 @@ function FadeBetweenCamera4:_computeTargetState(target)
|
|
|
111
136
|
end
|
|
112
137
|
end
|
|
113
138
|
|
|
114
|
-
function FadeBetweenCamera4
|
|
139
|
+
function FadeBetweenCamera4._computeCameraState(
|
|
140
|
+
self: FadeBetweenCamera4,
|
|
141
|
+
position: number
|
|
142
|
+
): (CameraState.CameraState, number)
|
|
115
143
|
if position <= 0 then
|
|
116
144
|
return self:_computeTargetState(0), 0
|
|
117
145
|
elseif position >= 1 then
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
--!
|
|
1
|
+
--!strict
|
|
2
2
|
--[=[
|
|
3
3
|
@class CameraSubjectUtils
|
|
4
4
|
]=]
|
|
@@ -35,7 +35,7 @@ function CameraSubjectUtils.getRobloxCameraSubjectCFrame(cameraSubject: Instance
|
|
|
35
35
|
heightOffset = R15_HEAD_OFFSET
|
|
36
36
|
|
|
37
37
|
local rootPart = humanoid.RootPart
|
|
38
|
-
if bodyPartToFollow == rootPart then
|
|
38
|
+
if bodyPartToFollow == rootPart and rootPart then
|
|
39
39
|
local rootPartSizeOffset = (rootPart.Size.Y - HUMANOID_ROOT_PART_SIZE.Y) / 2
|
|
40
40
|
heightOffset = heightOffset + Vector3.new(0, rootPartSizeOffset, 0)
|
|
41
41
|
end
|