@quenty/camera 14.20.4-canary.559.9f38947.0 → 14.21.0-canary.0a5db80.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +3 -11
  2. package/package.json +15 -15
  3. package/src/Client/CameraStack.lua +2 -2
  4. package/src/Client/CameraStackService.lua +2 -2
  5. package/src/Client/CameraState.lua +2 -2
  6. package/src/Client/CameraUtils.lua +1 -1
  7. package/src/Client/CameraUtils.story.lua +4 -5
  8. package/src/Client/Controls/CameraControls.lua +1 -1
  9. package/src/Client/Controls/GamepadRotateModel.lua +1 -1
  10. package/src/Client/Effects/CameraEffectUtils.lua +1 -1
  11. package/src/Client/Effects/CustomCameraEffect.lua +1 -1
  12. package/src/Client/Effects/DefaultCamera.lua +2 -2
  13. package/src/Client/Effects/FadeBetween/FadeBetweenCamera.lua +7 -7
  14. package/src/Client/Effects/FadeBetween/FadeBetweenCamera2.lua +11 -11
  15. package/src/Client/Effects/FadeBetween/FadeBetweenCamera3.lua +8 -8
  16. package/src/Client/Effects/FadeBetween/FadeBetweenCamera4.lua +9 -17
  17. package/src/Client/Effects/FadingCamera.lua +3 -3
  18. package/src/Client/Effects/HeartbeatCamera.lua +4 -4
  19. package/src/Client/Effects/ImpulseCamera.lua +2 -2
  20. package/src/Client/Effects/ImpulseCamera.story.lua +6 -6
  21. package/src/Client/Effects/InverseFader.lua +3 -3
  22. package/src/Client/Effects/LagPointCamera.lua +3 -3
  23. package/src/Client/Effects/OverrideDefaultCameraToo.lua +5 -14
  24. package/src/Client/Effects/PointCamera.lua +2 -2
  25. package/src/Client/Effects/PushCamera.lua +2 -2
  26. package/src/Client/Effects/RotatedCamera.lua +3 -3
  27. package/src/Client/Effects/SmoothPositionCamera.lua +5 -5
  28. package/src/Client/Effects/SmoothRotatedCamera.lua +1 -1
  29. package/src/Client/Effects/SmoothZoomedCamera.lua +3 -3
  30. package/src/Client/Effects/SummedCamera.lua +9 -12
  31. package/src/Client/Effects/TrackCamera.lua +1 -1
  32. package/src/Client/Effects/XZPlaneLockCamera.lua +3 -6
  33. package/src/Client/Effects/ZoomedCamera.lua +2 -2
  34. package/src/Client/Input/CameraInputUtils.lua +2 -2
  35. package/src/Client/Input/CameraTouchInputUtils.lua +15 -15
  36. package/src/Client/Utility/CameraFrame.lua +2 -2
  37. package/src/Client/Utility/CameraFrame.story.lua +12 -21
  38. package/src/Client/Utility/CameraStateTweener.lua +4 -4
  39. package/src/Client/Utility/FieldOfViewUtils.lua +1 -1
  40. package/test/scripts/Client/ClientMain.client.lua +1 -1
  41. package/test/scripts/Server/ServerMain.server.lua +1 -1
package/CHANGELOG.md CHANGED
@@ -3,25 +3,17 @@
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.20.4-canary.559.9f38947.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/camera@14.20.3...@quenty/camera@14.20.4-canary.559.9f38947.0) (2025-05-10)
6
+ # [14.21.0-canary.0a5db80.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/camera@14.20.2...@quenty/camera@14.21.0-canary.0a5db80.0) (2025-05-10)
7
7
 
8
8
 
9
9
  ### Bug Fixes
10
10
 
