@quenty/camera 14.19.0-canary.70d42ea.0 → 14.19.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 +12 -1
- package/package.json +17 -17
- package/src/Client/Effects/DefaultCamera.lua +37 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,18 @@
|
|
|
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.19.0
|
|
6
|
+
# [14.19.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/camera@14.18.2...@quenty/camera@14.19.0) (2025-02-18)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Add FirstPerson detection to the DefaultCamera in the camera stack, to query Roblox state ([aff423f](https://github.com/Quenty/NevermoreEngine/commit/aff423f15f83ff0243b2b5ad9783c56b53f87e93))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [14.18.2](https://github.com/Quenty/NevermoreEngine/compare/@quenty/camera@14.18.1...@quenty/camera@14.18.2) (2025-01-22)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @quenty/camera
|
|
9
20
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/camera",
|
|
3
|
-
"version": "14.19.0
|
|
3
|
+
"version": "14.19.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.0",
|
|
29
|
-
"@quenty/baseobject": "10.
|
|
30
|
-
"@quenty/cframeutils": "5.5.0",
|
|
31
|
-
"@quenty/cubicspline": "10.
|
|
32
|
-
"@quenty/ducktype": "5.
|
|
33
|
-
"@quenty/inputobjectutils": "4.
|
|
34
|
-
"@quenty/loader": "10.
|
|
35
|
-
"@quenty/maid": "3.4.0",
|
|
36
|
-
"@quenty/math": "2.7.0",
|
|
37
|
-
"@quenty/qframe": "10.
|
|
38
|
-
"@quenty/servicebag": "11.
|
|
39
|
-
"@quenty/spring": "10.
|
|
40
|
-
"@quenty/valueobject": "13.
|
|
41
|
-
"@quenty/vector3utils": "10.
|
|
28
|
+
"@quenty/acceltween": "^2.5.0",
|
|
29
|
+
"@quenty/baseobject": "^10.8.0",
|
|
30
|
+
"@quenty/cframeutils": "^5.5.0",
|
|
31
|
+
"@quenty/cubicspline": "^10.8.0",
|
|
32
|
+
"@quenty/ducktype": "^5.8.0",
|
|
33
|
+
"@quenty/inputobjectutils": "^4.17.0",
|
|
34
|
+
"@quenty/loader": "^10.8.0",
|
|
35
|
+
"@quenty/maid": "^3.4.0",
|
|
36
|
+
"@quenty/math": "^2.7.0",
|
|
37
|
+
"@quenty/qframe": "^10.10.0",
|
|
38
|
+
"@quenty/servicebag": "^11.11.0",
|
|
39
|
+
"@quenty/spring": "^10.8.0",
|
|
40
|
+
"@quenty/valueobject": "^13.16.0",
|
|
41
|
+
"@quenty/vector3utils": "^10.8.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@quenty/camerastoryutils": "10.
|
|
44
|
+
"@quenty/camerastoryutils": "^10.10.0"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "184a407d8d7366c39009444c3c9a7023cb176471"
|
|
50
50
|
}
|
|
@@ -17,6 +17,7 @@ local SummedCamera = require("SummedCamera")
|
|
|
17
17
|
local Maid = require("Maid")
|
|
18
18
|
local CFrameUtils = require("CFrameUtils")
|
|
19
19
|
local CameraFrame = require("CameraFrame")
|
|
20
|
+
local ValueObject = require("ValueObject")
|
|
20
21
|
|
|
21
22
|
local EPSILON = 0.001
|
|
22
23
|
|
|
@@ -35,6 +36,8 @@ function DefaultCamera.new()
|
|
|
35
36
|
self._maid = Maid.new()
|
|
36
37
|
self._cameraState = CameraState.new(Workspace.CurrentCamera)
|
|
37
38
|
|
|
39
|
+
self._isFirstPerson = self._maid:Add(ValueObject.new(false, "boolean"))
|
|
40
|
+
|
|
38
41
|
return self
|
|
39
42
|
end
|
|
40
43
|
|
|
@@ -92,6 +95,32 @@ function DefaultCamera:SetLastSetCameraFrame(cameraFrame)
|
|
|
92
95
|
self._lastCameraFrame = CameraFrame.new(cameraFrame.QFrame, cameraFrame.FieldOfView)
|
|
93
96
|
end
|
|
94
97
|
|
|
98
|
+
--[=[
|
|
99
|
+
Gets whether the Roblox camera is in first person
|
|
100
|
+
]=]
|
|
101
|
+
function DefaultCamera:IsFirstPerson(): boolean
|
|
102
|
+
return self._isFirstPerson.Value
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
--[=[
|
|
106
|
+
Gets whether the Roblox camera is in first person
|
|
107
|
+
|
|
108
|
+
@return Observable<boolean>
|
|
109
|
+
]=]
|
|
110
|
+
function DefaultCamera:ObserveIsFirstPerson()
|
|
111
|
+
return self._isFirstPerson:Observe()
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
--[=[
|
|
115
|
+
Gets whether the Roblox camera is in first person
|
|
116
|
+
|
|
117
|
+
@param predicate ((inFirstPerson: boolean) -> boolean)?
|
|
118
|
+
@return Observable<Brio<boolean>>
|
|
119
|
+
]=]
|
|
120
|
+
function DefaultCamera:ObserveIsFirstPersonBrio(predicate)
|
|
121
|
+
return self._isFirstPerson:Observe(predicate)
|
|
122
|
+
end
|
|
123
|
+
|
|
95
124
|
--[=[
|
|
96
125
|
Binds the camera to RunService RenderStepped event.
|
|
97
126
|
|
|
@@ -125,11 +154,18 @@ function DefaultCamera:BindToRenderStep()
|
|
|
125
154
|
end)
|
|
126
155
|
|
|
127
156
|
RunService:BindToRenderStep("DefaultCamera_PostUpdate" .. self._key, Enum.RenderPriority.Camera.Value+2, function()
|
|
157
|
+
local camera = Workspace.CurrentCamera
|
|
158
|
+
|
|
159
|
+
-- Based upon Roblox's camera scripts
|
|
160
|
+
local distance = (camera.CFrame.Position - camera.Focus.Position).magnitude
|
|
161
|
+
self._isFirstPerson.Value = distance <= 0.75
|
|
162
|
+
|
|
128
163
|
-- Capture
|
|
129
|
-
self._cameraState = CameraState.new(
|
|
164
|
+
self._cameraState = CameraState.new(camera)
|
|
130
165
|
end)
|
|
131
166
|
|
|
132
167
|
maid:GiveTask(function()
|
|
168
|
+
self._isFirstPerson.Value = false
|
|
133
169
|
RunService:UnbindFromRenderStep("DefaultCamera_Preupdate" .. self._key)
|
|
134
170
|
RunService:UnbindFromRenderStep("DefaultCamera_PostUpdate" .. self._key)
|
|
135
171
|
end)
|