11
- * Additional type checking updates ([05ba29a](https://github.com/Quenty/NevermoreEngine/commit/05ba29a03efc9f3feed74b34f1d9dfb237496214))
11
+ * Additional type checking updates ([7e008c5](https://github.com/Quenty/NevermoreEngine/commit/7e008c58547bd00b5904e56541454a38c8d72ccc))
12
12
 
13
13
 
14
14
  ### Features
15
15
 
16
- * Add even more types ([b31717d](https://github.com/Quenty/NevermoreEngine/commit/b31717d8c9f7620c457f5018a2affa760a65334a))
17
-
18
-
19
-
20
-
21
-
22
- ## [14.20.3](https://github.com/Quenty/NevermoreEngine/compare/@quenty/camera@14.20.2...@quenty/camera@14.20.3) (2025-04-10)
23
-
24
- **Note:** Version bump only for package @quenty/camera
16
+ * Add even more types ([0a5db80](https://github.com/Quenty/NevermoreEngine/commit/0a5db8004684dc3e76fd5944599a22602d48cfa9))
25
17
 
26
18
 
27
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/camera",
3
- "version": "14.20.4-canary.559.9f38947.0",
3
+ "version": "14.21.0-canary.0a5db80.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.8.4-canary.559.9f38947.0",
28
+ "@quenty/acceltween": "2.6.0-canary.0a5db80.0",
29
+ "@quenty/baseobject": "10.9.0-canary.0a5db80.0",
30
30
  "@quenty/cframeutils": "5.5.3",
31
- "@quenty/cubicspline": "10.8.4-canary.559.9f38947.0",
32
- "@quenty/ducktype": "5.8.5-canary.559.9f38947.0",
33
- "@quenty/inputobjectutils": "4.18.4-canary.559.9f38947.0",
34
- "@quenty/loader": "10.8.4-canary.559.9f38947.0",
35
- "@quenty/maid": "3.4.4-canary.559.9f38947.0",
31
+ "@quenty/cubicspline": "10.9.0-canary.0a5db80.0",
32
+ "@quenty/ducktype": "5.9.0-canary.0a5db80.0",
33
+ "@quenty/inputobjectutils": "4.19.0-canary.0a5db80.0",
34
+ "@quenty/loader": "10.9.0-canary.0a5db80.0",
35
+ "@quenty/maid": "3.5.0-canary.0a5db80.0",
36
36
  "@quenty/math": "2.7.3",
37
- "@quenty/qframe": "10.10.5-canary.559.9f38947.0",
38
- "@quenty/servicebag": "11.11.5-canary.559.9f38947.0",
39
- "@quenty/spring": "10.8.5-canary.559.9f38947.0",
40
- "@quenty/valueobject": "13.17.4-canary.559.9f38947.0",
41
- "@quenty/vector3utils": "10.8.5-canary.559.9f38947.0"
37
+ "@quenty/qframe": "10.11.0-canary.0a5db80.0",
38
+ "@quenty/servicebag": "11.12.0-canary.0a5db80.0",
39
+ "@quenty/spring": "10.9.0-canary.0a5db80.0",
40
+ "@quenty/valueobject": "13.18.0-canary.0a5db80.0",
41
+ "@quenty/vector3utils": "10.9.0-canary.0a5db80.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@quenty/camerastoryutils": "10.10.5-canary.559.9f38947.0"
44
+ "@quenty/camerastoryutils": "10.11.0-canary.0a5db80.0"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "gitHead": "9f38947767d202411936a5c98898033df5865da0"
49
+ "gitHead": "0a5db8004684dc3e76fd5944599a22602d48cfa9"
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")
13
12
  local CustomCameraEffect = require("CustomCameraEffect")
14
13
  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")
11
10
  local RunService = game:GetService("RunService")
12
11
  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")
9
10
  local CameraFrame = require("CameraFrame")
10
11
  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
@@ -81,4 +81,4 @@ function CameraUtils.isOnScreen(camera: Camera, position: Vector3): boolean
81
81
  return onScreen
82
82
  end
83
83
 
84
- return CameraUtils
84
+ return CameraUtils
@@ -2,8 +2,7 @@
2
2
  @class CameraUtils.story
3
3
  ]]
4
4
 
5
- local require =
6
- require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).bootstrapStory(script)
5
+ local require = require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).bootstrapStory(script)
7
6
 
8
7
  local Maid = require("Maid")
9
8
 
@@ -26,7 +25,7 @@ return function(target: Instance)
26
25
 
27
26
  local ball: Part = maid:Add(Instance.new("Part"))
28
27
  ball.Color = Color3.new(1, 0.5, 0.5)
29
- ball.Size = Vector3.new(2 * radius, 2 * radius, 2 * radius)
28
+ ball.Size = Vector3.new(2*radius, 2*radius, 2*radius)
30
29
  ball.Shape = Enum.PartType.Ball
31
30
  ball.CFrame = CFrame.new()
32
31
  ball.Anchored = true
@@ -35,7 +34,7 @@ return function(target: Instance)
35
34
  local function update()
36
35
  local absSize = viewportFrame.AbsoluteSize
37
36
  if absSize.x > 0 and absSize.y > 0 then
38
- local aspectRatio = absSize.x / absSize.y
37
+ local aspectRatio = absSize.x/absSize.y
39
38
  local dist = CameraUtils.fitSphereToCamera(radius, camera.FieldOfView, aspectRatio)
40
39
  camera.CFrame = CFrame.new(0, 0, dist)
41
40
  end
@@ -49,4 +48,4 @@ return function(target: Instance)
49
48
  return function()
50
49
  maid:DoCleaning()
51
50
  end
52
- end
51
+ 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")
17
16
  local SmoothRotatedCamera = require("SmoothRotatedCamera")
18
17
  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.
@@ -106,4 +106,4 @@ function GamepadRotateModel.HandleThumbstickInput(self: GamepadRotateModel, inpu
106
106
  end
107
107
  end
108
108
 
109
- return GamepadRotateModel
109
+ return GamepadRotateModel
@@ -25,4 +25,4 @@ export type CameraEffect = {
25
25
  ]=]
26
26
  export type CameraLike = CameraEffect | CameraState.CameraState
27
27
 
28
- return {}
28
+ return {}
@@ -57,4 +57,4 @@ function CustomCameraEffect.__index(self: CustomCameraEffect, index)
57
57
  end
58
58
  end
59
59
 
60
- return CustomCameraEffect
60
+ return CustomCameraEffect
@@ -9,9 +9,9 @@
9
9
 
10
10
  local require = require(script.Parent.loader).load(script)
11
11
 
12
- local HttpService = game:GetService("HttpService")
13
12
  local RunService = game:GetService("RunService")
14
13
  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 CameraState = require("CameraState")
9
- local CubicSplineUtils = require("CubicSplineUtils")
10
8
  local Spring = require("Spring")
11
- local SpringUtils = require("SpringUtils")
12
9
  local SummedCamera = require("SummedCamera")
10
+ local SpringUtils = require("SpringUtils")
11
+ local CameraState = require("CameraState")
12
+ local CubicSplineUtils = require("CubicSplineUtils")
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 CameraState = require("CameraState")
8
7
  local CubicSplineUtils = require("CubicSplineUtils")
8
+ local CameraState = require("CameraState")
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 CameraEffectUtils = require("CameraEffectUtils")
10
- local CameraFrame = require("CameraFrame")
11
- local CameraState = require("CameraState")
12
- local CubicSplineUtils = require("CubicSplineUtils")
13
- local FieldOfViewUtils = require("FieldOfViewUtils")
14
- local QFrame = require("QFrame")
15
9
  local Spring = require("Spring")
16
- local SpringUtils = require("SpringUtils")
17
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")
15
+ local CameraFrame = require("CameraFrame")
16
+ local CubicSplineUtils = require("CubicSplineUtils")
17
+ local CameraEffectUtils = require("CameraEffectUtils")
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 CameraState = require("CameraState")
8
7
  local CubicSplineUtils = require("CubicSplineUtils")
8
+ local CameraState = require("CameraState")
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,19 +122,11 @@ 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(
126
- self._position0,
127
- self._state0.CameraFrame,
128
- self._state0.CameraFrameDerivative
129
- )
125
+ node1 = CubicSplineUtils.newSplineNode(self._position0, self._state0.CameraFrame, self._state0.CameraFrameDerivative)
130
126
  else
131
127
  local b = self:_computeTargetState(1)
132
128
 
133
- node0 = CubicSplineUtils.newSplineNode(
134
- self._position0,
135
- self._state0.CameraFrame,
136
- self._state0.CameraFrameDerivative
137
- )
129
+ node0 = CubicSplineUtils.newSplineNode(self._position0, self._state0.CameraFrame, self._state0.CameraFrameDerivative)
138
130
  node1 = CubicSplineUtils.newSplineNode(1, b.CameraFrame, b.CameraFrameDerivative)
139
131
  end
140
132
 
@@ -144,4 +136,4 @@ function FadeBetweenCamera4:_computeCameraState(position)
144
136
  return newState, position
145
137
  end
146
138
 
147
- return FadeBetweenCamera4
139
+ 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")
11
9
  local Spring = require("Spring")
12
10
  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 CameraEffectUtils = require("CameraEffectUtils")
15
- local CameraState = require("CameraState")
16
- local Maid = require("Maid")
17
14
  local SummedCamera = require("SummedCamera")
15
+ local Maid = require("Maid")
16
+ local CameraState = require("CameraState")
17
+ local CameraEffectUtils = require("CameraEffectUtils")
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")
12
11
  local CameraState = require("CameraState")
13
12
  local Spring = require("Spring")
14
13
  local SpringUtils = require("SpringUtils")
15
14
  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,16 +2,15 @@
2
2
  @class ImpulseCamera.story
3
3
  ]]
4
4
 
5
- local require =
6
- require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).bootstrapStory(script)
5
+ local require = require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).bootstrapStory(script)
7
6
 
8
7
  local RunService = game:GetService("RunService")
9
8
  local Workspace = game:GetService("Workspace")
10
9
 
10
+ local Maid = require("Maid")
11
11
  local CameraStack = require("CameraStack")
12
- local DefaultCamera = require("DefaultCamera")
13
12
  local ImpulseCamera = require("ImpulseCamera")
14
- local Maid = require("Maid")
13
+ local DefaultCamera = require("DefaultCamera")
15
14
 
16
15
  return function(target)
17
16
  local maid = Maid.new()
@@ -68,8 +67,9 @@ return function(target)
68
67
  maid:GiveTask(button.Activated:Connect(impulse))
69
68
  end
70
69
 
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 CameraEffectUtils = require("CameraEffectUtils")
9
+ local SummedCamera = require("SummedCamera")
10
10
  local CameraState = require("CameraState")
11
+ local CameraEffectUtils = require("CameraEffectUtils")
11
12
  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")
10
9
  local CameraState = require("CameraState")
11
- local Spring = require("Spring")
12
10
  local SummedCamera = require("SummedCamera")
11
+ local Spring = require("Spring")
12
+ local CameraEffectUtils = require("CameraEffectUtils")
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 CameraEffectUtils = require("CameraEffectUtils")
20
- local CameraState = require("CameraState")
21
19
  local SummedCamera = require("SummedCamera")
22
20
  local Vector3Utils = require("Vector3Utils")
21
+ local CameraEffectUtils = require("CameraEffectUtils")
22
+ local CameraState = require("CameraState")
23
23
 
24
24
  local OverrideDefaultCameraToo = {}
25
25
  OverrideDefaultCameraToo.ClassName = "OverrideDefaultCameraToo"
@@ -41,11 +41,7 @@ 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(
45
- baseCamera: CameraEffectUtils.CameraEffect,
46
- defaultCamera: CameraEffectUtils.CameraEffect,
47
- predicate
48
- ): OverrideDefaultCameraToo
44
+ function OverrideDefaultCameraToo.new(baseCamera: CameraEffectUtils.CameraEffect, defaultCamera: CameraEffectUtils.CameraEffect, predicate): OverrideDefaultCameraToo
49
45
  local self: OverrideDefaultCameraToo = setmetatable({} :: any, OverrideDefaultCameraToo)
50
46
 
51
47
  self.BaseCamera = assert(baseCamera, "No baseCamera")
@@ -77,12 +73,7 @@ function OverrideDefaultCameraToo:__index(index)
77
73
  warn("[OverrideDefaultCameraToo] - No predicate set")
78
74
  end
79
75
 
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
- )
76
+ local angle = math.abs(Vector3Utils.angleBetweenVectors(result.CFrame:VectorToWorldSpace(Vector3.new(0, 0, -1)), Vector3.new(0, 1, 0)))
86
77
 
87
78
  -- If the camera is straight up and down then Roblox breaks
88
79
  if angle >= math.rad(0.1) and angle <= math.rad(179.9) then
@@ -98,4 +89,4 @@ function OverrideDefaultCameraToo:__index(index)
98
89
  end
99
90
  end
100
91
 
101
- return OverrideDefaultCameraToo
92
+ 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")
10
9
  local CameraState = require("CameraState")
11
10
  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")
12
11
  local CameraState = require("CameraState")
12
+ local getRotationInXZPlane = require("getRotationInXZPlane")
13
13
  local Math = require("Math")
14
14
  local SummedCamera = require("SummedCamera")
15
- local getRotationInXZPlane = require("getRotationInXZPlane")
15
+ local CameraEffectUtils = require("CameraEffectUtils")
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")
13
12
  local CameraState = require("CameraState")
14
- local SummedCamera = require("SummedCamera")
15
13
  local getRotationInXZPlane = require("getRotationInXZPlane")
14
+ local SummedCamera = require("SummedCamera")
15
+ local CameraEffectUtils = require("CameraEffectUtils")
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
- CameraFrame.new(QFrame.fromVector3(self.Position, baseCameraFrame.QFrame), baseCameraFrame.FieldOfView)
65
+ local cameraFrame = CameraFrame.new(
66
+ QFrame.fromVector3(self.Position, baseCameraFrame.QFrame),
67
+ baseCameraFrame.FieldOfView)
67
68
  local cameraFrameDerivative = CameraFrame.new(
68
69
  QFrame.fromVector3(self.Velocity, baseCameraFrameDerivative.QFrame),
69
- baseCameraFrameDerivative.FieldOfView
70
- )
70
+ baseCameraFrameDerivative.FieldOfView)
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
@@ -178,4 +178,4 @@ function SmoothRotatedCamera.__index(self: SmoothRotatedCamera, index)
178
178
  end
179
179
  end
180
180
 
181
- return SmoothRotatedCamera
181
+ return SmoothRotatedCamera
@@ -9,10 +9,10 @@
9
9
 
10
10
  local require = require(script.Parent.loader).load(script)
11
11
 
12
- local CameraEffectUtils = require("CameraEffectUtils")
13
12
  local CameraState = require("CameraState")
14
- local Spring = require("Spring")
15
13
  local SummedCamera = require("SummedCamera")
14
+ local Spring = require("Spring")
15
+ local CameraEffectUtils = require("CameraEffectUtils")
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 CameraEffectUtils = require("CameraEffectUtils")
10
- local CameraFrame = require("CameraFrame")
11
- local CameraState = require("CameraState")
12
9
  local QFrame = require("QFrame")
10
+ local CameraState = require("CameraState")
11
+ local CameraFrame = require("CameraFrame")
12
+ local CameraEffectUtils = require("CameraEffectUtils")
13
13
 
14
14
  local SummedCamera = {}
15
15
  SummedCamera.ClassName = "SummedCamera"
@@ -90,18 +90,15 @@ 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
- local cameraFrameVelocity = CameraFrame.new(
102
- newQFrameVelocity,
103
- a.CameraFrameDerivative.FieldOfView + b.CameraFrameDerivative.FieldOfView
104
- )
98
+ a.CameraFrameDerivative.CFrame*b.CameraFrameDerivative.CFrame,
99
+ a.CameraFrameDerivative.QFrame)
100
+ local cameraFrameVelocity = CameraFrame.new(newQFrameVelocity,
101
+ a.CameraFrameDerivative.FieldOfView + b.CameraFrameDerivative.FieldOfView)
105
102
 
106
103
  local result = CameraState.new(cameraFrame, cameraFrameVelocity)
107
104
  -- result.CFrame =
@@ -119,4 +116,4 @@ function SummedCamera.__index(self: SummedCamera, index)
119
116
  end
120
117
  end
121
118
 
122
- return SummedCamera
119
+ return SummedCamera
@@ -104,4 +104,4 @@ function TrackCamera.__index(self: TrackCamera, index)
104
104
  end
105
105
  end
106
106
 
107
- return TrackCamera
107
+ return TrackCamera
@@ -6,10 +6,10 @@
6
6
 
7
7
  local require = require(script.Parent.loader).load(script)
8
8
 
9
- local CameraEffectUtils = require("CameraEffectUtils")
10
9
  local CameraState = require("CameraState")
11
10
  local SummedCamera = require("SummedCamera")
12
11
  local getRotationInXZPlane = require("getRotationInXZPlane")
12
+ local CameraEffectUtils = require("CameraEffectUtils")
13
13
 
14
14
  local XZPlaneLockCamera = {}
15
15
  XZPlaneLockCamera.ClassName = "XZPlaneLockCamera"
@@ -30,10 +30,7 @@ function XZPlaneLockCamera.new(camera: CameraEffectUtils.CameraLike): XZPlaneLoc
30
30
  return self
31
31
  end
32
32
 
33
- function XZPlaneLockCamera.__add(
34
- self: XZPlaneLockCamera,
35
- other: CameraEffectUtils.CameraEffect
36
- ): SummedCamera.SummedCamera
33
+ function XZPlaneLockCamera.__add(self: XZPlaneLockCamera, other: CameraEffectUtils.CameraEffect): SummedCamera.SummedCamera
37
34
  return SummedCamera.new(self, other)
38
35
  end
39
36
 
@@ -52,4 +49,4 @@ function XZPlaneLockCamera.__index(self: XZPlaneLockCamera, index)
52
49
  end
53
50
  end
54
51
 
55
- return XZPlaneLockCamera
52
+ 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")
22
21
  local CameraState = require("CameraState")
23
22
  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(
30
- currPitchAngle: number,
31
- sensitivity: Vector2,
32
- delta: Vector2
33
- ): Vector2
29
+ function CameraTouchInputUtils.adjustTouchSensitivity(currPitchAngle: number, sensitivity: Vector2, delta: Vector2): Vector2
34
30
  local multiplierY = TOUCH_SENSITIVTY_ADJUST_MAX_Y
35
31
  if currPitchAngle > TOUCH_ADJUST_AREA_UP and delta.Y < 0 then
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)
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 - fractionAdjust * (
35
+ TOUCH_SENSITIVTY_ADJUST_MAX_Y - TOUCH_SENSITIVTY_ADJUST_MIN_Y)
40
36
  elseif currPitchAngle < TOUCH_ADJUST_AREA_DOWN and delta.Y > 0 then
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)
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 - fractionAdjust * (
40
+ TOUCH_SENSITIVTY_ADJUST_MAX_Y - TOUCH_SENSITIVTY_ADJUST_MIN_Y)
45
41
  end
46
42
 
47
- return Vector2.new(sensitivity.X, sensitivity.Y * multiplierY)
43
+ return Vector2.new(
44
+ sensitivity.X,
45
+ sensitivity.Y * multiplierY
46
+ )
48
47
  end
49
48
 
50
- return CameraTouchInputUtils
49
+
50
+ return CameraTouchInputUtils
@@ -6,8 +6,8 @@
6
6
 
7
7
  local require = require(script.Parent.loader).load(script)
8
8
 
9
- local DuckTypeUtils = require("DuckTypeUtils")
10
9
  local QFrame = require("QFrame")
10
+ local DuckTypeUtils = require("DuckTypeUtils")
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,8 +2,7 @@
2
2
  @class CameraFrame.story
3
3
  ]]
4
4
 
5
- local require =
6
- require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).bootstrapStory(script)
5
+ local require = require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).bootstrapStory(script)
7
6
 
8
7
  local CameraFrame = require("CameraFrame")
9
8
  local CameraStoryUtils = require("CameraStoryUtils")
@@ -17,21 +16,13 @@ return function(target)
17
16
  local viewportFrame = CameraStoryUtils.setupViewportFrame(maid, target)
18
17
 
19
18
  local cameraCFrame = workspace.CurrentCamera.CFrame
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
- )
19
+ local a = CameraFrame.new(QFrame.fromCFrameClosestTo(
20
+ CFrame.new(cameraCFrame.Position + cameraCFrame.lookVector*25 - 20*cameraCFrame.RightVector),
21
+ QFrame.new()), 70)
22
+ local b = CameraFrame.new(QFrame.fromCFrameClosestTo(
23
+ CFrame.new(cameraCFrame.Position + cameraCFrame.lookVector*30 + 20*cameraCFrame.RightVector)
24
+ * CFrame.Angles(math.pi/3, 2*math.pi/3, 0),
25
+ QFrame.new()), 70)
35
26
 
36
27
  local setup = CameraStoryUtils.getInterpolationFactory(maid, viewportFrame, -0.1, 1.1, 4, function(cameraFrame)
37
28
  return cameraFrame.CFrame
@@ -46,12 +37,12 @@ return function(target)
46
37
  end, Color3.new(0.5, 1, 0.5))
47
38
 
48
39
  setup(function(t)
49
- return CameraFrame.new((1 - t) * a.QFrame + t * b.QFrame, a.FieldOfView + (b.FieldOfView - a.FieldOfView) * t)
40
+ return CameraFrame.new((1 - t)*a.QFrame + t*b.QFrame, a.FieldOfView + (b.FieldOfView - a.FieldOfView)*t)
50
41
  end, Color3.new(0.25, 0.25, 0.25), "Linear", Vector2.new(80, 0))
51
42
 
52
43
  setup(function(t)
53
- local result = ((b.QFrame * (a.QFrame ^ -1)) ^ t) * a.QFrame
54
- return CameraFrame.new(result, a.FieldOfView + (b.FieldOfView - a.FieldOfView) * t)
44
+ local result = ((b.QFrame*(a.QFrame^-1))^t)*a.QFrame
45
+ return CameraFrame.new(result, a.FieldOfView + (b.FieldOfView - a.FieldOfView)*t)
55
46
  end, Color3.new(0.5, 0.5, 1), "Quaternion", Vector2.new(0, -80))
56
47
 
57
48
  setup(function(t)
@@ -70,4 +61,4 @@ return function(target)
70
61
  return function()
71
62
  maid:DoCleaning()
72
63
  end
73
- end
64
+ 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")
15
12
  local CameraStackService = require("CameraStackService")
16
13
  local FadeBetweenCamera3 = require("FadeBetweenCamera3")
17
14
  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
@@ -81,4 +81,4 @@ function FieldOfViewUtils.lerpInHeightSpace(fov0: number, fov1: number, percent:
81
81
  return FieldOfViewUtils.heightToFov(FieldOfViewUtils.safeExp(newLogHeight, linearAt))
82
82
  end
83
83
 
84
- return FieldOfViewUtils
84
+ return FieldOfViewUtils
@@ -8,4 +8,4 @@ local serviceBag = require("ServiceBag").new()
8
8
  serviceBag:GetService(require("CameraStackService"))
9
9
 
10
10
  serviceBag:Init()
11
- serviceBag:Start()
11
+ serviceBag:Start()
@@ -5,4 +5,4 @@
5
5
  local ServerScriptService = game:GetService("ServerScriptService")
6
6
 
7
7
  local loader = ServerScriptService:FindFirstChild("LoaderUtils", true).Parent
8
- require(loader).bootstrapGame(ServerScriptService.camera)
8
+ require(loader).bootstrapGame(ServerScriptService.camera)